Go Down

Topic: Can I share the clock wire for some Shift register (Read 1 time) previous topic - next topic

Eddy78

Hi,

I searched information on this forum without success for my project.
Perhaps that somebody who have some knowledge in electroni can help me. Thanks in advance.

My problem is simple.
- I have a Shit Register 74HC595 to manage a LCD screen (I use the LCD3Wires library)
- I have a Shift Register 74HC595 to manage some LEDs
- I have a Shift Register 74HC165 to manage some buttons

For each Shift Register, I use 3 wires (Clock, Latch and Data), so a total of 9 wires  :'(

I think that it's possible to optimize that and use less wires but I don"t want to use the I2C port.

I thought that I can use the same wire for the 3 Shift registers. If it's possible, it will be a good deal for me because with 7 wires, I could manage my LCD, 8 Leds and 8 Buttons.

Do you thing that's possible?

Here is a schematic of my dream:  h t t p : // twitpic.com/1tlybb/full

Perhaps,a better solution exist?
Thanks in advance.


Grumpy_Mike

Yes you can chain the shift registers (data out of one to data in of next) and use just 3 connections.

Alternatively if you do want them to be independent you can common the clock and data and simply have independent latches.

Eddy78

I don't want to chain them because I don't want to change the 3Wires LCD library. I just want to use them independently.

So, as you said, I will common the clock and the data wire and use independent latches.

Thanks you very much. I win 2 others wires.

Eddy78

When I common the clock wires, that's work fine, but I cannot common the Data wires  :(

Grumpy_Mike

Quote
but I cannot common the Data wires


I don't understand why what happens?
Data will be shifted into the register but not latched out until you hit the latch line.

Eddy78

I found the reason... It's my fault...

In fact for the 74HC165, the pinMode for the DATA pin is INPUT, and for the two other 74HC595, the pinMode for the DATA pin is OUTPUT.

In my software, I initialized the pinMode in the constructors of the classes and I never changed them after...

I tried to common the Data pin for the two 74HC595, and that's work fine.
If I want to common the Data pin withe the 74HC165, I need to change the pinMode for the DATA pin, each time...

So, I will use for my 3 Shift Registers 6 wires: it's not so bad  :)

Thanks for your help.

Grumpy_Mike

OK but I am old fashioned and wouldn't bother about using classes it is just so simple to drive them directly with code than mess about with drivers.

Jeremy1998

I don't know anything about this, but here's my thinking...

When you use tlc5940's, you can use the same pins and just have to add one more for a signal... You should be able to do what Grumpy_Mike mentioned; use the same data and clock pin, and use 3 latch connections... A total of 5 pins...

Grumpy_Mike

I was talking about a shift register.
the TLC5940 requires a lot more feeding than a simple shift register.

mrmeval

Can you post your code? It sounds interesting. :)
If it was designed by man it can be repaired by man.

Go Up