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.

ADS1298RECGFE-PDK: SPI configuration

Part Number: ADS1298RECGFE-PDK
Other Parts Discussed in Thread: ADS1298R, ADS1298

Hi TI Support, 

I'm trying to interface the ADS1298R ECGFE with STM32 microcontrôleur using SPI peripheral. 

Unfortunately, I'm not able to read the device ID after sending 0b0010 0000 0b0000 0000 as command. 

I always receive nothing, below is my SPI Configuration: 

/* Initialize all configured peripherals */
hSpi->Instance = SPI1;
hSpi->Init.BaudRatePrescaler = SPI_BAUDRATEPRESCALER_4; // To get 20 MHz frequency 
hSpi->Init.Direction = SPI_DIRECTION_2LINES;
hSpi->Init.CLKPhase = SPI_PHASE_2EDGE; // CPHA High
hSpi->Init.CLKPolarity = SPI_POLARITY_LOW; // CPOL Low 
hSpi->Init.DataSize = SPI_DATASIZE_8BIT;
hSpi->Init.FirstBit = SPI_FIRSTBIT_MSB;
hSpi->Init.TIMode = SPI_TIMODE_DISABLE;
hSpi->Init.CRCCalculation = SPI_CRCCALCULATION_DISABLE;
hSpi->Init.CRCPolynomial = 7;
hSpi->Init.CRCLength = SPI_CRC_LENGTH_8BIT;
hSpi->Init.NSS = SPI_NSS_SOFT;
hSpi->Init.NSSPMode = SPI_NSS_PULSE_DISABLE;
hSpi->Init.Mode = SPI_MODE_MASTER; 

My GPIOs pins configuration is as following: 

/* Enable peripherals and GPIO Clocks */

CONF_SPI1_PIN_MOSI_GPIO_CLK_ENABLE();
CONF_SPI1_PIN_MISO_GPIO_CLK_ENABLE();
CONF_SPI1_PIN_SCK_GPIO_CLK_ENABLE();
CONF_SPI1_PIN_SSn_GPIO_CLK_ENABLE();

/* Configure peripheral GPIO */
/* SPI SCK GPIO pin configuration */
GPIO_InitStruct.Pin = CONF_SPI1_PIN_SCK;
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
GPIO_InitStruct.Pull = GPIO_PULLDOWN;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
GPIO_InitStruct.Alternate = CONF_SPI1_PIN_SCK_ALTERNATE;
HAL_GPIO_Init(CONF_SPI1_PIN_SCK_GPIO, &GPIO_InitStruct);

/* SPI MISO GPIO pin configuration */
GPIO_InitStruct.Pin = CONF_SPI1_PIN_MISO;
GPIO_InitStruct.Pull = GPIO_PULLDOWN;
GPIO_InitStruct.Alternate = CONF_SPI1_PIN_MISO_ALTERNATE;
HAL_GPIO_Init(CONF_SPI1_PIN_MISO_GPIO, &GPIO_InitStruct);

/* SPI MOSI GPIO pin configuration */
GPIO_InitStruct.Pin = CONF_SPI1_PIN_MOSI;
GPIO_InitStruct.Pull = GPIO_PULLDOWN;
GPIO_InitStruct.Alternate = CONF_SPI1_PIN_MOSI_ALTERNATE;
HAL_GPIO_Init(CONF_SPI1_PIN_MOSI_GPIO, &GPIO_InitStruct);

GPIO_InitStruct.Pin = CONF_SPI1_PIN_SSn;
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
HAL_GPIO_Init(CONF_SPI1_PIN_SSn_GPIO, &GPIO_InitStruct);

HAL_GPIO_WritePin(CONF_SPI1_PIN_SSn_GPIO, CONF_SPI1_PIN_SSn, GPIO_PIN_SET);

 I have to mention that I'm wiring only SPI Pins (SCK, NSS, MISO, MOSI) with the J3 Connector. and I have kept the same jumpers position like mentioned on the ADS1298RECG-FE User's Guide. 

Is my SPI Configuration correct? 

BR. 

ghada. 

  • Hi Ghada,

    I'm sorry to hear that you are having trouble with the ADS1298! Can you please include a screen shot of your SPI communication lines so that we might be able to help determine what is going on in your system? Are you using our EVM with your microcontroller when you have the issue? Do you have any problems when you are using our ADS1298ECGFE-EVM with the MMB0?
  • Hi Tom,

    Thank you for your reply, but i didn't have an oscilloscope now in my office, I will include an SPI screen shot as soon as possible.

    Now, i'm using my EVM with my microcontroller (STM32L4) and it was working fine with the MMB0 (using the desktop application) .

    But I have some other question; Is it correct to ask the device ID just after SPI Initialisation ? Is there a reset/wakeup configuration to do before it ?

    Did you have the driver of the EVM Board ? using the MMB0 microcontroller ?

    Thank you .
    ghada .
  • Hi Tom,

    I finally can read the ADS1298R registers, but only when following theses steps:
    1. Connect the EVM with the MMB0 only with SPI Pins (SCK, NSS, MISO, MOSI) using the J3 Connector.
    2. Run the ADS1298R EVM Evaluation Software (desktop application)
    3. Read (using the desktop application) the Device register (to check if correct)
    4. Remove the SPI Lines from the MMB0 and connect it to my microcontroller (STM32L4).
    5. Run the STM32 program and start reading register (device ID register)
    6. The device ID is successfully read.

    Note that the SPI communication is stable only when using SPI_BAUDRATEPRESCALER_16 (i.e: 5MHz)

    Can you please explain me what the MMB0 do before reading ADS registers?
    what did I miss?

    thank you.
    ghada
  • Hi Ghada,

    There is nothing special about the MMB0 start-up sequence that is not covered in Section 10.1.1 (see Figure 93) and 11.1 (see Figure 105) of the ADS1298 datasheet. Once power supplies have ramped and the ADC CLK signal is established (internal or external), all you should need to do is issue a /RESET pulse to begin using the device.

    Best Regards,