Need help optimizing 74hc595 updates
Hi i need a way to make my 595 update faster currently it takes about 750 to 850 ms for 8bytes (8bits per iteration) to transfer using shiftout
neeh help with
to either make shiftout faster
or update 595 over spi
23 Replies
board: pro micro with atmega32u4
might be a code issue, Googling indicates much slower Uno)
shiftOut
takes about 150 us (on a i am assuming u talking about per byte
i am doing this 8 times per loop so it gets little high like 8 times that
8 x 150 us is still only about a millisecond
well i still require it being faster the delay of that adds up with other things making it like 3 miliseconds which is lot!
and shift out adds the most of it to whole runtime
800 seemed long, 3 ms I can picture 🙂
so.... any idea how to make it faster?
apparently folks have gained some speed driving the 595 with SPI, I haven't ever done it myself
that seemed to be the most obvious answer but it's not working 595 output pins act kinda when i do spi
and i am not sure if am doing it right
or some bug? cause work fine with shiftout
this is what i did
How did you connect each pin?

something like this? https://wokwi.com/projects/441920157134367745
VCC to vcc
SER to arduino 16 as data
OE to ground
RCLK to 14 as latch
SRCLK to 15 as clock
SRCLR to VCC

And what about pins like master reset
isn't that SRCLR?
oh right that's your serial clear.
GND to GNd technically.
it is the same wait going to try the same code again
yeah, i just changed the latch pin
i think... it got updated once
or twice not sure...
it's on 0b01010101
in other words your real life circuit isn't like the sim?
yea can say that too
also installed the spark fun promicro board defination just to make sure it wasn't the cause of issue
how about not using 14 for latch (it's MISO)
it has pinMode(latchPin, OUTPUT); think that disables 14 as miso?
but yea will try that
wow that fixed it!
so turns out... this not true
thanks for all the help!
so i might have lost my last digital io pin but spi works!
didn't have any plans of using that as for now so.. guess its fine?
so it was using MISO as latch that was slowing it down?