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.

ads7960 always gives 0xffff

Other Parts Discussed in Thread: ADS7960

Hi,

We are using ads7960 adc. 

When we try to read the data from channel, It is giving 0xffff.

We are using 0x1000 command to read the data from first channel.

In the data sheet, the sclk value is mentioned as 20MHz. Is this the only required value for proper functioning?

My board file entry for spi device is:

{
.modalias = "ads7960",
.irq = -1,
.max_speed_hz = 20000000,
.bus_num = 1,
.chip_select = 0,
},

Can anybody tell, what am i doing wrong?

regards,

Praveen

  • Hello Praveen,

    Please make sure that you are using correct clock polarity for SDI. Data is latched into ADS7960 on rising edge of SCLK. and you should program mode control register to be 0x1840 to select input range to be 5V, select channel 0 in next frame. The data in manual mode for channel 0 after power up or reset is invalid in first frame.

    Thanks

    Lokesh

  • thanks Lokesh,

    I found the problem, the chip select must go high after each write and read,  that is accomplished by spi_write() & spi_read call.

    Before I was using spi_write_then_read call(), so for complete write-read duration chip select was low.

    regards,

    Praveen