Quantcast
Channel: Data converters
Viewing all articles
Browse latest Browse all 27565

Forum Post: ADS1261: The LSB of conversion result alaways be 0xFF

$
0
0
Part Number: ADS1261 Hi all, I wrote a piece of code to read out the ADS1261 data. The send data via SPI is 0x12 0x02 0x00 0x00 0x00 0x00 0x00 the response data is 0xFF 0x08 0x03 0x11 0x88 0xFF 0x00, while the sixth byte should be LSB of conversion result. but I read out many times. the LSB alaway been 0xFF while the MSB and MID can change accordingly. BTW. I tried to send out 6 Bytes each time as datasheet decribed, but cannot start conversion continously. when I send 7 Bytes, it works. The registor read out data is 0x81 0x01 0x04 0x01 0x00 0x00 0x05 0x00 0x00 0x00 0x00 0x00 0x40 0xFF 0x00 0x00 0x80 0xBB 0x00 Could anyone help me to solve this problem? BR. Hang Li. uint32_t ADS1261 _Read_Data() { uint32_t ADC_Data_Temp = 0; ADC_Start; while( HAL_GPIO_ReadPin(AD_DRDY_GPIO_Port, AD_DRDY_Pin)) {} g_aSPI1_TxBuf[0] = 0x12; g_aSPI1_TxBuf[1] = 0x02; g_aSPI1_TxBuf[2] = 0x00; g_aSPI1_TxBuf[3] = 0x00; g_aSPI1_TxBuf[4] = 0x00; g_aSPI1_TxBuf[5] = 0x00; g_aSPI1_TxBuf[6] = 0x00; MX_SPI1_TxRxData(g_aSPI1_TxBuf, g_aSPI1_RxBuf, 7); ADC_Result_Temp[0]=g_aSPI1_RxBuf[3]; ADC_Result_Temp[1]=g_aSPI1_RxBuf[4]; ADC_Result_Temp[2]=g_aSPI1_RxBuf[5]; ADC_Result_Temp[3]=g_aSPI1_RxBuf[6]; ADC_Data_Temp = g_aSPI1_RxBuf[5] + (g_aSPI1_RxBuf[4] *0x100) +(g_aSPI1_RxBuf[3] * 0x10000); return ADC_Data_Temp; }

Viewing all articles
Browse latest Browse all 27565

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>