TI中文支持网
TI专业的中文技术问题搜集分享网站

ADS131M02: 现在正在使用这款芯片,按照ADS131M04参考源码更改了相关值,发现读取寄存器返回值没问题,读取ADC通道数值一直为0,代码如下

Part Number:ADS131M02Other Parts Discussed in Thread:ADS131M03

bool ADS131_readData(adc_channel_data *DataStruct);

uint16_t sendCommand(uint16_t opcode);

以上两个函数未进行更改

void Ads131m3ADC_GetData(void)
{
adc_channel_data*ADS131M03;
uint8_t i=0;
if(u16ADS131_24Tick < 1000) return; //1S
PRINTF("*************************ADC131M************************\r\n");
// if(ads131m3_spi2_DRDY()==0x00)
uint16_t response = sendCommand(OPCODE_RREG|CH1_OCAL_MSB_ADDRESS<<7|0x00);;
response=sendCommand(OPCODE_RREG|CH1_OCAL_LSB_ADDRESS<<7|0x00); //101a aaaa annn nnnn// readSingleRegister(CH1_OCAL_MSB_ADDRESS);
for(i=0;i<2;i++)
{ PRINTF("ADS131M03->OPCODE_RREG_CH1_GCAL_MSB: %2x ",OPCODE_RREG|CH1_OCAL_LSB_ADDRESS<<7|0x00); ADS131_readData(ADS131M03);
// PRINTF("readadc_ads131m03 three channel data: \r\n");
PRINTF("ADS131M03->response: %2x ", ADS131M03->response);
PRINTF("ADS131M03->channel0: %2x ", ADS131M03->channel0);
PRINTF("ADS131M03->channel1: %2x ", ADS131M03->channel1);
PRINTF("ADS131M03->crc : %2x \r\n", ADS131M03->crc);
delay_us(1000);
ADS131_readData(ADS131M03);// PRINTF("readadc_ads131m03 three channel data: \r\n");
PRINTF("ADS131M03->response: %2x ", ADS131M03->response);
PRINTF("ADS131M03->channel0: %2x ", ADS131M03->channel0);
PRINTF("ADS131M03->channel1: %2x ", ADS131M03->channel1);
PRINTF("ADS131M03->crc : %2x \r\n", ADS131M03->crc); }
}

我看demo都外接了晶振,这款芯片必须要接时钟输入?

Amy Luo:

您好,

是的,CLKIN pin 需要外接时钟才能进行AD转换, ΔΣADC的调制器的调制频率就是由fCLKIN 提供的: fMOD = fCLKIN / 2.

赞(0)
未经允许不得转载:TI中文支持网 » ADS131M02: 现在正在使用这款芯片,按照ADS131M04参考源码更改了相关值,发现读取寄存器返回值没问题,读取ADC通道数值一直为0,代码如下
分享到: 更多 (0)

© 2024 TI中文支持网   网站地图 鲁ICP备2022002796号-1