Hello members
PIC18F67K40
i try to operate timer1 without gate control.
seams it don't work.(timer0 work perfect).
i use 48mhz internal osc
i don't know what is wrong
Code:
PIE4.0=1 'TMR1 Overflow Interrupt Enable bit
INTCON.6=1 'Peripheral Interrupt Enable bit
TMR1CLK=%00000001 'Timer1 Clock Source Selection Register Fosc/4
'TMR1CLK=%00000011 'Timer1 Clock Source Selection Register HFINTOSC
;TMR1GATE=
T1GCON.7=0 'Timer Gate Enable bit
T1CON=00110100 'Timer1 Prescale 8 , Do not synchronize external clock input & off
;T1CON=00110000 'Timer1 Prescale 8 , Synchronize external clock input with system clock & off
PIR4.0=0 'CLEAR INT TIMER1
'****** TEST TIMER1 *******
T1CON.0=1 'TIMER 1 ON
WAIT2:
IF PIR4.0 THEN 'Timer1 INT
T1CON.0=0 'Timer1 Off
PIR4.0=0 'CLEAR INT
PORTE.5=PORTE.5 ^ 1 'led on/off
TEMP=35536 '20MS /8 48MHZ
TMR1H=TEMP.BYTE1
TMR1L=TEMP.BYTE0
T1CON.0=1 'TIMER 1 ON
ENDIF
GOTO WAIT2
'************************
Bookmarks