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.

Clock Controller Design Question

Status
Not open for further replies.

bacterozoid

New Member
I'm working on designing the hardware for a clock circuit. I'll be using an Atmel Mega series chip for this as the clock does some other things besides be a clock.

I'm working on the display component and I'm having a dilemma. Which of these methods is better?

1) Use a 4 digit display with 4 select lines and 8 display lines. You select the digit you want to display and send the right SSD code on the 8 lines. You then cycle through the digits in your program and display them one at a time. Doing this quickly gives the illusion that they are all on at the same time and uses less power and less wiring than the next method.

2) Use a 4 digit display with 8 input lines for each digit. Serially clock data out from one output pin on the controller into something like a 74HC595 shift register that updates once every minute.

My concern is writing the program for this. The clock has to keep time, display time, remember alarms, check for alarms (once a minute), accept interrupts from several buttons, as well as work with a wireless interface and play mp3s somehow. (The media functionality may be outsourced to another dedicated DSP or AVR).

In the first approach, I have to update the display very frequently. This would probably be the main program (as well as counting ticks for the time) while the rest of the functionality is configured using interrupts.

In the second approach, there's less updating and the AVR cpu time can be used for other things. What do you guys think?
 
The display technique is called 'multiplexing', and is standard in almost everything you see with a display - it's quite simple, and best done using timer interrupts, which can also be used to keep your clock count going.
 
Ok - I took apart my clock and it's using that technique. What sort of frequency am I looking at? IE: How fast do I need to go through all four digits in order that they are bright and no flashing is detectable.
 
Ok - I took apart my clock and it's using that technique. What sort of frequency am I looking at? IE: How fast do I need to go through all four digits in order that they are bright and no flashing is detectable.

Something like every 10mS or 20mS should be fine, and give you a sensible base for your clock.
 
Another option for you may be the MAXIM MAX7219 or MAX7221, which are SPI compatible display controllers for up to 8 seven segment leds. Very easy to work with, and is dot addressable, has display dimming features (handy for a bedroom clock).

It uses just 3 pins, and internally handles all the multiplexing etc. Just send it what you want to display once a second, and you have a clock! Sample code is readlily available for the pic, so im sure it will be available for the AVR too.
 
That's a neat option SMU but looks like they are between 10-15 bucks. I'll save the cost for this project but it's neat to hear about that. It's especially nice to only have to use one resistor to set the current.
 
Ask Maxim nicely and they will send you a liitle plastic case with a 'sample' for you to use, but *please* dont abuse this priviledge as it will ruin it for me and many hundreds of others who genuinly use their samples service.

If you like the chip they send you, and can see the benefits - then buy the next ones - they can be had much cheaper if you hunt around.
 
That's true and I would be happy to do that (or even spend the 10 bucks) if this were just a personal project, but this is actually an academic project for a client who is interested in producing what my team creates if it has a market. Granted they are like 5 bucks in bulk, but whatever I can do to reduce the cost helps. :)
 
Ok, hang on a second. I've apparently forgotten how to do the multiplexing...

For a common cathode display, I shoot out the digit I want to appear on a given segment, then connect the common cathode for that digit to ground, and all the other ones to Vcc, right?
 
yup - thats it

the pull that cathode back up before writing the next 7seg (at least in my experience)

otherwise if you write the next 7seg, then pull your first cathode up, and your second cathode down you get a messed up display
 
Last edited:
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top