Shop OBEX P1 Docs P2 Docs Learn Events
Binary Digital Clock — Parallax Forums

Binary Digital Clock

Chris SavageChris Savage Parallax EngineeringPosts: 14,406
edited 2010-03-15 17:07 in Robotics
Hello Everyone!

·· There have been a few people waiting patiently for me to finish this project and get it uploaded.· Thanks for your patience!· Working for Parallax is the greatest job I’ve ever had, but sometimes you devote yourself more to other projects than your own.· Eventually I get around to finishing some of these projects and post them here for our customers to use and enjoy.
·
·· You’ve probably seen some of the “Hacker” clocks floating around the internet (eBay, ThinkGeek.com, etc.).· These clocks display the time in binary format, the native language of a computer (Based on 1’s and 0’s).· The time is shown using LEDs instead of 7-segment displays.· Ever since I got mine people have asked me what it’s displaying, and some don’t even believe me when I tell them it’s the time in binary.· I told a few people I was going to build a binary clock that also showed the “normal” time, so that people could see the relationship between the two formats and hopefully understand it better.
·
·· When I started this project I already knew I was going to be using certain parts.· All parts are available from Parallax.· The original design used pushbuttons, but I couldn’t seem to make everyone happy with the button configurations.· So if you want the ability to set the clock manually, you will have to write a routine and implement your own input device, such as push-buttons to do so.· Please feel free to share this information with other users as more people may like your individual ideas.· For now you can set the clock by using the DS1302_Demo.bs2 file.· This is designed to help people understand the DS1302, but I used the same I/O lines so the code is compatible and allows you to use the DEBUG Screen to set the Date/Time.· The DS1302 should be battery-backed anyway, so this shouldn’t be a problem.· As a final note, I do have a BS2p version of the clock using an Optical Rotary Encoder with a push-button.· This allows me to set everything with one input device.· The code needs a lot of work to be User-Friendly though, so I will release that later.
·
·· Since I already intended to use the DS1302 for timekeeping, I decided I might as well make use of the Date information available to me as well, and so a Parallax 2X16 Serial LCD Display was added to show the Day, Date and Temperature.· The Temperature idea was added when I realized I had a lot of free space on the LCD, and could add the DS1620 using only 1 more I/O line.· This also makes another point in that the DS1302, DS1620, MAX7219 and all three 74HC595s are all sharing the same Data and Clock lines.· This saves a lot of I/O pins compared with them each using their own, and demonstrates one way to consolidate I/O lines.· Another feature demonstrated here is shared variables and constants.· By sharing I/O lines, we can also have some common constants.· And for variables, we can re-use many of them.· Variables are conserved by re-using the same variables in many routines where the information needs to be retrieved and displayed and then it is free to use for reading the next device in line.
·
·· So now what we have here is a “Super Hacker Clock” with extra bells and whistles, including selectable hourly chime and 12/24 hour mode support.· In 12 hour mode the AM/PM indicators light up.· In 24hour mode neither LED will light up.· J1 selects the hourly chime.· If J1 is closed, every hour on the hour, there will be an audible beep.· If J1 is open, the chime (beep) will be disabled.· The neat thing is that everything is customizable.· After all, we’re using the BASIC Stamp, aren’t we?· So we may choose not to implement an hourly chime.· We may also choose to lock the time into 12 or 24 hour mode, or we may choose to set it using our input device.· The point is you can always change things if you don’t like the setup.· This project is designed to be customizable.
·
·· The code and schematics are believed to be accurate and error free, however neither Parallax, Inc. nor I accept any responsibility for the results of using the data presented here.· It is intended as both a learning tool as well as enjoyment.· It is my sincerest hope that you benefit from the information provided.· Please post any comments, code suggestions, error/bug reports or pictures of your own implementations here on our forums.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com

Comments

  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-10-10 03:56
    ·· Okay, here are some pictures of the Binary/Digital Clock.· These are a few from all of the ones I have taken so far.· Later when I mount this in a cabinet I will post more pictures.· For now here are the more informative ones.
    ·
    1) This was the first prototype.· Notice I still needed more LEDs than the PDB had, but I chose to use the 7-Segment Display anyway and ignore the lower seconds digit.· You may also notice the LCD was formatted differently.
    ·
    2) This one is a little blurry because I was trying to capture the backlight for the LCD.· You can see the LCD is formatted differently now, and I added an encoder during testing.· If you’re wondering by now why my LEDs on the PDB are different colors than what we have for sale, it’s because the PDB was a prototype too!· =)· Using a prototype to build a prototype.
    ·
    3) By now I had decided I wanted to see what my 1” 7-Segment Displays would look like, as well as the 10mm LEDs for the Binary section, so I moved it all to a Jameco Breadboard.· All the main control circuitry is still residing on the PDB.
    ·
    4) Here is a close-up of the LCD Display.
    ·
    5) Here is a close-up of the Breadboard with the 1” 7-Segment Displays and the 10mm LEDs.· I had to adjust the resistors for each color of LED since they all have different forward voltages and current draw.· That was fun.· When looking at the 10mm LEDs for the Binary section, it might help to picture each color group rotated 90 degrees counter-clockwise.· That’s how they will be in the final unit.· Unfortunately because of the way the breadboard was I had to orient them in this manner, but it’s very un-intuitive for reading that part of the display.· I’m used to it now, but it throws my wife and kids.
    ·
    ·· Now might also be a good time to mention too that originally I had 3 colors of 7-Segment Displays as well.· But I learned something about these, especially with the way the MAX7219 controls the current.· The yellow was really dim.· The green was not too bad, and the Red was perfect, but in the end you should probably use all one color.· I know I will be.· The angle makes it hard to see, but the colons and AM/PM indicators were nicely lit.· They will vary in brightness with the 7-Segment Displays, however the 10mm LEDs are connected to 74HC595s, so they won’t.· This only affects things if you want to be able to dim the display.· Comments are welcome.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
    640 x 479 - 96K
    640 x 480 - 65K
    640 x 479 - 76K
  • Beau SchwabeBeau Schwabe Posts: 6,566
    edited 2005-10-10 04:25
    Cool project Chris!

    I'm used to looking at binary with the LSB on the right, but left works also.tongue.gif

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-10-10 04:42
    Beau,

    ·· Actually I covered in the text how the LSB is supposed to be on the bottom, and that the displays would normally be rotated 90 degrees counter-clockwise.· You'll see in the final build.· =)

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • Fe2o3FishFe2o3Fish Posts: 170
    edited 2005-10-10 04:45
    I agree with Beau. LSB on the right... kinda like the way most of us read decimal numbers too. smile.gif
    Now, how 'bout the temperature in binary as well?

    Nonetheless, nice job there Chris!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    -Rusty-
    --
    Rusty Haddock = KD4WLZ = rusty@fe2o3.lonestar.org
    **Out yonder in the Van Alstyne (TX) Metropolitan Area**
    Microsoft is to software what McDonalds is to gourmet cooking
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-10-10 16:44
    Rusty,

    ·· Thanks.· For everyone wondering, the final product, mounted in a cabinet will have the Binary Display configured vertically, just like my desktop Binary Clock from ThinkGeek.com with the LSB at the bottom.· See the following link for a picture.

    http://www.thinkgeek.com/cubegoodies/lights/59e0/

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • ForrestForrest Posts: 1,341
    edited 2005-10-11 02:43
    That's a good looking project. OK, I'll admit it - I'm jealous that your clock project is working but mine isn't finished yet.

    Why is it that no matter how big your breadboard is, your circuit will quickly expand to fill all available space? burger.gif
  • OrionOrion Posts: 236
    edited 2005-10-11 04:33
    You must be left-handed Chris
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-10-11 05:32
    Sort of...I'm ambidextrous...In the sense of using both hands, anyway.· =)· Why do you ask?· I hope you find the information presented to be useful.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • OrionOrion Posts: 236
    edited 2005-10-13 01:00
    I was referring to the LSB on the right comments. [noparse]:)[/noparse]
  • Kevin WoodKevin Wood Posts: 1,266
    edited 2005-10-14 20:58
    I think I saw Jennifer Garner defuse one of those on Alias...
  • MRMR Posts: 46
    edited 2007-10-20 08:07
    Chris, I see you used 7 segment displays. I am building a clock but it uses the month day year hour and min. I use common anode 7 segment displays. Can you expand the clock using 7 segment displays to include the year day of the month and then alpha numerics to show the first three letters of the month? How do I increase the brightness of my led displays?
  • WhitWhit Posts: 4,191
    edited 2007-10-20 13:56
    Really cool Chris, by the time I finished getting the time computed in my head - it would be a different time.

    Think I'll stick with Mickey Mouse!

    attachment.php?attachmentid=49975

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Whit+


    "We keep moving forward, opening new doors, and doing new things, because we're curious and curiosity keeps leading us down new paths." - Walt Disney
    100 x 110 - 3K
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2007-10-22 14:25
    MR,

    The date/day information is available on the LCD. You could use 16-segment displays to get alpha characters for the day, kind of like the setup of the dash panels in Back to the Future. Increasing brightness depends on the displays. The MAX7219 I used has a brightness adjustment internally via software as well as an initial hardware setting determined by a resistor.

    Whit,

    No need to computer the time…Just look at the digital part of the display. This clock caters to everyone! =)

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
  • WhitWhit Posts: 4,191
    edited 2007-10-22 21:54
    Chris Savage (Parallax) said...


    This clock caters to everyone! =)
    So simple, a caveman (like Beau or me)·could use it! smilewinkgrin.gif

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Whit+


    "We keep moving forward, opening new doors, and doing new things, because we're curious and curiosity keeps leading us down new paths." - Walt Disney
  • Beau SchwabeBeau Schwabe Posts: 6,566
    edited 2007-10-23 00:01
    lol

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
  • logan996logan996 Posts: 281
    edited 2010-03-14 13:17
    hey chris i know this is an old fourm string but could post a brand new string on the BS fourm explaining what the MAX7219 and the other MAX chip's (its like 2....) schematics and then show a simple bit of code and what he circut would look like? maybe just use a LED matrix for testing

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "When the government is afraid of the people there is liberty, when the people are afraid of the government, there is tryanny"

    · Thomas Jefferson
    ·
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2010-03-15 17:07
    I think instead I will do a Savage Circuits TV episode on the MAX7219. I think it's about time for that IC to be demystified.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage

    Parallax Engineering
    ·
Sign In or Register to comment.