I have read several posts about Timer1 and TIME. I understand that Timer1 rolls over every 20mS at 4MHz and is used to update TIME every second. So there must be a counter somewhere to count the 50 x 20mS rollovers. Is that counter accessible?
My application is an update of an old project using a 14M2. The latest version offers a choice of 5 day (hourly interval) or 1 day(12 mins interval) display. To achieve that, I have used the TIME variable to make a reading every 12 minutes. Running at 32MHz has improved the display; it redraws much more quickly. However, that means a fairly high current consumption (~ 3mA) even when nothing but timing is happening. Running at 31kHz while not measuring or drawing has reduced current well below 1mA which is good but, if the user changes the display interval then a redraw of the screen is needed and if the processor speed isn't increased, that takes around half an hour at 31kHz!
Currently, timing is achieved by waiting for 80s real time to pass at 32MHz (change of TIME of 160) followed by 640s at 31kHz (change of TIME of 5). The measurement and display are readily completed during the first 80s but I can't readily reduce that while TIME has only 128s resolution at 31kHz. I could avoid waiting 80s and handle the problem of redrawing during the "slow phase": increasing speed, redrawing and timing at mixed speeds, if I can access the Timer1 rollover counter.
I appreciate that the TIME clock is not chronometer accuracy but it's good enough for this application.
Incidentally, does Timer1 keep step with TIME at different frequencies or is it proportional to the SETFREQ speed? Only an issue around 4/8/16/32MHz.
Derek
My application is an update of an old project using a 14M2. The latest version offers a choice of 5 day (hourly interval) or 1 day(12 mins interval) display. To achieve that, I have used the TIME variable to make a reading every 12 minutes. Running at 32MHz has improved the display; it redraws much more quickly. However, that means a fairly high current consumption (~ 3mA) even when nothing but timing is happening. Running at 31kHz while not measuring or drawing has reduced current well below 1mA which is good but, if the user changes the display interval then a redraw of the screen is needed and if the processor speed isn't increased, that takes around half an hour at 31kHz!
Currently, timing is achieved by waiting for 80s real time to pass at 32MHz (change of TIME of 160) followed by 640s at 31kHz (change of TIME of 5). The measurement and display are readily completed during the first 80s but I can't readily reduce that while TIME has only 128s resolution at 31kHz. I could avoid waiting 80s and handle the problem of redrawing during the "slow phase": increasing speed, redrawing and timing at mixed speeds, if I can access the Timer1 rollover counter.
I appreciate that the TIME clock is not chronometer accuracy but it's good enough for this application.
Incidentally, does Timer1 keep step with TIME at different frequencies or is it proportional to the SETFREQ speed? Only an issue around 4/8/16/32MHz.
Derek