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

nRF52832 SPI Master read results in "zeros"

Update 1/27/2016

  Just reviewing again the pins + schematic; I am using the following pins:

         SCK     P0.07
         CS       P0.08
         MOSI   P0.06

         MISO    P0.05/AIN3


  Looing at the MISO pin, it seems this is the only one that is "different" than the other 3 pins

  Is there something else that I need to do in order to use MISO pin on P0.05/AIN3; maybe because the pin can also be used as Analog Input ?


  Thanks.

Lee

Hi,

I am interfacing nRF52832 to an ADC chip; very simple SPI interface.

I am re-using the SPI examples from SDK 12.2.0; and the SPI runs without any problem.

I can see the correct signals being generated on the SPI pins(CS, SCK, MOSI and MISO); in regards to MISO pins, I can see the ADC is sending the right bits(using a scope).

The SPI protocol requires: 1x TX byte and will receive 3 bytes of RX data.

On the scope, I can see a total of 32 SCK bits and the correct MISO data.

BUT in the output of the SPI interface APIs, the data read is all "zeros"; so 3 bytes of "0" values.

I have been double checking the codes and can't find any obvious error.

Any suggestion ?

I am attaching the scopes of the 2 pins: SCK and MISO.

Thanks for the help.

scope_3.png

Lee

Parents
  • Thank you Sigurd !. After spending some time enabling debugging and looking at the drivers, still can't find anything wrong. Then looking again at the scopes data; suddenly it all makes sense. We made a last minute change to power the nRF52 with 3.3V; what I don't realize is that the ADC is still powered by 1.8V; so the respond from the ADC is 1.8V digital logic, which is just below the needed threshold for logic states for nRF52(with 3.3V VDD). For the time being, I lowered the VDD to 2.5V and ALL is well. Thank again for all the response and help. It is not a wasted effort for me; as I am now more familiar with the Nordic SPI drivers and the approach in creating the drivers etc... Thanks, Lee

Reply Children
No Data
Related