Pages: [1]   Go Down
Author Topic: Can I share the clock wire for some Shift register  (Read 1588 times)
0 Members and 1 Guest are viewing this topic.
France - Rambouillet
Offline Offline
Newbie
*
Karma: 0
Posts: 5
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

France - Rambouillet
Offline Offline
Newbie
*
Karma: 0
Posts: 5
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

http://twitpic.com/1tlybb/full
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 639
Posts: 34726
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

France - Rambouillet
Offline Offline
Newbie
*
Karma: 0
Posts: 5
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

France - Rambouillet
Offline Offline
Newbie
*
Karma: 0
Posts: 5
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

When I common the clock wires, that's work fine, but I cannot common the Data wires  smiley-sad
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 639
Posts: 34726
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

France - Rambouillet
Offline Offline
Newbie
*
Karma: 0
Posts: 5
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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  smiley

Thanks for your help.
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 639
Posts: 34726
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Offline Offline
God Member
*****
Karma: 1
Posts: 733
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 639
Posts: 34726
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Greenwood, Indiana
Offline Offline
God Member
*****
Karma: 0
Posts: 508
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Can you post your code? It sounds interesting. smiley
Logged

If it was designed by man it can be repaired by man.

Pages: [1]   Go Up
Jump to: