Timer 1

Status
Not open for further replies.
1: 8 prescale every eighth clock
TMR1ON switch on

Once again pipped at the post
 
Last edited:
Ok I'm gonna add that also timer1's clock source is the instruction clock and that timer 1's ext osc is shutoff (the sync bit doesnt matter when the timer is running from the instruction clock, its allways in phase).

I'd rather use the following so that when I look at the datasheet and the code listing I can see directly which bits are set and clear without having to do a load of dexahecimal in my head.

Movlw b'00110001'
Movwf T1con
 
Last edited:
if i am using external clock how should i set my configuration bit for timer1 oscillator enable bit and synchronization selection bit??
 
TMR1CS is the clock source (Bit 1 ) If this bit is set then it will count on the external T1CLK input... T1SYNC is for synchronising with the external clock.

Why don't you download the datasheet and read about ALL it's function and operation.
 
i do not know why when i set TMR1CS=1 my timer cannot run but when i use internal oscillator it can..external clock is crystal??? but crystal is not connected to any of these port(RC0/T1OSO/T13CKI)
 
i do not know why when i set TMR1CS=1 my timer cannot run but when i use internal oscillator it can..external clock is crystal??? but crystal is not connected to any of these port(RC0/T1OSO/T13CKI)

When TMR1CS =1, the timer expects an external clocking source in order for the Timer to count.
If you explained what you are trying to do we could give more helpful answers.
 
Last edited:
You can connect an xtal, namely 32,768kc to timer 1 it has an oscillator within the chip, if thats what your trying to do, you'd need to set the tmr1 osc enable bit.
I think by now you'd better read the data sheet.
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…