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

[nRF51422] SPI Slave solution

Hello,

I'm using an external chip that decodes my RF transmission and outputs the data on two pins DAT, and CLK (data and clock). Currently I'm reading the data with GPIOTE, and was thinking about using SPI to collect the output.

SPI Slave uses CS pin to control the data gathering, so is there any method to "emulate" the chip select pin without need of physical pin connected ? I'm trying to lower the current consumption as much as possible and just need to catch several milliseconds of transmission.

Parents
  • Thanks for answer, now I'm using two shorted pins and it works.

    But there is my next question. I'm using spi_slave example from Keil, and trying to read ~10 bits. The issue is that the SPI amountrx reg always shows 1, so the remaining 2 got lost? Is there any way to capture all the transmission? My buffers are uint8_t arrays.

    The chip select pin is toggled about 1ms after the end of transmission.

    image description

  • The SPI is 8 bits only unfortunately. In other words you have to find some way to clock in the last 6 bits (so you get at least 16 bits in total), otherwise the data won't be written into the RX buffer. Theoretically you could do this from the nRF51 as well, and use another additional pin to feed clocks into the SPI, but you would have to find some way to switch between feeding the clock from the SPI master or the nRF51. If you can add 6 additional clock pulses on the master side that should be easier to implement.

Reply
  • The SPI is 8 bits only unfortunately. In other words you have to find some way to clock in the last 6 bits (so you get at least 16 bits in total), otherwise the data won't be written into the RX buffer. Theoretically you could do this from the nRF51 as well, and use another additional pin to feed clocks into the SPI, but you would have to find some way to switch between feeding the clock from the SPI master or the nRF51. If you can add 6 additional clock pulses on the master side that should be easier to implement.

Children
No Data
Related