PDA

View Full Version : 7 segments clock



The_Apprentice
04-26-2006, 11:07 PM
Hi everybody,

I need some help, i'm trying to build a 4 digits 7 segments clock using hc595, i woul like to know if somebody have a code sample for this work.

Thank you

Chris Savage
04-27-2006, 12:08 AM
This project uses the HC595 for the Binary Section of the display, but you could get some ideas from the code.и You would need to match each digits pattern then look them up based on the value of the digit.

http://forums.parallax.com/showthread.php?p=552892

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com (mailto:csavage@parallax.com)

Loopy Byteloose
04-27-2006, 11:08 PM
Consider your conversitions as you have three variable types.

The raw time counter [only one]

The seconds, minutes, and hours counters. [three]

The 7 segment display buffers [four]

The seven segment display will use a single byte to properly display each digit.и These have to be put into four consectutive bytes of RAM for them to be shifted out.

The raw time is usually calculated as seconds [so 60x60x24=8640] which requires about 12 bits to count, so the raw time is usually stored asиa 16bit word in two bytes.

Usually clock time is stored and incremented in Binary Coded Decimal because it can store two digits [like seconds, minutes, and hours] as one byte.



▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"When all think alike, no one is thinking very much.' - Walter Lippmann (1889-1974)

ииииииииииииииииииииииииииииииииииииииииииииииииии ииииииииииииииииииии Warm regards,иииии G. Herzog [и黃鶴 ]иin Taiwan

The_Apprentice
04-28-2006, 12:52 AM
Chris,

I like your project very much. I will buil one in the future.
But I would like to use use the hc595 to drive this 4 7segmentes. I have also some 5x7 and 8x8 Dot Matrix led's that i would like to use, same using hc595.
Thanks.

Chris Savage
04-28-2006, 02:21 AM
Thanks, as I said this can be done using a small lookup table for the 7-Segment patterns.и I know Jon Williams did something like this, but for the life of me I cannot remember the project or where the code is.и Perhaps he will chime in on this.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com (mailto:csavage@parallax.com)

Jon Williams
04-28-2006, 02:37 AM
Check out StampWorks experiment #8 -- is has 7-segment digit patterns stored in DATA tables.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax