countdown timer

Discussion in 'The Projects Forum' started by Cristopher Tingcang, Aug 10, 2011.

  1. Cristopher Tingcang

    Thread Starter New Member

    Jul 31, 2011
    18
    0
    Can anyone help me?
    im trying to build a countdown timer that will trigger a system when the time reaches 0.

    requirements:
    1. 1 seven segment for the hours and 2 7-segment display for the minutes.
    2. the maximum time will be 8 hours
    3. there is 1 switch to adjust the desired time in hours
    ex: 5 hours, 7 hours
    4. a RESET button, that when pressed, the count will stop and the time goes back to the default time which is 8 hours.
    5. an LED will turn on when the count reaches 0:00

    what PIC microcontroller should i use for this project.
     
  2. elec_mech

    Senior Member

    Nov 12, 2008
    1,513
    193
    Hi Cristopher,

    Really any PIC will work depending on how you plan to interface the display. If you're just using standard 7-segment displays (0.56" or smaller), you can control the pins directly from the PIC and then you'd probably want a PIC with a lot of I/Os. If you're going to use another IC to control the display, then you don't need as many I/Os depending the IC.

    You can use a timer on the PIC to keep the time or a separate clock IC such as a DS1302, although you don't need to keep time per se, so that may be overkill.

    You could almost make this without an MCU if you can find a decent 1 Hz clock circuit, but programming a PIC will require a lot less parts and circuit design.
     
    Cristopher Tingcang likes this.
  3. simo_x

    Member

    Dec 23, 2010
    200
    6
    you can set your timer from a loop of 1s repeated... any micro will work, and if you work with interrupts, better..
    .
     
    Cristopher Tingcang likes this.
  4. jj_alukkas

    Well-Known Member

    Jan 8, 2009
    751
    5
    2 ways.. If you still plan to stick with 7 segment led's, you will need 7+3=10 pins for 7 segments by multiplexing (only in software), 2 pins for the two switches and one pin for the led.. If you need a very precision device, 2 pins for the crystal too(+/-1% accuracy if you use internal osc) so anything starting from the low end 16F628 will work with no pins remaining. If you ditch the crystal, you get 2 more pins, but I think you dont need those pins.
    Another way is to use a small 8-pin 12F683, drive a serial lcd with a 74HC595 in a 3-wire config, and you get 3 pins remaining for your 2 switches and 1 led, no crystal. The advantage of this one is, the pic is cheaper and you can use an lcd to display a lot more data than just a countdown time like the time lapsed too... This is how you drive it
     
    Cristopher Tingcang likes this.
  5. Cristopher Tingcang

    Thread Starter New Member

    Jul 31, 2011
    18
    0
    Thank you!

    Can you attach any schematic examples of clock circuit using PIC16F887A? The problem here is that my knowledge about microcontroller programming is very limited. I need tutorials and more examples. Can you help me with this?

    Thanks!!!!
    :)
     
  6. Wendy

    Moderator

    Mar 24, 2008
    20,765
    2,536
    You can also do this with discrete chips. It is entirely your choice. If done discretely you don't have to multiplex either. Unit cost for the project will be slightly more expensive, but the amount of programming work is offset by the build time, it will be slightly more complex hardware wise.

    Good chips to look at is the 4518 or 4520 (BCD vs binary, I prefer CMOS) or the 74192 or 74193 (BCD or binary).
     
    Cristopher Tingcang likes this.
  7. jj_alukkas

    Well-Known Member

    Jan 8, 2009
    751
    5

    You didnt tell your decision. Sticking with 7 segment leds or lcd?.. Can give you examples, but need to know the language you will be programming in for the PIC.. This particular project I think wont be found readmade, so finding a readymade hex file wont be of help.. you will need to find examples in the language you like..
     
  8. jj_alukkas

    Well-Known Member

    Jan 8, 2009
    751
    5
    Multiplexing with a PIC for 7 segments is very simple.
     
    Cristopher Tingcang likes this.
  9. Cristopher Tingcang

    Thread Starter New Member

    Jul 31, 2011
    18
    0
    I think, I'll just stick to 7-segments display but I am really a newbie when it comes to microcontrollers.

    I have a basic in C language but not in PIC programming. I understand programs/codes but when it comes to PIC programs, my knowledge is very little.

    Can you please give me examples of codes about countdown timer?

    Thank you!!!

    :)
     
  10. Cristopher Tingcang

    Thread Starter New Member

    Jul 31, 2011
    18
    0
    The language that I will be using, which is the only available programming language for me, is the MikroBasic. Have you heard of it?

    Can you give me examples of codes about countdown timer?

    Thank you!!!
    :)
     
  11. jj_alukkas

    Well-Known Member

    Jan 8, 2009
    751
    5
    Microbasic I've head, but its rare to find programs in it, I mean, you can find many, but not as much as CCS, Hi tech c and ASM projects... I use Hi tech c.. very similar to the one you told + I have found many resources..

    This one will help you learn abt the timer functionality, if you find it hard, leave it for now.. http://embedded-lab.com/blog/?p=1042
    This one uses the 16f628a I told abt, but an lcd display, but the program is in mikro c :) Will help you get a start.. http://embedded-lab.com/blog/?p=1378
    Another example http://pic16f628a.blogspot.com/2010/09/00-99-minutes-timer.html
    This helps you drive a multiplexed 7 segment.. I can help you with the 7 segment part alone if you are in trouble.. http://extremeelectronics.co.in/mic...ment-displays-–-pic-microcontroller-tutorial/

    These are for reference and learning
    PIC C samples & Tuts
    PIC PDF Tutorials

    Will take a day or 2 for you to start digesting, but its worth the time spent!
    Good Luck!!
     
    Cristopher Tingcang likes this.
  12. Cristopher Tingcang

    Thread Starter New Member

    Jul 31, 2011
    18
    0
    thank you very much for the help.... =)

    I will ask your help after I read and digest all of the examples.

    =)
     
Loading...