Controlling many outputs with 74HC595

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 7.

Moderator: Benj

Post Reply
sptcarl
Flowcode V4 User
Posts: 36
Joined: Thu Feb 18, 2010 10:53 am
Has thanked: 3 times
Contact:

Controlling many outputs with 74HC595

Post 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.

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Controlling many outputs with 74HC595

Post 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.

sptcarl
Flowcode V4 User
Posts: 36
Joined: Thu Feb 18, 2010 10:53 am
Has thanked: 3 times
Contact:

Re: Controlling many outputs with 74HC595

Post 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.

User avatar
Bachman
Posts: 116
Joined: Sun Sep 07, 2014 11:37 am
Location: Hungary
Has thanked: 9 times
Been thanked: 53 times
Contact:

Re: Controlling many outputs with 74HC595

Post 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.

kaqkk007
Posts: 9
Joined: Tue Feb 20, 2018 3:00 pm
Has thanked: 1 time
Been thanked: 3 times
Contact:

Re: Controlling many outputs with 74HC595

Post 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?

chipfryer27
Valued Contributor
Valued Contributor
Posts: 617
Joined: Fri Jun 06, 2014 3:53 pm
Has thanked: 184 times
Been thanked: 195 times
Contact:

Re: Controlling many outputs with 74HC595

Post 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

kaqkk007
Posts: 9
Joined: Tue Feb 20, 2018 3:00 pm
Has thanked: 1 time
Been thanked: 3 times
Contact:

Re: Controlling many outputs with 74HC595

Post 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!

kaqkk007
Posts: 9
Joined: Tue Feb 20, 2018 3:00 pm
Has thanked: 1 time
Been thanked: 3 times
Contact:

Re: Controlling many outputs with 74HC595

Post by kaqkk007 »

Hi ! Example for uploading 1 to 595 registers
Attachments
BITBANG74595.fcfx
(10.44 KiB) Downloaded 215 times

Post Reply