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.

Countdown timer project

Status
Not open for further replies.

Dan East

New Member
I've got to put together a custom countdown timer, and I'm having a hard time settling on how to proceed. I don't want to do a lot of experimenting or trial and error with this - I'd like to complete it by the end of the week. I will be using a 16F PIC, because I already have them, and my programmer can't handle anything but 8DIP / 18DIP.

The purpose of this is to provide a countdown timer for a speaker, so they can see how much time they have left via a display. It will provide some extra visual warnings at certain points, like when they only have 5 minutes left, via high-intensity LEDs. In the future I will probably interface this timer with other units wirelessly, so they will all stay in sync and can control each other.

The decision I'm having trouble with is whether to go with 4 7-segment LEDs or an LCD panel. The LEDs would require an awful lot of pins (11), verses an LCD (7). I would rather keep this simple and not have multiple PICs or extra driver ICs. The main caveat with the LCD is that I would like something like a 2 line display but displaying numbers using the entire height - so the digits are at least the size of your typical 7-segment LED. Can I use user-defined characters interfacing a HD44780 in 4-bit mode? Has anyone tried using a 2-line display with custom glyphs to make full-height numbers, and how did it look?

If I did go with the LEDs I would have to try and share some of those pins as inputs (minute, second and start/stop buttons).

Which route would you take?

Dan
 
If you use a 16F88, you can get 16 I/O pins if you are willing to settle for 1% accuracy. This will be enough for the LED display and 7 buttons - have the buttons connected to 1 pin and to the 7 segment lines via diodes so they can only pull the segment lines low when the output is low. Actually, as that would only require 12 I/O pins you could put a watch crystal on timer 1 for a more accurate clock.

Mike.
 
Mike, you reminded me of another question I forgot to ask. Most of the PIC programming I've done is serial / IrDA type stuff, so timing wasn't really critical. So I have no idea what type of accuracy I would be looking at over 30 minutes using the internal oscillator. 1% over 30 minutes would be off by 18 seconds, which isn't acceptable.

Dan
 
Dan East said:
Mike, you reminded me of another question I forgot to ask. Most of the PIC programming I've done is serial / IrDA type stuff, so timing wasn't really critical. So I have no idea what type of accuracy I would be looking at over 30 minutes using the internal oscillator. 1% over 30 minutes would be off by 18 seconds, which isn't acceptable.

So use a crystal, and make it adjustable to be as accurate as you can.
 
If you use a watch crystal (32768Hz) on timer 1 and the internal oscillator you can get a very accurate timer. The 16F88 data sheet has example code showing how to implement a clock with this configuration.

Mike.
 
Status
Not open for further replies.

Latest threads

Back
Top