Binary Digital Clock
Chris Savage
Parallax EngineeringPosts: 14,406
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
·· 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
·
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
I'm used to looking at binary with the LSB on the right, but left works also.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Beau Schwabe
IC Layout Engineer
Parallax, Inc.
·· 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
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
·· 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
Why is it that no matter how big your breadboard is, your circuit will quickly expand to fill all available space?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com
Think I'll stick with Mickey Mouse!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
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
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
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
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 Schwabe
IC Layout Engineer
Parallax, Inc.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"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 Savage
Parallax Engineering
·