This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Problem using the nRF52840 to interface an ADS1298 via SPI

Hi DevZone,

I am using the nRF52840 to interface an ADS1298 (ECG Chip) via SPI.

I want to test if the communication between the devices are working by:

    -  Sending a RREG (Read From Register) opcode from the nRF52840 to the ADS1298

    -  And then read its ID Register.

The RREG command is two bytes long, and for multi-byte commands the following needs to be done:

    1.  Send the first byte and then wait for 4 * tCLK  before sending the next byte.

    2. The CS (or SS) pin needs to be held low during the entire session for both transfer and receive.

I am trying to test this with the example provided in the nRF5 SDK 15.3 by using this function:

    -  nrf_drv_spi_transfer(&spi, m_tx_buf, m_length, m_rx_buf, m_length);

My problem is that:

    -  I cannot insert a delay between the bytes when using the nrf_drv_spi_tranfer() for multiple byte transfers

    -  If i use separate calls of the nrf_drv_spi_transfer() for each byte, then the CS pin is not held low.

Is there any way I can use this driver to send multiple bytes with a fixed delay between them, without the CS pin going high during the session?

Thank you for reading

Br. Casper

Parents
  • Hi hmolesworth,

    Thank you for taking your time to reply again!

    I am aware that the ADS1298 is starting in RDATAC mode by default, and I am sending the SDATAC command prior to attempting to send the RREG opcode to read the ID-register. At the moment I am running the SPI at a low 500kHz.

    According to TI's FAQ for the ADS129x devices: https://e2e.ti.com/support/data-converters/f/73/t/772058

    it could be a problem with my Power-Up sequencing. 

    I am supplying the ADS1298 Development board directly from my nRF82840 development board via 3.0V single supply. This is configured so that both the analog voltage (AVDD) and the digital voltage (DVDD) is supplied.

    According to the datasheet, the correct Power-Up sequence is as follows: (I am using the internal 2.048MHz clock for now)

     

    To try and adhere to these specifications I have made a simple test code:

        // Powerup Sequence:
        nrf_gpio_pin_set(ADS1298_PWDN_PIN);     // 1) Powerup the ADS1298
        nrf_gpio_pin_set(ADS1298_RESET_PIN);    // 2) Set the RESET pin high
        nrf_delay_ms(100);                      // 3) Wait after powerup until reset
        nrf_gpio_pin_clear(ADS1298_RESET_PIN);  // 4) Set RESET pin low for a minimum of 2 * tCLK
        nrf_delay_ms(10);                       // 5) wait > 2 * tCLK
        nrf_gpio_pin_set(ADS1298_RESET_PIN);    // 6) Setting RESET pin high now enables the digital portion of the ADS1298
        nrf_delay_ms(100);                      // 7) Wait > 18 * tCLK Before starting to use the device
        

    But perhaps I am stilling missing something. Could it be that I actually have to toggle the power supply completely to the board, and using the /PWDN pin is not enough?

    Thank you again for reading!

    Br. Casper

  • Are you using an external clock?
    In that case, it seems you need to supply a clock signal on the SCK pin before resetting the device. 


    There's a fairly detailed start-up sequence description in 10.1.1 Setting the Device for Basic Data Capture. 



    From 11.1; "After releasing the RESET pin, program the configuration registers". 
    - It seems you must program the configuration registers before you can read the DEVICE_ID register. 


    I suggest you scope all I/O lines and all supply pins and compare their states with the datasheet's start-up and communication sequences. 


    Are you using the ADS1298 on a custom board or it's dev kit?
    - If you're using a custom board I suggest you submit your schematics and design files for review at TI. 

Reply
  • Are you using an external clock?
    In that case, it seems you need to supply a clock signal on the SCK pin before resetting the device. 


    There's a fairly detailed start-up sequence description in 10.1.1 Setting the Device for Basic Data Capture. 



    From 11.1; "After releasing the RESET pin, program the configuration registers". 
    - It seems you must program the configuration registers before you can read the DEVICE_ID register. 


    I suggest you scope all I/O lines and all supply pins and compare their states with the datasheet's start-up and communication sequences. 


    Are you using the ADS1298 on a custom board or it's dev kit?
    - If you're using a custom board I suggest you submit your schematics and design files for review at TI. 

Children
  • Hi haakonsh,

    Thank you for replying!

    I am using the Internal Clock of 2.048MHz as recommended in the datasheet because this application will be powered by battery, and therefore has to be low power.

    I am using Figure 93. Initial Flow at Power Up in section 10.1.1 as a guide for my Power-Up sequence.

    All of the I/O lines have been monitored with an oscilloscope I have confirmed that they all start out LOW at power up, and then I turn them on in the sequence described in 10.1.1 and 11.1 of the datasheet for the ADS1298.

    I am using the Development kit for the ADS1298, but I am not powering it with the MMBO board, but with the nRF82840 microcontroller. Single supply 3.0V.

    Still no luck though..

    Again, thank you very much for replying!

    Br. Casper

    1. I suggest you scope the ADS1298's power supply line for any fluctuations or noise during startup. 

    2. From 9.5.2:
      NDS Enable Read Data Continuous mode. RDATAC 0001 0000 (10h) — This mode is the default mode at power up.(1)

      (1) When in RDATAC mode, the RREG command is ignored.

      From 9.5.2.10:
      When the device is in read data continuous mode (RDATAC), it is necessary to issue a SDATAC command before a RREG command can be issued.

    3. From 11.1:
      Allow time for the supply voltages to reach their final value, and then begin supplying the master clock signal to the CLK pin. Wait for time tPOR, then transmit a reset pulse using either the RESET pin or RESET command to initialize the digital portion of the chip. Issue the reset after tPOR or after the VCAP1 voltage is greater than 1.1 V, whichever time is longer.

      Have you made sure that the clock signal is applied exactly when it's supposed to?



  • Thank you for reading again, it is really appreciated!

    1. I have now monitored the power supply upon startup and noticed that the VCAP1 voltage takes around 2.5 seconds to stabilize at a value above 1.1V. The charge curve looks like a normal RC charge. I made the mistake of not waiting long enough, assuming it wouldn't take that long. As you will see in a minute I have made contact with the ADS1298R, but I still have problems getting the expected values.

    2. I am sending the SDATAC command before attempting to read with the RREG command.

    3. Yes I have made sure that the clock signal is applied when it is supposed to.

Related