Page 1 of 1

Controlling many outputs with 74HC595

Posted: Tue May 11, 2021 8:26 pm
by sptcarl
HI guys, It has been a while since I have started anything new with Flowcode, so I am a but rusty!

I need to control a large quantity of LED lamps individually. Yes I know I could use addressable ones, but it is not practical, and yes I could use a matrix, but again not practical (both mainly because of voltage restrictions)

I am ok with the physical side of this, but I am at a loss of where to go with the program. Basically I have an array Lamp[0] to Lamp[xx] which I will set at various point to have a value of 1 or 0 - on or off. Some outputs may be grouped into 3 for RGB control.

Has anyone done anything similar or has any pointers? Am I missing something obvious?
I notice there was a 7 segment display component made for 74595, would it be possible to do something similar here?

thanks for any help,
Carl.

Re: Controlling many outputs with 74HC595

Posted: Thu May 13, 2021 5:48 pm
by Benj
Hi Carl

I use shift registers for my led cube project so these certainly are workable.
https://www.instructables.com/Infinite-RGB-LED-Cube/

How often do you need the leds to refresh and do you need them to be dimmable?

Another more modular option might be output expanders.

Charlieplexing might also be an option for you to add more leds to less outputs depending if you only need one led to be active at a time.

Re: Controlling many outputs with 74HC595

Posted: Fri May 14, 2021 9:41 pm
by sptcarl
Hi Ben,
Thanks for the reply.

I actually started to copy your 3d cube a few years back, but unfortunately I never completed it due to lack of free time and patience with the LED soldering! :lol:

There can be any number of LEDs on at once, some will be flashing so refreshing probably no more frequently that 5Hz, dimming would have been nice, but not required.

I have never looked at output expanders, are they easy to control in flowcode?

I do like the idea of Charliplexing, (I'd never heard of it until a couple of weeks ago!) I'll have to experiment with that, but it wouldn't be practical with this project.
The main reason I was thinking of using the 595 is that I have a circuit board already designed around them from another project which would do what I need.
I can get my head around working with 8 bits with one shift register, but chaining 4 or 5 and controlling those, and I get a mental block!

Thanks.

Re: Controlling many outputs with 74HC595

Posted: Sat May 15, 2021 5:25 pm
by Bachman
Chaining is easy. If you can controll one 74595, you can controll lots of them. First, you have to decide, how many 595 meets you specification. One 595, one byte of data. Eg, you have three 595. First sent out byte goes to the last (3rd) 595, second goes to the middle (2nd) and the last sent out data goes into the first 595. That's it.

You can tast it on a breadboard with some LED's. Don't forget the resistor, between the LED and 74595. You can get ideas from here: https://www.arduino.cc/en/Tutorial/Foundations/ShiftOut. SPI can be use to drive the 595 chain. SDO, CLOCK and one MCU output for Latch.

Re: Controlling many outputs with 74HC595

Posted: Sun Jun 20, 2021 1:06 pm
by kaqkk007
Hi guys. In version 8 I am trying to bring the relationship between 74595 and pic to life, unfortunately to no avail, could anyone show me an example file?

Re: Controlling many outputs with 74HC595

Posted: Sun Jun 27, 2021 9:30 pm
by chipfryer27
Hi

I used one of those chips a while back, but too long ago to be fresh in my mind. I'll see if I can find my code and post an example, but it won't be any time soon unfortunately.

As far as I can remember it's a serial to parallel shift register with an 8-bit latch bolted on at the end <s>

You will need to assign pins on your PIC to/as:

Serial Output = The data you want to send bit by bit to the 74595
Serial Clock = Clock out for above
Serial Clear = Clears the above

There is also a clock for the 8-bit latch and an Output Enable.

So you will need to assign five pins on your chip, or hold pins high/low on 74595 as necessary.

Operation is I think as below (but I can't remember offhand).

Place first bit to be sent on Serial Output
"Clock" serial clock
Place second bit to be sent on Serial Output
"Clock" serial clock
repeat until all 8-bits are sent (this would form part of a loop)

Clock 8-bit Latch (sets the outputs)
Enable Output (as you would expect)

Again, I'm not 100% sure on the above as it was a while back. I'm sure someone more knowledgeable than I will jump in to correct though.

I hope this is of some help.
Regards

Re: Controlling many outputs with 74HC595

Posted: Fri Jul 02, 2021 8:53 pm
by kaqkk007
Hi I managed to solve it with bitbang method, I send 6 * 8 bits to 6 595 registers, I converted an example from a friend enough Thank you for your help!

Re: Controlling many outputs with 74HC595

Posted: Sat Jul 03, 2021 5:45 am
by kaqkk007
Hi ! Example for uploading 1 to 595 registers