Attempting (and failing) to use a 74HC595 Shift Register #2146
Replies: 8 comments
-
Posted at 2017-04-21 by dklinkman You might consider posting your entire program. But I'm thinking, s.write sends characters, not bits. Is that your intent? You might be shifting a lot of binary zeros before the transfer to the output. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2017-04-21 by Drarok Oh! Well, that's interesting. I've switched to using I can't believe it was such a simple mess up on my part. Thanks! |
Beta Was this translation helpful? Give feedback.
-
Posted at 2017-04-21 by Drarok And now it's not working at all again, and I've no idea why! 😭 Edit: I think that failure was a dry joint or bad wire. Ugh! |
Beta Was this translation helpful? Give feedback.
-
Posted at 2017-04-22 by dklinkman Glad I could help. I have a few decades of experience in discrete logic. When I saw 74HC... I was intrigued. Sounds like you are a lot closer to your goal. Good luck!! |
Beta Was this translation helpful? Give feedback.
-
Posted at 2017-04-22 by dklinkman
You might share your circuit schematic. How are your LEDs biased? |
Beta Was this translation helpful? Give feedback.
-
Posted at 2017-04-22 by Drarok I don't know what 'bias' means in this context. I'm a developer, so confident of my code, but an electronics noob. Pretty sure it's working sensibly now, but either my breadboard has a bad connection with a wire, or I've soldered a wire badly. I wouldn't know how to share a schematic either, other than to take a picture of what I've got! Thanks for your help though. 👍🏼 |
Beta Was this translation helpful? Give feedback.
-
Posted at 2017-04-24 by @gfwilliams Are you powering the shift register and LEDs from the watch battery? Sounds possible if two LEDs on are dim? It might be that your battery is running down! 74 series logic probably won't work that well at lower voltages. While the watch battery is generally enough for Puck.js, as soon as you start powering external things (or executing code really frequently) you can run it down in no time at all! To get around it, you should be able to power your shift register and LEDs from an external source of power, and connect only ground, data, latch and clock - so leaving Puck.js working off its own battery (so you don't have to worry about keeping the voltage it is powered from within range). |
Beta Was this translation helpful? Give feedback.
-
Posted at 2017-04-24 by Drarok I've got a 3.3v power supply unit which I was using, but later also tried it just off the battery. I've no idea what was causing the dimness – that's since gone away. Bad wiring or dodgy configuration is entirely likely! |
Beta Was this translation helpful? Give feedback.
-
Posted at 2017-04-21 by Drarok
I've been trying to light a few LEDs using the above shift register without success. I'm having to translate from Arduino guides to Espruino/Puck.js, so undoubtedly I've got something wrong.
I've tried using
SPI1.setup()
as well aslet s = new SPI(); s.setup();
, but neither work.The options I'm passing to setup are:
And I've tried using
s.write([0, 1, 0, 0, 0, 0, 0, 0], PINS.LATCH)
as well as manually setting the latch low/high around the write.Wiring is as follows (the comment is the pin number on the shift register itself):
And finally, I've supplied power and ground where required (I think!), at pin 1 for ground, and pins 10 (SRCLR) and 16 (VCC) are high.
Absolutely any help at all will be massively appreciated. Thanks!
Beta Was this translation helpful? Give feedback.
All reactions