Pages: [1] 2   Go Down
Author Topic: Mutiplexing or Shift Registers?  (Read 1073 times)
0 Members and 1 Guest are viewing this topic.
Somewhere in Arizona
Offline Offline
God Member
*****
Karma: 0
Posts: 725
Arduino must be a drug, because I'm addicted!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I am making a binary clock, and I dont know which one to do. Which one is easier to code?
« Last Edit: July 01, 2010, 06:53:00 pm by Jeremy1998 » Logged

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 238
Posts: 24298
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

24 hours per day (5 bits) , 60 minutes per hour (6 bits), 60 seconds per minute (6 bits).
Total 17 bits.

Just use I/O pins.
« Last Edit: July 01, 2010, 04:52:08 pm by AWOL » Logged

"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

Somewhere in Arizona
Offline Offline
God Member
*****
Karma: 0
Posts: 725
Arduino must be a drug, because I'm addicted!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

??? It's going to have 21 leds. I am doing:

AM / PM Lights  (2)
Hour Lights       (5)
Minute Lights    (7)
Second Lights   (7)
--------------------------
Total                (21)
« Last Edit: July 01, 2010, 04:34:16 pm by Jeremy1998 » Logged

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 238
Posts: 24298
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

60 seconds (or minutes) requires only 6 bits. 26 = 64

It's going to have 18 leds.
AM / PM Lights  2
Hour Lights       4
Minute Lights    6
Second Lights   6
--------------------------
Total                18

Or be un-American and use the 24-hour clock and save a pin/LED.   ;D
« Last Edit: July 01, 2010, 04:52:22 pm by AWOL » Logged

"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

Somewhere in Arizona
Offline Offline
God Member
*****
Karma: 0
Posts: 725
Arduino must be a drug, because I'm addicted!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I don't understand... It takes 7 leds to show 59 seconds. The ones has to go to 9. The tens has to go 5.
Logged

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 238
Posts: 24298
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
I don't understand... It takes 7 leds to show 59 seconds. The ones has to go to 9. The tens has to go 5.

There are 10 types of people in the world - those who understand binary, and those who don't.

You're talking about BCD (binary-coded decimal), not binary.
« Last Edit: July 01, 2010, 04:52:33 pm by AWOL » Logged

"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

Somewhere in Arizona
Offline Offline
God Member
*****
Karma: 0
Posts: 725
Arduino must be a drug, because I'm addicted!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Well, I ment a binary time clock, sorry. I am a total noob who JUST turned 12... I dont know it all yet...

That said, what control method should I use?
Logged

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 238
Posts: 24298
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

No, you meant a binary-coded decimal clock.

You really don't need any external hardware.
Assume you have 4 bit "digits" for HH:MM, so four digits.
You have four pins for the "digits", and four pins to select which "digit" you want to display at any particular moment.
Eight pins.
Plus two for your AM/PM indicator.

« Last Edit: July 01, 2010, 05:03:56 pm by AWOL » Logged

"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 238
Posts: 24298
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Oops, missed seconds.
Make that 10 pins. (plus 2 for the AM/PM)
« Last Edit: July 01, 2010, 05:11:25 pm by AWOL » Logged

"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

Somewhere in Arizona
Offline Offline
God Member
*****
Karma: 0
Posts: 725
Arduino must be a drug, because I'm addicted!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

So you're saying multiplexing (sort of)? Like row column? i think you mean 4 rows, and 6 columns? Am I correct?
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 23
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

When I made mine, I had two for the colon, five for the hours, and 6 for the minutes. It was in 24 hour time. No BCD here! I was going for pure efficiency with my I/O pins, as I also had hours set and minutes set buttons. The two for the colon were in series, so I ended up at exactly 14 I/O pins. Perfect for the Diecimila. I suppose I could have had an AM/PM indicator and moved the switches to the analog input.

Anyways, save some hardware by not using BCD. Be cost effective. That's a good trait in the long run.

If you ever decide to build a Nixie tube clock down the road, that's when you ought to look into multiplexing/shift registers. If you want to adjust the brightness easily, use shift registers with PWM on the B+.

Kyle
Logged

Somewhere in Arizona
Offline Offline
God Member
*****
Karma: 0
Posts: 725
Arduino must be a drug, because I'm addicted!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I am already settled on 21 leds. I am not changing that. I am building a standard BCD clock. I need to know wheather it is easier to code multiplexing or shift registers.
Logged

Portugal
Offline Offline
God Member
*****
Karma: 5
Posts: 962
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Adding a shift register is very very easy and you just need to use the shifOut command to use it.
Logged

Somewhere in Arizona
Offline Offline
God Member
*****
Karma: 0
Posts: 725
Arduino must be a drug, because I'm addicted!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

So you recommend I use shift registers?
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 23
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Unless you use latches, multiplexing results in a dimmer display. I don't know if that's a problem for you or not.

Have you considered a Mega? At least you would be able to save some hardware by getting one of those. It'd also save you some code while you're at it.

Kyle
Logged

Pages: [1] 2   Go Up
Jump to: