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.

ADS1292: Read/Write ADS1292

Part Number: ADS1292

Hi, 

I'm trying to interface my ADS1292 with PSoC, however, I'm not able to read the register values (even the ID register returns 0x00).

Note that the ADS is functioning with default configurations. We're facing this issue with multiple ADS1292 chips.

These are the steps I followed while debugging:

1. Power-up sequence mentioned in the datasheet. 

2. Added delay as mentioned in a few other questions in the TI forum.

3. Checked the values of VCAP1, VCAP2, and VRef.

4. Probed the MISO/ CS/SCLK/DRDY lines and checked on the oscilloscope.

This is the code I have used:

0. Initialization

//Defines for Commands.
#define WakeUpCmd           0x02
#define StandByCmd          0x04
#define ResetCmd            0x06
#define StartCmd            0x08
#define StopCmd             0x0A
#define SDATACCmd           0x11
#define RDATACmd            0x12
#define ReadRegCmd          0x20
#define WriteRegCmd         0x40
// Defines for Register Addresses.
#define ID_Addr             0x00
#define CONFIG1_Addr        0x01
#define CONFIG2_Addr        0x02
#define CH1SET_Addr         0x04
#define CH2SET_Addr         0x05
#define RLDSENS_Addr        0x06
#define RESP1               0x09
#define RESP2               0x0A

1. Function for ADS Configuration

void my_ads_config(void)
{
    uint8 temp;
    
    /*Power UP Sequence*/
    Pin_MISO_Write(0);
    Pin_MOSI_Write(1);
    Pin_SCLK_Write(0);
    Pin_DRDY_Write(1);
    Pin_SS_Write(1);
    Pin_PWDN_Write(0);
    Pin_Start_Write(0);
    
    /*Wait for Tpor=1s*/
    CyDelay(1000);
    
    /*Set CLK=1*/
    Pin_SCLK_Write(1);
    
    /*Wait for Tpor=1s*/
    CyDelay(1000);
    
    /*RESET PULSE*/
    Pin_PWDN_Write(1);
    CyDelay(1000);
    Pin_PWDN_Write(0);
    CyDelay(1000);
    Pin_PWDN_Write(1);
    CyDelay(100);
    
    /*Reset communication*/
    Pin_SS_Write(0);
    CyDelay(1000);
    Pin_SS_Write(1);
    CyDelay(500);
    
    /* stop read data continous mode */
    SendCommand(SDATACCmd);
    CyDelay(10);
    
    /*Read ID register*/
    temp = ReadRegister(0x00);
    
    /* using internal buffer*/
    WriteRegister(CONFIG2_Addr, 0xA0);
    CyDelayUs(10);
    temp = ReadRegister(0x02);
 
    SendCommand(StartCmd);
}

2. Function to Read Register

 

uint8 ReadRegister (uint8_t ui8RegAddress)
{
    uint8_t tx_buf [3];
    uint8_t rx_buf[3];
    const uint8_t PACKET_SIZE = 3;
    Pin_SS_Write(0);
     
    /* Send write register command appended with the register address. */
    tx_buf[0] = ReadRegCmd | ui8RegAddress;
    CyDelayUs(5);
    tx_buf[1] = 0;
    CyDelayUs(5);
    tx_buf[2] =  0;
    CyDelayUs(5);
    
    /* start transfer */
    SPIM_ads_SpiUartPutArray(tx_buf, PACKET_SIZE);
    
    /* wait for the end of the transfer */
    while(PACKET_SIZE != SPIM_ads_SpiUartGetRxBufferSize());
    
    Pin_SS_Write(1);
    
    /* read RX buffer */
    rx_buf[0] = (uint8) SPIM_ads_SpiUartReadRxData();
    rx_buf[1] = (uint8) SPIM_ads_SpiUartReadRxData();
    rx_buf[2] = (uint8) SPIM_ads_SpiUartReadRxData();
    
    
    /* clear dummy bytes from RX buffer */
    SPIM_ads_SpiUartClearRxBuffer();
    
    /* return the register content */
    return(rx_buf[2]);
}

3. Function to write register

void WriteRegister (uint8_t ui8RegAddress, uint8_t ui8RegData)
{
    uint8_t tx_buf [3];
    const uint8_t PACKET_SIZE = 3;
  
    /* Send write register command appended with the register address. */
    tx_buf[0] = WriteRegCmd | ui8RegAddress;
    CyDelayUs(5);
    tx_buf[1] = 0;
    CyDelayUs(5);
    tx_buf[2] = ui8RegData;
    CyDelayUs(5);
    
    /* start transfer */
    SPIM_ads_SpiUartPutArray(tx_buf, PACKET_SIZE);
    
    /* wait for the end of the transfer */
    while(PACKET_SIZE != SPIM_ads_SpiUartGetRxBufferSize());
    
    /* clear dummy bytes from RX buffer */
    SPIM_ads_SpiUartClearRxBuffer();
}

  • Hi,

    May I ask for some more clarification?

    1. Do you happen to have/use a ADS1292 evaluation kit/board(EVM)? Or, are you using your own customized board and use PSoC to communicate with such board? What is the CLK frequency fCLK used?

    2. "(even the ID register returns 0x00)."   Yes, that's unexpected for ADS1292 device if you are using ADS1292(R).

    3. Would you please clarify when you say "Note that the ADS is functioning with default configurations. We're facing this issue with multiple ADS1292 chips."?

    So, does that mean you are able to read ECG signal or the internal Test Signal?

    "Multiple ADS1292 chips"  Are you daisy chain connecting multiple ADS1292 chips? Or, do you encounter same issue with different individual ADS1292 chips?

    It's great you did some debugging steps. How were the results? Do they all match/align with the datasheet?

    E.g. Could you provide some oscilloscope screenshot of the

    1. power up sequence referred to ADS1292 datasheet Page 65. You may probe AVDD, DVDD to represent the Power Supplies. What might be your AVDD, DVDD and VREF?

    2. Similar to step 1 power up sequence above, but make sure to
    wait for at least 2^12 tMOD(Note tMOD = 4 tCLK for CLK_DIV = 0(i.e. fCLK  = 512 kHz) for both power supply and /RESET after power supply ON supply to the chip 
    Then, pull the /RESET to low for at least 1 tMOD.
    Then, wait at least 18 tCLK after /RESET pulls high, you may proceed to the next step 3 read ID.

    3. timing(refer to datasheet page 50 Figure 54) when you read the the ID, i.e.  Register address 00H

    Also, in your Function for ADS Configuration /*Power UP Sequence*/ section -

    I am assuming these are the codes running on your Master PSoC, correct?

    Some comments -
    1. I don't see proper power up sequence that reflect the sequence and/or timing suggested above.
    2. I am assuming MISO leads to DOUT of ADS1292, and MOSI lead to DIN of ADS1292, correct?   Writing to MOSI(DIN) might be ok because it's a digital input. But, you probably don't want to write to MISO(DOUT) as it's a digital output and it may damage the pin... With this being said, do you need to define/set/configure your digital I/O pins to be either Input or Output?
    3. For Pin_SCLK_Write(0);  May I ask how do you generate the SCLK? Is this the proper way to do/write to SCLK pin? And what might be your SCLK frequency? Does it meet the datasheet?
    4. same for Pin_DRDY_Write(1);  DRDY is a digital output pin from the ADS1292; you probably don't want to write to DRDY as it's a digital output and it may damage the pin.
    5. Or, Does your /*Power Up Sequence*/ is actually doing I/O pin definition? A bit confusing, need clarification.
    6. What is the SS pin for?  Are Pin_PWDN_Write(0); and Pin_Start_Write(0);  doing the I/O definition or writing value?

    So, let's make sure your code before line 35 work, especially the power up and reset sequence work properly before proceed further.

    Feel free to let me know if you need to setup a call with me.

    Thanks.