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.

ADS1220: communication stop after some time (not defined)

Part Number: ADS1220

Hello,

I am using ADS1220 in my application. I use 2pair of differencial inputs to read analog signal. My assumption is to optimize the current as much as possible, so I go through the power down as fast as possible. The assumption is also to measure two channels one above the other and then put it to sleep for a specific time. I chose the continuous mode  and full duplex as decribed in datasheet ( Figure 66. Example of Reading Data while Simultaneously Sending a WREG Command ).

I am using CS PIN (it is not tied low permanently). On SPI is only ADS1220 device. Below SPI configuration on uC:

#define NRF_DRV_SPI_DEFAULT_CONFIG                           \
{                                                            \
    .frequency    = NRF_DRV_SPI_FREQ_2M,                     \
    .mode         = NRF_DRV_SPI_MODE_1,                      \
    .bit_order    = NRF_DRV_SPI_BIT_ORDER_MSB_FIRST,         \
}

I have prepared two configurations for ADS1220:

static uint8_t m_tx_buf_CONF_1[] = {(WREG | CONF0 | 0x02), (MUX_P_AIN1_N_AIN0 | GAIN_128 | PGA_ON), (DR_G | NORMAL_MODE | CONTINOUS), (AVDD_REFIN | FIR_50_60 | PSW_OPEN | IDAC_OFF)};
static uint8_t m_tx_buf_CONF_2[] = {(WREG | CONF0 | 0x02), (MUX_P_AIN3_N_AIN2 | GAIN_128 | PGA_ON), (DR_G | NORMAL_MODE | CONTINOUS), (AVDD_REFIN | FIR_50_60 | PSW_OPEN | IDAC_OFF)};

Below I present pseudocode:

SEND_INIT_CONFIG (m_tx_buf_CONF_2)(CH2)

loop:
p.1 SEND_START (0x08)
p.2 WAIT_FOR_DRDY_IRQ
p.3 SEND_CONFIG ((m_tx_buf_CONF_1)(CH1)
    p.3.1 GET_CONVERSION_RESULT_DUPLEX(CH2)
p.4 WAIT_FOR_DRDY_IRQ
p.5 SEND_CONFIG ((m_tx_buf_CONF_2)(CH2)
    p.3.1 GET_CONVERSION_RESULT_DUPLEX(CH1)
p.6 SEND_POWERDOWN (0x02)
p.7 .... generic timer delay 
p.8. go to p.1

The code works very well, but for undefined reasons, SPI dies after some undefined communication time. Is my idea correct? Or should I do it differently? Could this be a timimg problem? Unfortunately, this is a difficult situation to debug. It is hard for me to wait half a day for this situation to occur.

I will be grateful for any help.

  • Hi Marcin,

    I don't see anything wrong with the code flow.  What I can think that might be happening is some transient event is taking place where ADS1220 has gone into a reset state.  If that is the case the register settings will return to the default power-up state and the ADS1220 will go to single-shot mode.  At some point in your loop you will not see DRDY go low.

    I would suggest that you monitor for this type of situation by using a timer similar to a watchdog where you reset the timer each cycle, but if the timer times out you run an error routine to check the device configuration and operation.

    Best regards,

    Bob B 

  • Hi Bob,

    Thank you for your comments, I will stay whether if the system goes into an unexpected RESET, whether sending the START / SYNC command (even if it is in the sigle -shot mode) which is triggered in a loop with a defined time interval will not resume device to work - DRDY low state?

    Your idea with dedicated timer similar to a watchdog is good proposition, I am only thinking what kind of error routine should I do ... perform a RESET command, then re-initialization and transition to main loop ? It will be enough?

    Best Reards

    Marcin

  • Hi Marcin,

    In your loop the the START/SYNC command is only sent once at P1 which means that if the device was reset the device will make one conversion and stop at P.4.

    As far as a handling procedure, I would first try to determine if a reset is taking place.  If there is a reset then you need to prevent this from happening.  One way the device can reset is if the Absolute Maximum Ratings of the ADS1220 has been exceeded.  One common way for this to happen is if a transient voltage enters the analog input pins.  You must make sure that the input is properly protected so that the input voltage does not exceed the analog supply, but if it does, the current through the pin is less than 10mA.  Adding TVS diodes and increasing the input filter resistances can help prevent this condition.

    Best regards,

    Bob B