3 ; Copyright (C) 2010 Leo C.
5 ; This file is part of avrcpm.
7 ; avrcpm is free software: you can redistribute it and/or modify it
8 ; under the terms of the GNU General Public License as published by
9 ; the Free Software Foundation, either version 3 of the License, or
10 ; (at your option) any later version.
12 ; avrcpm is distributed in the hope that it will be useful,
13 ; but WITHOUT ANY WARRANTY; without even the implied warranty of
14 ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 ; GNU General Public License for more details.
17 ; You should have received a copy of the GNU General Public License
18 ; along with avrcpm. If not, see <http://www.gnu.org/licenses/>.
34 ; don't change order here, clock put/get depends on it.
35 cntms_out: ; register for ms
37 utime_io: ; register for uptime.
44 .equ timer_size = timer_top - timer_base
46 .equ clkofs = cnt_1ms-cntms_out
47 .equ timerofs = cnt_1ms-timer_ms
51 ; ------------- system timer 1ms ---------------
54 ; Timer/Counter1 Compare Match B interrupt
68 #if DRAM_8BIT /* Implies software uart */
94 ldi zl,high(1000) ;doesn't change flags
124 ; ----------------------------------------------
131 sts delay_timer1,temp
133 lds temp,delay_timer1
138 ; ----------------------------------------------
143 subi temp2,TIMER_MSECS
144 brcs clkget_end ;Port number in range?
146 breq clkget_copy ;lowest byte requestet, latch clock
148 brsh clkget_end ;Port number to high?
174 brcs clkput_end ;Port number in range?
179 cpi temp,starttimercmd
181 cpi temp,quitTimerCmd
183 cpi temp,printTimerCmd
198 breq clkput_copy ;lowest byte requestet, latch clock
200 brsh clkput_end ;Port number to high?
245 ; put ms on stack (16 bit)
280 printstring "Timer running. Elapsed: "
312 printstring "Uptime: "
326 ; vim:set ts=8 noet nowrap