Go Down

Topic: Mutiplexing or Shift Registers? (Read 1 time) previous topic - next topic

Jeremy1998

Jul 01, 2010, 11:21 pm Last Edit: Jul 02, 2010, 01:53 am by Jeremy1998 Reason: 1
I am making a binary clock, and I dont know which one to do. Which one is easier to code?

AWOL

#1
Jul 01, 2010, 11:27 pm Last Edit: Jul 01, 2010, 11:52 pm by AWOL Reason: 1
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.
"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.

Jeremy1998

#2
Jul 01, 2010, 11:32 pm Last Edit: Jul 01, 2010, 11:34 pm by Jeremy1998 Reason: 1
??? 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)

AWOL

#3
Jul 01, 2010, 11:37 pm Last Edit: Jul 01, 2010, 11:52 pm by AWOL Reason: 1
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
"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.

Jeremy1998

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.

AWOL

#5
Jul 01, 2010, 11:50 pm Last Edit: Jul 01, 2010, 11:52 pm by AWOL Reason: 1
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.
"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.

Jeremy1998

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?

AWOL

#7
Jul 02, 2010, 12:02 am Last Edit: Jul 02, 2010, 12:03 am by AWOL Reason: 1
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.

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

AWOL

#8
Jul 02, 2010, 12:10 am Last Edit: Jul 02, 2010, 12:11 am by AWOL Reason: 1
Oops, missed seconds.
Make that 10 pins. (plus 2 for the AM/PM)
"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.

Jeremy1998

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

antiquekid3

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

Jeremy1998

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.

Senso

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

Jeremy1998

So you recommend I use shift registers?

antiquekid3

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

Go Up