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重复上电出现0x7fffff或0x800000,不断电,再怎么弄都不行,

Other Parts Discussed in Thread: ADS1232

void ADS1232_Init(void)
{
u8 i;

GPIO_InitTypeDef GPIO_InitStructure;

RCC_APB2PeriphClockCmd(
RCC_APB2Periph_AFIO
|RCC_APB2Periph_GPIOB
|RCC_APB2Periph_GPIOC
|RCC_APB2Periph_GPIOE
, ENABLE);

GPIO_PinRemapConfig(GPIO_Remap_SWJ_JTAGDisable,ENABLE);//关闭jtag,保留swd

//ADS1232
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_4 |GPIO_Pin_5|GPIO_Pin_6|GPIO_Pin_7|GPIO_Pin_8;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;
GPIO_Init(GPIOB, &GPIO_InitStructure);
GPIO_SetBits(GPIOB,GPIO_Pin_5);
GPIO_SetBits(GPIOB,GPIO_Pin_4 |GPIO_Pin_8);
GPIO_SetBits(GPIOB,GPIO_Pin_6|GPIO_Pin_7);


GPIO_InitStructure.GPIO_Pin = GPIO_Pin_3|GPIO_Pin_9;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IPU;
GPIO_Init(GPIOB, &GPIO_InitStructure);

GPIO_InitStructure.GPIO_Pin = GPIO_Pin_13;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;
GPIO_Init(GPIOC, &GPIO_InitStructure);

GPIO_InitStructure.GPIO_Pin = GPIO_Pin_0|GPIO_Pin_1|GPIO_Pin_3 |GPIO_Pin_4|GPIO_Pin_6;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;
GPIO_Init(GPIOE, &GPIO_InitStructure);

GPIO_InitStructure.GPIO_Pin = GPIO_Pin_2 |GPIO_Pin_5;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IPU;
GPIO_Init(GPIOE, &GPIO_InitStructure);


GPIO_InitStructure.GPIO_Pin = GPIO_Pin_0;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;
GPIO_Init(GPIOB, &GPIO_InitStructure);
GPIO_SetBits(GPIOB,GPIO_Pin_0);

//////////////////////////////////////////////////////////////////
delay_ms(20);
Res_1302;//拉低
delay_ms(10);

GPIO_WriteBit(GPIOB, GPIO_Pin_6, Bit_SET);
GPIO_WriteBit(GPIOB, GPIO_Pin_7, Bit_SET);//设置增益

RESET_CLK1 ;
RESET_CLK2 ;
RESET_CLK3 ;
Set(1);
Set(3);
Set(5);
delay_ms(10);

Set_1302;//拉高


for(i=0;i<26;i++)
{
SET_CLK1;
SET_CLK2;
SET_CLK3;
delay_us(3);
RESET_CLK1;
RESET_CLK2;
RESET_CLK3;
}

delay_ms(10);

/////////////////////////////////
Res_1302;//复位拉低
delay_ms(10);

GPIO_WriteBit(GPIOB, GPIO_Pin_6, Bit_SET);
GPIO_WriteBit(GPIOB, GPIO_Pin_7, Bit_SET);//设置增益

RESET_CLK1 ;
RESET_CLK2 ;
RESET_CLK3 ;
Set(2);
Set(4);
Set(6);
delay_ms(10);

Set_1302;//复位拉高
for(i=0;i<26;i++)
{
SET_CLK1;
SET_CLK2;
SET_CLK3;
delay_us(3);
RESET_CLK1;
RESET_CLK2;
RESET_CLK3;
}
delay_ms(10);

}

上面这段代码是初始化ads1232,没找到到底是程序上除了问题,还是电路设计上出了问题,看了网上有说吧外置晶振的两个电容去掉,试了也不行,重新换了晶振也不行。