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

SPI MISO seems to be pulled down in NCS

Hello. I migrated my code from nRF5 SDK for Thread and Zigbee to nRF Connect SDK (NCS). After that SPI code stopped working :( After debugging with the oscilloscope, I found that SS and MOSI signals are correct, the ADCxx1Sxx1 chip is sending the correct values to MISO line, but MISO pin on the nRF52840 side is reading all zeroes (ADC chip is separated from nRF by a digital isolator ISO772x). When I connect VCC to MISO with a wire however, the software can read all ones instead of zeroes (so SPI is working). 

I guess, this is an issue of internal pull-down resistor on SPI? In the devicetree documentation of Zephyr 2.5.0 I found the "miso-pull-up" and "miso-pull-down" options. The latter doesn't change anything for me, while the former changes the values read from SPI to all ones, unless the MISO pin is shorted to GND.

Is there a fix for this? Can I disable pulldown? Is there a "no pull" option for MISO in NCS?

For MISO, I am using pin P0.09. (CONFIG_NFCT_PINS_AS_GPIOS=y is set in prj.conf.)

P.S. Versions:

  • NCS Toolchain: 1.5.1
  • Zephyr: 2.4.99
  • west: 0.9.0
  • dtc: 1.4.7
Parents Reply
  • For no pull, remove the "miso-pull-*" in your DT overlay, and recompile.

    Tried that. Originally, there were no "miso-pull" options in my DTS file.

    its important that you verify this by reading the register:

    I am getting:

    $ nrfjprog --memrd 0x1000120c -f nrf52
    0x1000120C: FFFFFFFE

    – looks correct. 

    Have you tried reducing the frequency of the SPIM to see if this has an impact on the read data?

    Yes, SPI clock speed is at the minimum (125 kHz).

    are you using the nRF52840-DK for testing?

    No, we are using our custom board with MS88SF2 v1.0 module.

    Does this issue happen on more than one board?

    Unfortunately, we have only one custom dev board of this kind for now. Because it works fine with different firmware (the one compiled with nRF5 SDK for Thread and Zigbee) we didn't think that the board could have an issue. But we will look into that too.

Children
No Data
Related