Hi,
It's easy but I'm afraid it's not THAT easy - there is no TMR1 register (hence the error). Instead TMR1 consists of TWO 8bit regsiters, TMR1L and TMR1H.
The straight forward way to write it is to doAnd the straight forward way to read it isCode:TMR1L = 0 TMR1H = 0When reading TMR1 this way there's a slight posibillity that TMR1L overflows right in between reading TMR1H and TMR1L giving you a wrong result. To prevent that the easiest way is to simply STOP the timer before reading it. If that's not possible there are other ways to cater for that - and there are tricks that allows you to read it in one go if needed but lets keep it as simple as possible for now.Code:myVar VAR WORD myVAR.HighByte = TMR1H myVAR.LowByte = TMR1L
/Henrik.




Bookmarks