Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Need help with digital clock circuit

Status
Not open for further replies.

StarionGTO

New Member
I'd like to thank you all first for taking time out of your day to help me with this little project of mine. I've just recently started learning and looking into building circuits and really wish I took electronics classes in High School. I didn't and here we are. I would like to build a clock that displays the month, day and year as well as the current time in 12 hour format with two leds denoting AM or PM. Something that looks like this:

| 88 | 88 | 8888 | 88:88 : |
(Mo.)(day)(Year)(12H clock)

The last colon represents two LEDs where one would be lit for AM and the other for PM. I'm sure this will involve a microcontroller or two, but I don't know what components are required or how to wire them up. I do know that it will have a constant 12v DC power supply and I want to use six 2 digit 7 segment LED displays and four 2.2 Volt standard type LEDs. I know I will need drivers for the 7 segment displays and probably a couple of buttons or switches in the circuit somewhere to set the current date and time. I'd like to use three 5x7 matrix LED displays for the month, but then I realized I barely have a grasp on how to use 7 segment displays and trying to figgure the matrix display would just fry whats left of my brain.

Anywho. If any of you would feel so inclined as to recommend liturature, draw up a circuit diagram and a parts list or recomend which microcontroller and ICs to use (or figgure everything out for me so all I have to do is buy the components and build the thing! ;), it would be greatly appreciated. In the mean time I'll continue trying to learn as much as I can and maybe figgure it all out. I can put circuits together no problem if I have a diagram and a parts list, but at this point in time desiging circuits is beyond me.

Thanks again!
 
use crystal oscillator and divieder such as 4020 to get 1sec clock.
then count and display them. browse this board for sample circuits.
this can be reduced to couple components if you use microcontroller
in your design but this requires working programmer and some
programming skil.
 
Ok, so I went lookin around for counter displays and 1second clocks. I found a few and actually understand them *yeay me!* BUT, I don't understand how to set one up so that after 60 seconds it kicks a count over to the minute display.

I also found some information on clock/calendar ICs that Phillips made. They sound like exactly what I'm looking for but I'm a little sketchy about the I2C Bus it uses. Here is the data sheet I found:

https://www.electro-tech-online.com/custompdfs/2003/12/PCF8573_4.pdf

Would this be a good choice, or are there better ICs out there for this purpose?
 
StarionGTO said:
Ok, so I went lookin around for counter displays and 1second clocks. I found a few and actually understand them *yeay me!* BUT, I don't understand how to set one up so that after 60 seconds it kicks a count over to the minute display.

I also found some information on clock/calendar ICs that Phillips made. They sound like exactly what I'm looking for but I'm a little sketchy about the I2C Bus it uses. Here is the data sheet I found:

https://www.electro-tech-online.com/custompdfs/2003/12/PCF8573_4-1.pdf

Would this be a good choice, or are there better ICs out there for this purpose?

That would be a good choice for a micro-processor based system - one of my I2C PIC tutorials at http://www.winpicprog.co.uk uses that chip with an LCD display.
 
Great! Your site was very helpful, thanks! =>

Now, I think I've pieced enough of this together as far as major components go. I'm thinking I'll use tutorial 9 to help me set up an old telephone keypad as input switches for the PCF8573 chip and use a MAX6955 display decoder/driver for the 12 7-segment displays needed to display the date. They're both I2C bus based, so I don't see an issue there. Reading up more on the MAX, it seems I can drive both matrix and segment displays with it, so it seems I could use the 3 matrix displays for the month after all. Hell, I should just use alphanumeric led displays and uncomplicate the thing.

Would this work, or am I missing any components I need? Looking over the app. notes for the PCF8573, it looks like I need a master device... What sort of master device should I be looking for?

Here's the page for the MAX6955
**broken link removed**

Thanks!

*edit*
I've done a bit more research and I think I undersand how this thing is supposed to work. The controller is where the program is located and communicates with the clock IC and display driver IC via the IC2 bus. So the program would do something along the lines of calling the clock IC every coupla ms to check the time then send a signal to the display driver IC to change digits when required.

Found this controller on Phillips' site
https://www.electro-tech-online.com/custompdfs/2003/12/PCF8584_4.pdf

I've stuck with Phillips products simply because they're there and easy to get to without too much more lookin' around. If there are better ICs out there, please let me know. Thanks 'gain!
 
60Hz from the electrical outlet (or 50Hz in some countries) isn't nearly accurate enough to rely on for a self calibrating digital clock is it? I've read that the internal clocks on the MCU's I have are not all that accurate, espeically as the IC ages, and don't want the device to become inaccurate a few years down the road. If the 60Hz signal was accruate to a couple decimal points then it might be ok to occasionally sample the signal and change the prescaler. I don't think its that accurate though.
 
Noggin said:
60Hz from the electrical outlet (or 50Hz in some countries) isn't nearly accurate enough to rely on for a self calibrating digital clock is it? I've read that the internal clocks on the MCU's I have are not all that accurate, espeically as the IC ages, and don't want the device to become inaccurate a few years down the road. If the 60Hz signal was accruate to a couple decimal points then it might be ok to occasionally sample the signal and change the prescaler. I don't think its that accurate though.

I can't comment elsewhere, but in the UK the 50Hz mains is VERY accurate - it's corrected daily to keep it spot on time. I don't know how it's done now, but years ago they used to have two large clocks at the power stations - one fed from the generators and one fed from the Rugby time standard - at a certain time every night they would alter the speed of the generators to make the two clocks show exactly the same time. For this reason a mains driven clock could be a second or two out during any 24 hour period, but would be corrected every night.
 
I kinda feel a bit the moron, not putting 2 and 2 together. I thank you even more Nigel for posting that link. For some reason I didn't see it until now that you pretty much told me which controller to use and how to set it up.

But now I have another question. I found a datasheet that has the pinouts listed, but I'm still unclear as to which pins are used for the I2C bus.

I've come up with a circuit diagram to help myself see how this thing will work. It does not show the keypad I want to use to interface with the PIC controller, I wanted to add that after I understood the PIC's pinouts. If anyone sees anything grossly wrong or out of place, please let me know. Thanks!

*update*
I figgured since it has programmable I/Os, I could pick which pins to use for the I2C bus. Don't know if I'm correct about that, but it lets me finish out the diagram with all the components I wish to use and how I think they're supposed to be connected. Again, if anyone sees anything wrong/missing/out of place, please let me know. Thanks!
 

Attachments

  • clockcircuit.gif
    clockcircuit.gif
    101.9 KB · Views: 4,766
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top