Almost, you'll need to write it in two steps.
TMR1L = TMR1Reload.lowbyte
TMR1H = TMR1Reload.highbyte
I guess that you've already realized that "TMR1Reload" is a plain word sized variable, nothing else.
I also must tell you that if you need extreme accuracy you'll need an assembler interrupt. You will have some latency if you're planning on using "ON INTERRUPT". You may overcome that by adding the "TMR1Reload" to the TMR1. You'll also have to add the time it takes to do that addition, no big deal since that time will be constant. It might be better to add that when calculating the TMR1 reloadvalue, it would save you one addition in the interruptroutine. A portion of the interrupt would(could) look like .....
T1CON.0 = 0 'Stop timer1 while we're messing with it
Dummy.lowbyte = TMR1L
Dummy.highbyte = TMR1H
Dummy = Dummy + TMR1Reload ' + additionlatency if not added before
TMR1L = Dummy.lowbyte
TMR1H = Dummy.highbyte
T1CON.0 = 1 'Start timer1 again
/Ingvar




Bookmarks