I must be missing something here, TMR1H:TMR1L is not incrementing in external clock mode from a square wave on RC0 (pin 11).
I'm using MPLAB XC8 C compiler. Here is how I have it initialized:
TRISCbits.TRISC0 = 1; //make RC0 an input
T1CON = 0x07; //1:1 prescaler, not synchronized, 16 bit R/W, enable timer
T1GCON = 0x00; //always counting, gate active high, gate toggle disabled, gate pulse mode disabled
TMR1CLK = 0x00; //set RC0 as the clock input
TMR1GATE = 0x00; //timer gate source, (timer gate is disabled)
TMR1H = 0x00; //clear timer
TMR1L = 0x00; //cleat timer
If I change TMR1CLK to 0x01 (Fosc/4), the timer counts fine. BTW, I'm using a breadboard with a PICkit 4.
Any help will be appreciated.
Bob D.
I'm using MPLAB XC8 C compiler. Here is how I have it initialized:
TRISCbits.TRISC0 = 1; //make RC0 an input
T1CON = 0x07; //1:1 prescaler, not synchronized, 16 bit R/W, enable timer
T1GCON = 0x00; //always counting, gate active high, gate toggle disabled, gate pulse mode disabled
TMR1CLK = 0x00; //set RC0 as the clock input
TMR1GATE = 0x00; //timer gate source, (timer gate is disabled)
TMR1H = 0x00; //clear timer
TMR1L = 0x00; //cleat timer
If I change TMR1CLK to 0x01 (Fosc/4), the timer counts fine. BTW, I'm using a breadboard with a PICkit 4.
Any help will be appreciated.
Bob D.