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.

ADS1298R SPI doesn t work

Other Parts Discussed in Thread: ADS1298, ADS1298R

Hi,

I think I have the same issue of SPI communication as other people.

I disconnect the MMB0 board from the ads1298. Instead  i connect the ADS1298 with the discovery board STM32F407

I set all jumpers of the board ADS1298 as the default configuration descibes in (board ADS1298R rev.B).

I set  NPWDN=1, NRESET=1, SELCLK=0, START=1.

I send a RESET command -->delay 1,5sec-->SDATAC-->delay 1ms-->RREG function

This is just the last command sent (RREG function)

GREEN: Chip Select

PURPLE: CLK

BLUE: MOSI

YELLOW: MISO

As you can see, there is not the ID of the register 0x00, that I want to read.

Here my SPI config:


SPI_InitStructure.SPI_CPOL = SPI_CPOL_Low; /* Clock polarity*/
SPI_InitStructure.SPI_CPHA = SPI_CPHA_2Edge;/* */
SPI_InitStructure.SPI_NSS = SPI_NSS_Soft;
SPI_InitStructure.SPI_BaudRatePrescaler = SPI_SPEED;  //1MHz
SPI_InitStructure.SPI_FirstBit = SPI_FirstBit_MSB;
SPI_InitStructure.SPI_CRCPolynomial = 7;

Best regards,

Enrico

  • Hey Enrico,

    Looking at the scope image, it looks like you're sending 0x100000 to the device. If you want to read the ID register you'd want to send 0x200000. I'm not sure if you made a mistake with what you placed in the SPI output shift register or if there is something wrong with your polarity/phase settings. I cannot make out what is meant by your SPI settings, but ensure that CPOL = 0 and CPHA = 1.

    Regards,
    Brian Pisani
  • Hey Brian,

    Thank you for the help.

    So, my Opcode command is correct, but sometimes some acquisitions are like that. The pulse is 0x10 instead of 0x20.

    CPOL and CPHA are correct.

    So, I tried to reduce the SPI SPEED to 500KHz and I increased the delay before and after the RESET command.

    Now It works or at least the most of times It works. I still have some errors but I don t know why.

    Regards,

    Enrico

  • Hey Enrico,

    You might want to study the bit delay you are seeing in the SPI protocol. I'm not sure what could be causing that but it sounds like a microcontroller issue.

    Brian
  • Hi Brian,

    I still have some problems about registers reading.
    I write a register and when I read it sometimes I get an incorrect result.

    So, I send:

    WReg function

    Delay (750 ms)

    SDATAC

    Delay (1 ms)

    RReg function

    Is it correct? Is it supposed to send every time the SDATAC command? Are delays enough?

    I think that my write function is correct, so the problem should be about the reading part.
    Maybe the SDATAC, maybe delays.

    Thank you in advance.

    Enrico
  • Hey Enrico,

    Those delays are more then enough and the protocol is good. The delay I was referring to in my last post was the delay associated with that one bit in the RREG opcode. I think that may be the root cause of your issues.

    Brian Pisani