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.

ADC128D818SW-LINUX: Unable to get ADC reading.

Part Number: ADC128D818SW-LINUX
Other Parts Discussed in Thread: ADC128D818

Hello Community,

I am working on the ADC128D818 with the Raspberry Pi development board.

I would like to read the ADC channel readings in polling mode without interrupt functionality.

I am referring to the following documentation. 

https://www.ti.com/lit/ds/symlink/adc128d818.pdf?ts=1614142931923&ref_url=https%253A%252F%252Fwww.google.com%252F

I am using the application example mentioned in section 9.2.2.2.1.

Here are my ADC configuration settings.

Read Configuration register & initiaize the ADC
[2021-02-24T10:39:53.878+05:30][DEBUG]-  platform_read  : read_buffer  : 1D:00:09
[2021-02-24T10:39:53.878+05:30][DEBUG]-  platform_write : write_buffer : 1D:00:80

Check Busy Status
[2021-02-24T10:39:54.378+05:30][DEBUG]-  platform_read  : read_buffer  : 1D:0C:00

Read Adv Conf Reg & set the internal ref with mode 0 setting
[2021-02-24T10:39:54.378+05:30][DEBUG]-  platform_read  : read_buffer  : 1D:0B:00
[2021-02-24T10:39:54.378+05:30][DEBUG]-  platform_write : write_buffer : 1D:0B:00

Set conversion rate to contineus mode.
[2021-02-24T10:39:54.379+05:30][DEBUG]-  platform_write : write_buffer : 1D:07:01

enable the IN0 IN1 & IN2 channel & disable all remaining channels
[2021-02-24T10:39:54.379+05:30][DEBUG]-  platform_write : write_buffer : 1D:08:F8

Disable the INT Masking for all channels
[2021-02-24T10:39:54.379+05:30][DEBUG]-  platform_write : write_buffer : 1D:03:00

Set 0x00 High & Low limit for IN0 IN1 & IN2 channel
[2021-02-24T10:39:54.379+05:30][DEBUG]-  platform_write : write_buffer : 1D:2A:00
[2021-02-24T10:39:54.379+05:30][DEBUG]-  platform_write : write_buffer : 1D:2B:00
[2021-02-24T10:39:54.38+05:30][DEBUG]-   platform_write : write_buffer : 1D:2C:00
[2021-02-24T10:39:54.38+05:30][DEBUG]-   platform_write : write_buffer : 1D:2D:00
[2021-02-24T10:39:54.38+05:30][DEBUG]-   platform_write : write_buffer : 1D:2E:00
[2021-02-24T10:39:54.38+05:30][DEBUG]-   platform_write : write_buffer : 1D:2F:00

Start the conversion
[2021-02-24T10:39:54.38+05:30][DEBUG]-   platform_read  : read_buffer  : 1D:00:08
[2021-02-24T10:39:54.38+05:30][DEBUG]-   platform_write : write_buffer : 1D:00:09

Applied the 1.5V at the input of all 3 channles.

Read configuration register
[2021-02-24T10:39:59.381+05:30][DEBUG]-  platform_read  : read_buffer  : 1D:00:09

Read INT Status
[2021-02-24T10:39:59.381+05:30][DEBUG]-  platform_read  : read_buffer  : 1D:01:00

Read Busy Status
[2021-02-24T10:39:59.381+05:30][DEBUG]-  platform_read  : read_buffer  : 1D:0C:00

Read the ADC channel Readings
[2021-02-24T10:39:59.381+05:30][DEBUG]-  platform_read  : read_buffer  : 1D:20:00
[2021-02-24T10:39:59.381+05:30][DEBUG]-  platform_read  : read_buffer  : 1D:21:00
[2021-02-24T10:39:59.381+05:30][DEBUG]-  platform_read  : read_buffer  : 1D:22:00

I am getting the 0x00 reading.

will you please help me to know, Is there anything wrong I am doing with this?

How do I get the correct readings?

Regards,

Shiv Patil.

  • Hello Shiv,

    It is difficult to debug code, I suggest using an oscilloscope connected to the digital bus. This will provide a visual check and confirmation that the firmware is performing as expected. 

    I am guessing you are receiving the expected ACK from the ADC to the host when communicating, have you verified this? 

    You set the high and low limits at 0, which means any value at the inputs could trigger the INT pin. Can you test this, and see if when the INT pin is used, it is triggered when an input voltage is present. 

    Regards

    Cynthia