Shop OBEX P1 Docs P2 Docs Learn Events
7 segments clock — Parallax Forums

7 segments clock

The_ApprenticeThe_Apprentice Posts: 15
edited 2006-04-27 19:37 in BASIC Stamp
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

Comments

  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2006-04-26 17:08
    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
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2006-04-27 16:08
    Consider your conversitions as you have three variable types.

    The raw time counter [noparse][[/noparse]only one]

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

    The 7 segment display buffers [noparse][[/noparse]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 [noparse][[/noparse]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 [noparse][[/noparse]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 [noparse][[/noparse]·黃鶴 ]·in Taiwan
  • The_ApprenticeThe_Apprentice Posts: 15
    edited 2006-04-27 17:52
    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 SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2006-04-27 19:21
    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
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2006-04-27 19:37
    Check out StampWorks experiment #8 -- is has 7-segment digit patterns stored in DATA tables.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
Sign In or Register to comment.