timer 1 usage in pic16f877a

Discussion in 'Embedded Systems and Microcontrollers' started by raf23, Mar 30, 2013.

  1. raf23

    Thread Starter New Member

    Aug 2, 2010
    3
    0
    Hello

    I have got a situation where I'm forced to use timer 1 to generate interrupt at lower time limits like 256 us. Being a 16 bit timer ,Is there anyway that i could use it as 8 bit timer or more specifically to generate interrupt after 256 Instruction cycles ?

    Any help would be deeply appreciated.

    Thanks in advance
     
  2. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    7,394
    1,606
    You could load 0xFF00 into Timer1 in the ISR to get it to roll over after the next 256 instructions... or add a small constant to get that rate lower. However, you may still occasionally jitter 1 extra instruction cycle.

    Timer0 or Timer2 are better for this.
     
    raf23 likes this.
  3. raf23

    Thread Starter New Member

    Aug 2, 2010
    3
    0
    Ohh yes..Thanks ErnieM .. I didnt think of it,...
     
Loading...