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.

PIC Based Clock - How Many Buttons Did You Use?

Status
Not open for further replies.
Hi,

I'm building a PIC based clock. It works ok. I'm now adding an alarm setting function. Thing is I presently have three external buttons, one to enter the 'set time' mode, and two to increment the hours and minutes. But I'm struggling, I could do with at least another button - 'set alarm time'.

If you've built a PIC clock with alarm how many buttons did you use? Should three be enough to achieve the required functions with perhaps some slightly more complicated code? It would be easier with four but I would have to use an extra ic (4017) to release some spare input pins. I've only one spare pin and I intend to use that for the alarm sounder.

**broken link removed**

**broken link removed**

Thanks.
 
hi,
One way is to assign the alarm function to the min set key when NOT in the Time Set mode.

So when the Min Set is pressed without the Time Set being selected , jump to Alarm Mode set.
 
Hello!

You could use a rotary encoder. You would need 3 pins (Switch A, Switch B and Press Switch). Rotation increment/decrement the count and pressing on the button can change the menu.
 
It's hard to tell from your diagram but it looks like you could have 7 switches and gain 2 pins. You wire the switches as an additional display, you then make the common low and read the values on the segment pins (pullups needed). You need a diode for each pin to stop multiple key presses from shorting segments together but 4 (5,6 or 7) diodes gets you 4 (5,6 or 7) buttons and 2 pins spare.

Mike.
 
Couldnt you share the one pin you have left between the sounder and alarm set, im sure there is something in a microchip app note where you can use a pin as both am input and output, i think it used a diode of something - check out the app notes on microchip site
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top