cancel
Showing results for 
Search instead for 
Did you mean: 

Need for series resistors for OCTOSPI on NucleoU5A5

tzijnge
Associate II

Hi everyone,

I am working with a NucleoU5A5 and a W25Q16 flash chip in quad SPI mode (using the OctoSPI peripheral). For a couple of days I couldn't get it to work reliably: reading multiple bytes would fail on certain byte values coming from the flash chip. Specifically it would fail if three or four data lines were pulled high, but not if fewer than three data lines were pulled high. E.g. reading the value 0x03 would work fine (2 data bits high), but 0x07 would fail (3 data bits high).  Failure in this case means that the flash chip just stops responding at all. It's not like the signal gets distorted in any way (I looked at the analog signal with a scope). As I am still in an exploratory phase, the flash chip is connected to CN10 of the Nucleo board with 100mm wires. I noticed exactly the same behavior with clock frequencies from 100 kHz to 16 MHz.

I found this post but don't believe that my issue is one with reflections and transmission line impedance. It get the feeling that the input impedance of the MCU is just really low (but I'm expecting very high input impedance) when reading data, resulting in excessive current draw from the flash chip when it has to pull three or four bits high, causing a chip reset. If I had an issue with reflections, I would expect distorted waveforms, getting worse at higher frequencies. I would expect the same behavior regardless of the value I'm reading and I would not expect the flash chip to stop sending data entirely.

Anyway, I added a 100 Ohm series resistor in each of the data lines between the MCU and the flash chip and everything suddenly worked like a charm. I have tested it successfully up to a clock frequency of 16 MHz.

My question is: can anyone confirm or refute my reasoning? If the MCU input impedance is indeed very low, is this a bug in the chip? If my issue is not related to reflections/ringing/EMI, etc, what value should I use for the resistors?

1 ACCEPTED SOLUTION

Accepted Solutions

I don't have the scope traces, but I didn't see anything suspicious in the shape of the signals at 16 MHz.

Anyway, I have now put the W25Q16 on a piece of breadboard with male headers to plug it into CN10 of the Nucleo directly. Works without any issue, with and without series resistors in the data lines, so the problem must have been with the long wires. I still don't understand how the long wires cause the behavior that I reported, but I'm not going to investigate it any further.

View solution in original post

7 REPLIES 7

Have you got oscilloscope traces of the signals on the wires?

 


@tzijnge wrote:

the flash chip is connected to CN10 of the Nucleo board with 100mm wires. 


Doesn't sound great - please post some good, clear photos...

I don't have the scope traces, but I didn't see anything suspicious in the shape of the signals at 16 MHz.

Anyway, I have now put the W25Q16 on a piece of breadboard with male headers to plug it into CN10 of the Nucleo directly. Works without any issue, with and without series resistors in the data lines, so the problem must have been with the long wires. I still don't understand how the long wires cause the behavior that I reported, but I'm not going to investigate it any further.

Uwe Bonnes
Principal III

Are all decoupling capacitors placed as close as possible to the chips power pins?


@tzijnge wrote:

but I'm not going to investigate it any further.


Fair enough.

Time to mark the solution, then?

This is actually a good suggestion and I have put a 100nF cap on the flash chip's power lines. I went back to a setup with jumper wires, but couldn't reproduce the behavior I had last week, even without the decoupling cap. I have probably used different wires this time and got unlucky last week.

A colleague of mine also suggested adding a decoupling cap, but the idea got snowed under because I had found a solution with the series resistors in the data lines. I looked at the supply voltage with a scope but didn't see anything suspicious at the time of failure. The level was just stable. But thinking about it now, the behavior that I noticed could be explained by a lack of decoupling capacitor: if somehow the power cables are not able to provide the required current as fast as needed, it could lead to a dip in the voltage causing a reset of the flash chip.

As suggested by @Uwe Bonnes, adding a decoupling capacitor is probably also a good idea. It may work sometimes without it, but may be necessary in other cases. Anyway it's a small effort to add it and rule out one possible source of errors.


@tzijnge wrote:

It's not like the signal gets distorted in any way (I looked at the analog signal with a scope).


A scope probe will distort the signal by adding capacitive load. And the bandwidth limitation of the scope will affect the reading.

Kudo posts if you have the same problem and kudo replies if the solution works.
Click "Accept as Solution" if a reply solved your problem. If no solution was posted please answer with your own.