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.

ADS8201 doesn't work

Other Parts Discussed in Thread: ADS8201, ADS1115

Hi all,

I put this issue in other topic, but finally i see that topic was solved. Sorry about that.

In any case, I trying to implement a driver for ADS8201, I have some questions about protocol between ADC and microcontroller.

Datasheet don’t show SPI mode (00, 01, 10 or 11), What SPI mode use ADS8201?

I suppose that reset pin is always to high level if we want to operate in normal mode, if we want reset IC we only have to put reset pin to low level, ¿no?.

What is max. and min. baud rate of SPI?, I’m using by default 12MHz but I’m not sure  if this baud rate work with this IC.

Have you any test to verify communication between microcontroller and ADS8201? In this case write register 0x08 with 0x00 (idle mode), then write resgister 0x04 with 0x00 (channel 0) and then try to read register 0x04 to see if after write work, but I receive noise and other times I receive only 0x00. You can see in the picture below.


I’m intersting in “manual-trigger, mode 2”, if you have some example to share with us it will be great for me.

I have some noise in SPI pins, do you recommend me put pull up resistor or serial resistor to prevent reflections?

Thanks for all.

  • Hi Jose,

    For the ADS8201, consider the SPI interface to be Mode 0, where the SCLK dwells low and data is valid on the rising clock edge.  Mode two (operating mode of the ADS8201 that is) is the power on default as well as the HW/SW reset default.  The RESET input is active low, the HW reset can be implemented by toggling the RESET pin low.  Software reset can be implemented if the device is not in a power down state.  The MAX SCLK rate is 25MHz, so your 12MHz clock should not be an issue.  We'll look around to see if we have any sample code to share with you.

    In the meantime, how are you initiating the manual conversions?  I don't see where you are toggling the CONVST input in your screen shots above.

  • Hi Tom,

    I put SPI mode0 in my program, I’ll try with SPI mode1 again.

    I’ll appreciate some examples to implement mode2 of ADS8201.

    Are you sure that ADS8201 works fine with 12MHz clk?, this is because I can’t see this data in datasheet. In table1, we can see that typical clock period is 40ns (25MHz), and minimum clock low and high time is 10ns (perfect square signal (not is posible)), that is, 20ns of period (50Mhz) of max frequency. But, in any case, table1 doesn’t show us min clock period.

    I only try to test SPI communication between microcontroller and ADS8201, that is why you can’t see CONVST pin to low. I try to write register 0x04 (register 0x04 can be read in any ADS8201 mode operation) and then read register 0x04 and verify if register change. When SPI communication works, I try to implement an analog-digital conversion.

    Thanks for all.

  • Hi again,

    I set SPI mode 1 but ADS8201 don't respond to SPI commands. Now, ADS8201 SDI pin is always to low level, any idea?

    I put 3.3V in VD, VA and REF pins, i suppose that this is ok, no?

    Thanks for all.

     

  • Other question,

    If i have to write 2 register, for example put 0x00 in register 0x08 and then put 0x01 in register 0x04, Have i to clear and enable cs pin in each register?

     

    Case1:

    CS Low

    put 0x00 in register 0x08

    CS High

    CS Low

    put 0x01 in register 0x04

    CS High

     

    Case2:

    CS Low

    put 0x00 in register 0x08

    put 0x01 in register 0x04

    CS High

     

    Wich case is correct?

    Thanks for all.

  • Jose,

    You need to use Case 1.  CS must toggle after each transaction.

    Best regards,

    Bob B

  • Hi Bob,

    I put spi mode 0 and communication between microcontroller and ADS8102 works fine.

    Now my problem is when i want to get ADC conversion, in this case I try to use Mode2 and measure channel0, then channel1, then channel 2 and finally channel3, and repeat this sequence. To do this I write 0x9000, this is, write 0 in register 4, select channel 0

    0x9000 = 0b|10 | 0100 | 00 | 00000000, then 10 = write command, 0100 = register4; 00 = void; 00000000=data

    Then pulse CONVST signal 80ns, then ADS8201 put INT signal to low. By external interrupt service routine I acquire this interrupt signal and read ADC sending 0x0000 and 0x0000.

     My problem is if I write register 4 to 0, I read channel 1, if write register 4 to 1, read channel 1, if write register 4 to 2, I read channel 3, if I write register 4 to 3 read channel 3.

     Register           DataWrite        DataRead

    0x04                0                      1

    0x04                1                      1

    0x04                2                      3

    0x04                3                      3

    0x04                4                      5

    0x04                5                      5

    0x04                6                      7

    0x04                7                      7

     

    It seems to be like if only can read odd numbers …because when I read ADC, if we see Figure 30 of datasheet, we can see that the first 4 bits of second data is channel address and always appears odd channels indifferently of channel selected in register4…

     

    I attach you an image

     

     

    What is happening?, Any idea?

     

    Thanks for all.

  • Hi Jose,

    Can you zoom in on your command cycle set for us?

  • Yes, of course.

    SPI mode = 0;

    SPI bits = 16 bits

    baudrate = 12MHz

     

    General View

     

    Write command (select channel 2), 0x9002 = 10  0100  00   00000010

     

    Read ADC command,

    Then, my channel_0 have 1.7V, channel_1 -> 0.3V, channel_2 -> 3.3V , channel_3 i -> 0V

    0x0000 is value 0V.

    0x6000 = 0110   0000   0000   0000, thus 0110 are chanel 011 = 3 not channel 2 that we selected before, but value is correct.

     

    If we choose others channel, we can see this results

                  Write cmd        ADC
    MOSI    0x9002            0x0000    0x0000
    MISO    0x0000            0x0000    0x6000

    MOSI    0x9003            0x0000    0x0000
    MISO    0x0000            0x0000    0x6000

    MOSI    0x9000            0x0000    0x0000
    MISO    0x0000            0x1610    0x2000

    MOSI    0x9001            0x0000    0x0000
    MISO    0x0000            0x1610    0x2000

     

    What is wrong?, if we don't solve this issue, i'll be crazy...

    Thanks for all.

  • Jose,

    Hang in there, we'll get it figured out.

    It appears as though you are communicating correctly.  Have you tried reading the 0 channel without writing anything to the part?  The default mode is 2, and the default channel configuration is 0.  It would be interesting to see if there may be some form of communication problem that occurs later on.

    Have you tried reading back the register after writing it?  Have you verified that the setup and hold times are meeting specification?  In particular, CS going high after SCLK goes low.

    Best regards,

    Bob B

  • Hi Bob B

    I only capture 1 sample each 2ms, enough time to acquisition time + conversion delay + conversion time.

    If we only configure ADS8201 to generate an interrupt event when conversion finish and not write any register, we capture channel 0 without any problem, only with an error in measure that I suppose that we have to calibrate, no?.


    I improve SPI times, in special CS signal, we can see signal in oscilloscope (200MHz, 2GS/s)

     

    Orange -> MOSI               Blue-> MISO              Pink -> CLK               Green -> CS

    250ns between CS signal (high-low) and clk

     

     

    510 ns between CS (low-high) signal and clk


    Then do some test, I write registers and then read same registers than write…if we write register 4 to channel 0 and then read it, we read 1…

    General View

     

    Write commando, register 0 , channel 0

     

    Read command, register 0, chanel 1...before we write to get channel 0 and we can see that IC get channel 1...

     

    ADC command, read channel 1...same channel that we can read...it seems to be that not write well.

     

    Table with diferent test,

                               Write               Read                            ADC

    MOSI              0x9000            0x5000            0x0000            0x0000

    MISO              0x0000            0x0001            0x1670            0x2000

     

    MOSI              0x9001            0x5000            0x0000            0x0000

    MISO              0x0000            0x0001            0x1670            0x2000

     

    MOSI              0x9002            0x5000            0x0000            0x0000

    MISO              0x0000            0x0003            0x0000            0x6000

     

    MOSI              0x9003            0x5000            0x0000            0x0000

    MISO              0x0000            0x0003            0x0000            0x6000

     

    We can see that write command 0x9000 put channel 1, and 0x9002 put channel 3.


    By the way, i do some test in register 0x08 (ADC trigger SCR), i try to write resgister 8 to 0 (idle mode) and we read 2 (Mode2)...register not update with write command.

     

                              Write               Read

    MOSI              0xA000            0x6000          

    MISO              0x0000            0x0002

     

    I'm doing a lot of test, now i put microcontroller to SPI mode 1, and digital logic analyzer to show me data in SPI mode 0...do this is strange, I know...but in logical analyzer all data is correct, registers change well, analog conversion is correct, etc...but my microcontroller is acquireing data in SPI mode 1, and of course, not is "correct data"...

     

    Well, well, we are narrowing issue.


    I’ll be honest…and don’t know what is happening…?, but I hope we’ll achieve.


    Any idea with all this information?.


    Thanks for all.


    Jose.

  • Hi Jose,

    I've been in contact with Alberto Liberal and we'll send along some hardware and example code to you.  In the testing that I have done with Mode 2, raising /CS between the write CH command and the READADC command gives the proper conversion results for each channel (SE configuration, CH0-CH7).  We'll talk more about this off-line and I am trying to set up a conference call with all parties involved.

  • Hi Guys,

     

    I am having the same problem as this, in that I am writing registers and reading them back and the lsb is always one. I have checked the waveforms at the chip pins with a scope and they look fine. Did he problem get resolved and, if so, can you let me know the answer please

    Regards

     

    Chris

  • Dear Chris,

    I was trying to solve this issue but was imposible, and finaly I implement this with ADS1115 IC.

    Best regards.

    Jose.