bananasiong
New Member
Hi,
I've been using timer 2 interrupt, happy with the results. Now I want to use timer 1 interrupt. I'm using external oscillator, 32768 Hz crystal at RB7 and RB6.
Do I need to preset the value of TMR1L ad TMR1H in the beginning and after the interrupt (timer 1 overflow)?
For other instructions, I use the internal 4 MHz oscillator of the PIC. So these are my configuration of T1CON register:
prescale 1:8
oscillator enabled
external clock from RB6 and RB7
do not synchronize external clock input
timer 1 enabled
32768/4=8192, prescale 1:8, so 1024 Hz which is 1 ms. So tmr1 needs to overflow when count to 1024 to get 1 second interrupt rate, am I right? Then I just set bit 15:10 of tmr1 after each interrupt?
BTW, I'm using PIC16F628A
Thanks
I've been using timer 2 interrupt, happy with the results. Now I want to use timer 1 interrupt. I'm using external oscillator, 32768 Hz crystal at RB7 and RB6.
Do I need to preset the value of TMR1L ad TMR1H in the beginning and after the interrupt (timer 1 overflow)?
For other instructions, I use the internal 4 MHz oscillator of the PIC. So these are my configuration of T1CON register:
prescale 1:8
oscillator enabled
external clock from RB6 and RB7
do not synchronize external clock input
timer 1 enabled
32768/4=8192, prescale 1:8, so 1024 Hz which is 1 ms. So tmr1 needs to overflow when count to 1024 to get 1 second interrupt rate, am I right? Then I just set bit 15:10 of tmr1 after each interrupt?
BTW, I'm using PIC16F628A
Thanks