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.

ADS131M08: Test SPI transactions to confirm circuit assembly

Part Number: ADS131M08

I just finished assembling my ADS131M08 circuit and i would like to test if the circuit assembly is correct. This is also a first prototype so a lot could go wrong in the circuit design stage. I was hoping if i could ask some help for a bare minimum of spi transaction to get an expected response from the adc. When I skimmed the example codes i estimated it would take me 2-3 days to make a functional code. This also helps me eliminate the headache of debugging later on if its the code not working or the hardware.

import spidev

spi = spidev.SpiDev()
spi.open(0,0)

spi.max_speed_hz = 10000000
spi.mode = 0b01   # [CPOL|CPHA]

to_send        = [0xAA,0xAA,0xAA,0xAA,0xAA,0xAA,0xAA,0xAA,0xAA,0xAA]     #  placeholder values
expected_reply = [0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0]    # placeholder values

reply = spi.xfer2(to_send)

print(expected_reply) 
print(reply)

The current setup uses and external 8.192Mhz Clock. I can confirm that i the circuit pulls the DRDY when the clock is applied, i just have to check if the SPI works.

I do apologize for the "spoon feeding" type of question, i just think this would help me move on with the hardware portion earlier.

  • Hi Peter,

    Welcome to our forum and thank you for your interest in our ADS131M08.

    Please have a look at our example C code project for the ADS131M08: www.ti.com/.../ADS131M08

    Best regards,

  • Hi Ryan,

    Thank you for your reply, as i am not finished building the SPI library of my specific controller its hard for me to test if the hardware is build/ assembled correctly. I did have a look at the example C codes but i could not fully make out what im attempting. 

    in the c example under ads131m0x.c - adcstartup(). there is this line of code

        /* (OPTIONAL) Validate first response word when beginning SPI communication: (0xFF20 | CHANCNT) */
    	uint16_t response = sendCommand(OPCODE_NULL);

    If im not mistaken the value of response is always the same whenever this line executes after a power up am i right?

    if so do yo think you can tell me what is the raw value of response is? and at the same time what are the raw value being sent to get response.

     

    I do not own a EVM so i could not really play with this by myself

  • It just dawned on me what CHANCNT mean now that i have a everything set up with the code -__-  . To the future readers who just like i am cant figure what it is it means channel count. So with the ads131m08 the first response would always be 0xFF28

    Here is a snap of a logic analyzer upon executing that line of code upon power up. It basically sends [0x00,0x00,0x00] and the recieve would looke like [0xFF,0x28,0x00].

    The code was run at 5Mhz , spi mode CPOL = 0 CPHA = 1. 

    Have a great day everyone.