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.

Digital alarm clock

Status
Not open for further replies.

bex_445

New Member
Hi,
I have been playing with pics over the last few weeks and have managed to do a few simple circuits like flashing leds, displaying txt on an lcd etc. I have worked through a few tutorials writting in both assembly and c. I prefer writing in c.

Now that I have learnt the basics I have decided to go further by making a digital alarm clock but I dont know where to go from here.

I assume that I will need to usd timers? but how? do I use 3 timers (hours, mins, secs) or just one running count and use math to get the hours, mins, secs?

Will I need an external oscilator or crystal? how precise is the built in one?

I am sure there is more questions but I cant think if any at the moment.

So far I have been using the 16f628 and a hitachi lcd. I know I will likely need a 16f877 for future projects but the 628 should still be ok for this project?

thanks
 
Do a search, there's a bunch of folks on here who have made clocks using PIC chips.

Typically on a mid-range PIC you would run Timer1 with a 32.768 KHz crystal. This will generate an interrupt every 2 seconds by default, and with a little bit of code you can change it to 1 second or less. Use this to increment your seconds, minutes, hours, etc.

You'll need a crystal as the internal RC oscillator isn't accurate enough for a clock.
 
I have tried searching the forum and google but have only found either clocks using 7 segment displays or written in assembly. I would like to use an lcd and c
 
If you know what your doing, what your asking is extremely easy. Set up the LCD and print the hours , mins , secs registers onto it. A 7 seg would require a bit more thinking.
 
Try here, there is a clock project using text LCD and C source code;
Shift1-LCD Projects

**broken link removed**

If you are not already using MikroC you can download the free (2k ROM) demo version from MikroElektronika.
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top