2 timers in pic16f676

Discussion in 'Embedded Systems and Microcontrollers' started by reema paul, Jun 30, 2010.

  1. reema paul

    Thread Starter New Member

    Jun 28, 2010
    can anyone help me how to use 2 timers(timer0 and 1)simultaneously in pic 16f676??
    sample code eg. will be appreciated.
    Devasish Paul likes this.
  2. retched

    AAC Fanatic!

    Dec 5, 2009
    To do what?
  3. reema paul

    Thread Starter New Member

    Jun 28, 2010
    one for beeping buzzer for every 1 sec another for generating a 50hz constant pulse.
  4. retched

    AAC Fanatic!

    Dec 5, 2009
    Ok. You dont need 2 timers to do this.

    You only need to read the 1 timer and to perform an action after X number of ms and Y number or ms.

    When you reset the timer, it will start counting.

    You can read the timer and see that timer=5200 ms have passed so you would say:

    You will code to say:
    After beeptime=timer+500000ms then BEEP
    buztimer=timer+1000000 then BUZZ

    You are reading the current time (timer) then you want to perform an action 50000) ms later (timer+50000)

    Your 50hz pulse could be done easily with a PIC that has hardware PWM.

    I dont believe the 16f676 does. SO, search around for using PWM on the 16f676 with software, and you can do it that way.
    reema paul likes this.
  5. Devasish Paul

    New Member

    Oct 5, 2015
    I have to know how configure Timer pin in mikroC for pic16f676.Would anyone help me!!
  6. John P

    AAC Fanatic!

    Oct 14, 2008
    Thread hijack, and anyway a "Timer pin" isn't anything I recognize.
  7. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    Hello Paul, welcome to the forums!

    First off, each thread is assumed to be owned by the person who started it. It is confusing to ask your own question in someone else's thread, but threads are cheap so you should just start your own. A moderator may come by soon and move your q to it's own thread.

    The '676 has 2 timers inside, each may be clocked either with an internal signal, or thru a pin from the outside.

    Are you trying to use the external pin? For which timer?