This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

SPI in nrf51 dk

hello there ,I am writing spi code for slave which has 19 bytes of data. my nrf51 is master.

now my slave has clock polarity =1, clock phase =1. i am uploading project here. but my nrf51 is getting 0x00. can anyone tell me what is my mistake??uart - Copy.rar

Parents
  • You should use the SPI driver from the SDK(nrf_drv_spi.c) directly instead of using the ADXL375 driver which is on top of the SDK SPI driver.

    Well, it send something, but the ADXL driver(which I made) is meant to be used to communicate with the ADXL375 where the byte sequence sent over SPI must follow a specific format, e.g. [Register address + R/W bit | DATA ...... ]. When youre communicating between two microcontrollers you do not need to specific any register addresses, the MCUs will just put the received data in a buffer and then its up to the user to interpret it.

Reply
  • You should use the SPI driver from the SDK(nrf_drv_spi.c) directly instead of using the ADXL375 driver which is on top of the SDK SPI driver.

    Well, it send something, but the ADXL driver(which I made) is meant to be used to communicate with the ADXL375 where the byte sequence sent over SPI must follow a specific format, e.g. [Register address + R/W bit | DATA ...... ]. When youre communicating between two microcontrollers you do not need to specific any register addresses, the MCUs will just put the received data in a buffer and then its up to the user to interpret it.

Children
No Data
Related