PIC recommendation for building a 12-hour digital clock

Discussion in 'The Projects Forum' started by farscape, Jun 10, 2010.

  1. farscape

    Thread Starter New Member

    May 16, 2010
    26
    0
    Hi,

    I am interested in building a 12-hour digital display clock using a microcontroller.

    If I can get the clock to work, I would like to be able to continue adding extra features (alarm clock and maybe a light that slowly increases brightness once the alarm goes off, etc) so I want to use a pic that has room to eventually add additional components.

    Does anybody have a recommendation for a good PIC to use?

    Thanks
     
  2. coldpenguin

    Active Member

    Apr 18, 2010
    165
    9
    I use microchips (www.microchip.com) PICs
    Do you intend on using an LCD display or an LED disply (i.e. character display, or LED segment)?

    An LCD display can be implemented using 7 pins from the PIC
    Each 7 segment display would require at least 7 pins, but these could be multiplexed or a decoder used.
    The Dallas 1307 'real time clock' requires access from the PIC with 2 pins (I2C)
    BUT, this doesn't have alarm functions, if using that chip you would need to implement the alarm in the PIC itself. There are later dallas chips which have alarm functions built in, I suspect these are I2C as well.

    I have been using a PIC 16f877a which has 40 pins, and more than enough space for a clock and other items, because I had it to hand. This is probably more than enough for what you have said you wanted to do so far.
     
  3. JDT

    Well-Known Member

    Feb 12, 2009
    658
    85
    This is a fairly simple project for a beginner. I can recommend the PIC micro-controller. Internally, it has a timer/counter and oscillator that can be connected to a 32768Hz watch crystal and will generate an interrupt every second. It is then easy to write some assembler code to increment some registers as necessary.

    Then, drive the display. You could use 7-segment LEDs, Liquid crystals or nixie tubes.

    Some LED displays need to be multiplexed. LCD displays need to be driven with an AC signal sop as not to polarise and damage the display panel.

    Nixie tubes need a fairly high voltage so need intermediate HV drivers. Transistors or the old 74141 can be used.

    I have attached some PIC code from a nixie clock I made some time ago.
     
  4. John P

    AAC Fanatic!

    Oct 14, 2008
    1,632
    224
    For a project of this size, I'd say the PIC16F690. You might want more pins if you plan to drive an LCD directly, however.
     
  5. farscape

    Thread Starter New Member

    May 16, 2010
    26
    0
    I plan on using a 7 segment LED. I was browsing online yesterday and found the PIC16F873A with 28 pins. Would this be a good choice? The only PIC I have experience with at this point is the 16F84A.

    Does anyone know of any good simulators I could download to test the circuit I come up with? I have found the simulator in MPlab to be very helpful with the programming, but it would be nice to find something that could test the wiring and hardware as well.

    Thanks
     
    Last edited: Jun 11, 2010
  6. MMcLaren

    Well-Known Member

    Feb 14, 2010
    759
    116
  7. coldpenguin

    Active Member

    Apr 18, 2010
    165
    9
    The 16f84a could probably be enough for this, if it is what you are used to.
    It has an internal timer, just make sure that your crystal is accurate.
    The segments can be charlieplexed as in the design above
     
  8. John P

    AAC Fanatic!

    Oct 14, 2008
    1,632
    224
    The 16F628 is pin compatible with the 16F84 and it has way more features plus it's cheaper. I think they only keep the 16F84 in production because people keep recommending it and they make extra profit on it.
     
Loading...