[SOLVED] Nano Every behaving strangely with daisy chained 74HC595

Hi everyone.

I recently set up a simple layout with two 595s that drive two 8-segment LED displays. For reference, it's basically this but with segment LEDs (showing this to reference how the 595s are connected to each other):


Worth noting that I have 10uF capacitor on the PWR/GND rails and 0.1uFs for each IC.

Now, the code and everything works perfectly fine with my Arduino Nano RP2040 Connect. No issues at all and I can't stress this enough.

However, if I replace that with an Arduino Nano Every all hell breaks loose and the displays just contain random assorted leds (both of them do). They however do still refresh to be the same gibberish on every loop.

Now the weird part is that if I disconnect the nano clock connection from the second 595, the first segment display goes back to displaying the proper digits (while the second LED display is naturally empty off)

I know these two Nanos use different microcontrollers and compile the software differently. The digital outs also have different voltages (595 VCC is 3.3V in both cases but the digital out is 3.3V with the 2040 and 5V with the Every) but this is still throwing me for a loop.

Here's how I'm pushing data to the ICs:

  while(number){
    shiftOut(serialData, clock, LSBFIRST, number);
    delay(timedelay);
    number = (number >> 8); 
  }

  digitalWrite(latch, HIGH);
  delay(timedelay);
  digitalWrite(latch, LOW);
  delay(timedelay);

number takes the form of uint16_t right now since I only have two displays but it could be made larger (ex: 0b0101010111001000)

I've also tried changing the timedelay value on the offchance I needed to slow things down. Didn't change anything (tried 10 to 100). I also tried another Nano Every to make sure the one I had wasn't faulty.. same result.

Does shiftOut() behave differently in these microcontrollers? Am I running into some weird noise happening in the system? I tried 10k pull-down resistors on all the actuating IC pins but that hasn't fixed anything.

I'm at a loss, any ideas?

Welcome to the forum. We have a list of suggestions here for answering questions. Well done on finding out how to post code correctly.

The other big thing in How to get the best from this from this Forum is that posting a snippet of code is not much use. So often the code that contains an error is not in the place you think it is.

It also allows us to try your code ourselves.

I would say no. It is more likely to be an output voltage thing. The fact that you have other 3V3 devices driving the circuit correctly is beside the point.

No 3V3 device has sufficient voltage output to drive a 5V powered input, it is just that the some might work because they are supplying enough voltage to "just" make it function. Your Nano Every might very well be within its specified output voltage range but is slightly lower.

That suggests to me that the "fanout" capability of the Nano Every is quite poor, probably caused by the poor output impedance and while it can supply enough signal to drive one load, supplying two loads is tipping it over the edge.
I would suggest you buffer the output with two of the inverting buffers of a 74HCT14 in seriese to boost you signal.

First off,

Thank you for all the great advice on posting here I will take note and make sure I follow the guidelines.

That suggests to me that the "fanout" capability of the Nano Every is quite poor, probably caused by the poor output impedance and while it can supply enough signal to drive one load, supplying two loads is tipping it over the edge.
I would suggest you buffer the output with two of the inverting buffers of a 74HCT14 in series to boost your signal.

This comment was spot on and getting the clock pin to go through the Hex Schmitt−Trigger Inverter was the solution (series).

Thank you a thousand times for this.

1 Like

I'm looking at this with some interest because I am currently assessing a design for a Nano Every driving four HT1632 display drivers.

I have some difficulty understanding how a Nano Every appears to be incapable of driving two 74HC595 clock inputs from a single pin.

The Nano Every is a 5 volt device and has a ATMEGA4809 chip which should be able to provide between 15mA and max 40mA per pin (depending on which data sheet you read).
The 74HCT14 Hex inverter, which was apparently successful, can supply only 4mA per pin.
Inputs to the 74HC595 are in the area of a few microamps.

The code for shiftOut (Nano Every) is here: ArduinoCore-megaavr/wiring_shift.c at master · arduino/ArduinoCore-megaavr · GitHub and is slow enough with out any additional delay() statements because it heavily uses digitalWrite().

I feel that there must be another explanation for this reported phenomenon.

2 Likes

Is there a specific reason that you are running the shift register at 3.3V? Is that being supplied by the Nano Every board? The 3.3V has very limited current capability.

The schematic in post #1 seems to imply 5v

But this sugests 3.3v

Anyway, if various logic levels are mixed then strange things can happen so it is not possible to draw any other firm conclusions from this observation.

Yes, I've been using the 3V3 pin to power ICs and didn't realize that the digital out pins were providing 5V until later.

I actually just tried removing the 74HC14 and powering everything from the 5V pin. This time everything works as expected. So this seems to be correct:

if various logic levels are mixed then strange things can happen

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.