PDA

View Full Version : TMR1H and TMR1L into a word variable



xnihilo
- 29th October 2008, 17:32
Let's say I want to check the value of the TMR1 in a loop in which I'm polling the state of a pin to create some Timeout check.

I read in the datasheet that TMR1L is at address $0E and TMR1H is at $0f..
I guess I can create a WORD variable after making an alias to TMR1L and check the value of the word variable.

Something like:

tmr1value VAR WORD
tmr1value.lowbyte = TMR1L

then read tmr1value

Is this right?

mister_e
- 29th October 2008, 17:38
Better to use this

@TMR1Word = TMR1L
TMR1Word VAR WORD EXT

http://www.picbasic.co.uk/forum/showthread.php?t=3891

xnihilo
- 31st October 2008, 07:08
Excellent. Thank you, I will try that.