please advice if I am setting Timer0 as counter

Discussion in 'Embedded Systems and Microcontrollers' started by micropad, Jan 7, 2012.

  1. micropad

    Thread Starter Member

    Dec 24, 2011
    38
    0
    Dear All,
    please advice if I am setting Timer0 as counter mode of PIC 16f877a MCU

    Let's think if we insert T0CKI pin 10Hz pulse, then I need to know the TMR0 register increase at 10HZ or less than 10HZ due to requirements with internal clocks sampling sync (Q2-Q4) let's assume prescaler set as 1:1
    please advice
     
  2. Markd77

    Senior Member

    Sep 7, 2009
    2,803
    594
    It will increase at 10Hz. To get 1:1 prescaler you have to assign it to the WDT, following the sequence in the datasheet.
     
    micropad likes this.
  3. micropad

    Thread Starter Member

    Dec 24, 2011
    38
    0
    Thanks Markd for your reply
    As per datasheet every external clock sample at Q2 to Q4 of internal clock
    and RC delay 20ns. can you kindly explain, how this delay does not effect to increment TMR0 register
    Your reply is highly appreciated
     
  4. Markd77

    Senior Member

    Sep 7, 2009
    2,803
    594
    It means that it won't have a problem sampling anything significantly slower than the instruction frequency (assuming the width of the pulse and gap meet the timing requirement). 10Hz is 100000 times slower than a PIC running at 4MHz, so unless your pulses are very short (and it's pretty hard to make a pulse that short) there will be no problems.
     
Loading...