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

Parents
  • I've used the older version of the 25625, I had no extra pullups or anything like that. All the pins ran straight to my micro.

    That said... A LOT of SPI devices don't have proper tri-state on the MISO line. It's frustrating.

    Remember that many SPI devices won't reply to a command until the NEXT attempt to read/write to it. I can't remember anything about the MCP part's SPI protcol, but you may need to release chip select and re-engage before you'll get meaningful data.

    Another way to eliminate the possibility of the nRF52's setup being wrong... Turn the GPIO to input/float and not SPI function and re-scope. You want to make sure you aren't stuck in an open drain mode or something like that. Also and likewise, if possible maybe you can physically unhook the MISO line and scope with it not connected to the nRF52.

    Of course this is all assuming the MCP is "on". Something I'd recommend for debugging like this is to bit bang out that first SPI message. Take the nRF52's peripheral and setup out of the equation.

    Good luck - SPI MISO errors aren't fun.

    Test:

    1. Put a pullup on the MISO line.
    2. Send a command, release SS, send a read command
    3. Isolate the nRF52 out of the system by bit banging a test command or disconnecting the trace
  • 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.

Reply
  • 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.

Children
No Data
Related