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

Forum Post: RE: data mixing of two channels in ads1158

$
0
0

Hi Chetan,

I looked over your code and the only thing that stood out to me was that you do not read in the status byte.

The status byte on the ADS1158 is odd because you can only turn it on or off in some modes of operation. In fixed-channel mode and using the "Channel Data Read Command" (as you are using the ADS1158), the status byte is always enabled but undefined - even though you set STAT to 0 in the CONFIG0 register.

Therefore, I think you need to read in a 4th byte and just disregard it - here in your code:

spi_send_byte(0x30); // Channel Data Read Command
spi_send_byte(0x00);// junk status byte
adc_data[1] = spi_send_byte(0x00);
adc_data[2] = spi_send_byte(0x00);
adc_data[3] = spi_send_byte(0x00);

Best Regards,
Chris


Viewing all articles
Browse latest Browse all 89611

Trending Articles