u8 ADS1292_REG[12]; //ads1292寄存器数组
ADS1292_CONFIG2 Ads1292_Config2 ={PDB_LOFF_COMP,PDB_REFBUF,VREF,CLK_EN,INT_TEST}; //CONFIG2
ADS1292_CHSET Ads1292_Ch2set ={CNNNLE2_POWER,CNNNLE2_GAIN,CNNNLE2_MUX}; //CH2SET
ADS1292_LOFF_SENS Ads1292_Loff_Sens ={FLIP2,FLIP1,LOFF2N,LOFF2P,LOFF1N,LOFF1P}; //LOFF_SENS
ADS1292_RESP2 Ads1292_Resp2 ={CALIB,FREQ,RLDREF_INT};//RSP2
主程序里
while(Set_ADS1292_Collect(0))//0 正常采集 //1 1mV1Hz内部侧试信号 //2 内部短接噪声测试
{
printf("1292寄存器设置失败rn");
delay_s(1);
LED1=!LED1;
}
printf("寄存器设置成功rn");
delay_s(1);
LED0 =!LED0;
tiM2_Init(10000,7200);//系统指示
//TIM4_Init(2000,7200);//按键消抖
EXTI->IMR |= EXTI_Line8;//开DRDY中断
while(1){}
就一直卡在寄存器设置失败里出不去了
//配置ads1292采集方式
u8 Set_ADS1292_Collect(u8 mode)
{
u8 res;
delay_ms(10);
switch(mode)//设置采集方式
{
case 0:
res =ADS1292_Single_Read();
break;
case 1:
res =ADS1292_Single_Test();
break;
case 2:
res =ADS1292_Noise_Test();
break;
}
if(res)return 1;//寄存器设置失败
ADS1292_Send_CMD(RDATAC); //启动连续模式
delay_ms(10);
ADS1292_Send_CMD(START); //发送开始数据转换(等效于拉高START引脚)
delay_ms(10);
return 0;
}
0