This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

ADS1232总输出高电平

Other Parts Discussed in Thread: ADS1232, LM324

我用ADS1232采样一路数据,初始化后发现它不进行转换,哪位有空帮我看看,谢谢!

//ADS1232Ó¦Óö˿Ú
//A0£¬µØÖ·£¬SCK
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_12|GPIO_Pin_13;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
GPIO_Init(GPIOB,&GPIO_InitStructure);
GPIO_ResetBits(GPIOB,GPIO_Pin_12|GPIO_Pin_13);
//PDWN,SPEED,G1
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_7|GPIO_Pin_8|GPIO_Pin_9;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
GPIO_Init(GPIOC,&GPIO_InitStructure);
GPIO_ResetBits(GPIOC,GPIO_Pin_7|GPIO_Pin_8|GPIO_Pin_9);
//G2
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_8;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
GPIO_Init(GPIOA,&GPIO_InitStructure);
GPIO_ResetBits(GPIOA,GPIO_Pin_8);
//SDI£¬Êý¾ÝÏß
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_15;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN_FLOATING; //¸¡¿ÕÊäÈë
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
GPIO_Init(GPIOB,&GPIO_InitStructure);

u32 Read_ADS1232(void)
{
u32 TEMP = 0;
u8 i = 0;
for(i=0;i<24;i++)
{
TEMP<<=1;
SCK_High;
delay_us(2);
if(GPIO_ReadInputDataBit(GPIOB, GPIO_Pin_15)==1)
{
TEMP+=1;
}
else
{
;
}
SCK_Low;
delay_us(2);
}
SCK_High;
delay_us(2);
SCK_Low;
delay_ms(1);
return TEMP;
}

SCK_Low;
PDWN_Low;
delay_us(20);
G1_Low; //ÔöÒæÎª1
G2_Low;
A0_Low; //ͨµÀ1
SPEED_Low; //100msת»»Ò»´Î
PDWN_High;
delay_us(20);

while(1)
{
while(GPIO_ReadInputDataBit(GPIOB, GPIO_Pin_15)==1){}
AD_data = Read_ADS1232();
};