TIMER FOR PIC 16f877a using mikroC

Discussion in 'Embedded Systems and Microcontrollers' started by Danishmehmood, Aug 18, 2013.

  1. Danishmehmood

    Thread Starter New Member

    Aug 18, 2013
    1
    0
    hi. I am a new user of PIC Micro-Controller.

    My questions are:
    Can we use timer of PIC for 5 Seconds?
     
  2. blueroomelectronics

    AAC Fanatic!

    Jul 22, 2007
    1,758
    98
    You can use it to increment a counter on rollover. Any duration you want.
     
  3. MaxHeadRoom

    Expert

    Jul 18, 2013
    10,520
    2,369
    Most PIC's have a T1OSC input where you can connect a common 32.768Khz clock crystal, and use T1 timer to roll over at exactly every 1 sec.
    Max.
     
  4. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    7,386
    1,605
    Sure. No matter what kind of timer you actually pick, no matter what interval is it's max time you can always count timer intervals.

    Example: if yor max interval is .1 second, count 50 of them for 5 seconds.

    I've used a PIC to make a timer that can accurately (easily 2%) time 25 minutes; it could do more but that is all the customer required. That one uses a 1 mS timer as I recall.
     
Loading...