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

nrf52 SPIM no MISO response

Hi,

Im trying to connect MCP25625 via SPI on nrf52. I checked with the scope that CS, MOSI and SCK are correct, but I get no reply on MISO line whatsoever. I perform a very easy operation:

  1. Reset - send 1 byte data
  2. Read register - send 3 bytes.

Any ideas what to check? i have 2 custom boards and they both have the same issue.

image description OSC2 waveform

image description 3-byte command bitbanging SCK and MOSI lines

  • Great. If you bit banged and have errors, it shouldn't be an issue with nRF52. Try next:

    1. If I had a bitbanging setup, I'd double check that against my nRF52 SPI code on the scope.

    2. The 25625 requires 3V and 5V right? I'm assuming you have both hooked up. There is a strong possibility that the error is in the 25625 right now, so double check everything.

    3. Datasheet says SPI mode 0-0 or 1-1 but they show examples sampled on rising edge. Make sure you understand 0-0 and 1-1 modes, and that you're sending MSB FIRST! So, reset should be 00000011 on the scope.

    4. Stick with the bitbanging. Get it working before you move on to hardware SPI.

    5. Don't underestimate the input vs expected output! If you set register, make sure you can read that back. You may receive all zeros only to think it's broken - only to find out that's supposed to happen. You may need to re-engage CS sometimes.

  • I figured it out with your help:) So here is what happened:

    1. On one side the RESET pin of the device had to be connected to VCC if unused, so that was totally unrelated to nrf52 2) On the other side NRF52 cant send 1byte commands via SPI, and RESET command was a 1-byte command. I ended up bitbanging RESET command and using SPIM for the rest of longer commands. Thanks for the help!
  • Instead of bitbanging 1-byte command, you can use workaround described in PAN 58 :)

  • I'm glad you figured it out, and that workaround Wojtek posted is really easy to follow, so I'd recommend rolling that in.

Related