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

nRF51822 SPI Module RX

Hello,

I've been working on the SPI module for the nRF51822. I used the sample spi .c file as a starting point, but I got rid of the timeout (not sure why there is a timeout in a SPI module). I'm sending out the data just fine, and I'm waiting for the EVENTS_READY to be non-zero before reading from the RXD register, but when I read from the RXD register, I just get 0xFF. For test purposes, I'm connecting the MOSI to the MISO. I've used a logic analyzer to verify that the data is being sent out and picked up by the MISO pin. However, I still only see 0xFF. I've tried various pins as well. Does anyone have any suggestions? I'm using the PCA10001 development board.

Thanks.

Parents
  • Hi Charles,

    Have you tried spi_master_example in folder nRF6310 ? It was made for the Dev Kit, You would need to modify the source code a little bit for the PCA10001. Mainly the LEDs configuration.

    Note that on the PCA10001 P0.08->P0.11 are used for UART and P0.26 and P0.27 are connected to 32kHz crystal. If you want to use these pins, you would need to cut the solder bridges.

    If SPI1 and SPI0 working properly and be looped back properly (connected MOSI and MISO), ERROR_PIN_SPI0 and ERROR_PIN_SPI1 should be low (both LEDs are off).

    Please upload your source code if you still experience the issue.

  • @Charles: If you don't read the byte out, you will be able to send maximum 2 bytes since the SPI RX buffer is only 2 bytes. The figure in the Reference Manual showed that the first byte was clocked out before the third one came.

Reply Children
No Data
Related