From: ian Date: Tue, 20 Dec 2005 16:14:12 +0000 (+0000) Subject: ticks wip X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ijackson/git?a=commitdiff_plain;h=80f50aceb23db9bc8f18fb5e5884da5c0b827d4c;p=trains.git ticks wip --- diff --git a/detpic/common.inc b/detpic/common.inc index 5deed75..0225e8d 100644 --- a/detpic/common.inc +++ b/detpic/common.inc @@ -74,9 +74,9 @@ clock equ -1 ; ; Master Slave ; Timer 0 nmra Disabled -; Timer 2 - - -; Timer 1 (1ms tick, int. low) (1ms tick, int. low) -; CCP1 (1ms tick, int. low) (1ms tick, int. low) +; Timer 2 (10ms tick, int. low) (10ms tick, int. low) +; Timer 1 - - +; CCP1 - - ; Timer 3 point fire timer point fire timer ; ECCP - - ; diff --git a/detpic/program.clocks b/detpic/program.clocks index 8c481c6..1b49874 100644 --- a/detpic/program.clocks +++ b/detpic/program.clocks @@ -11,3 +11,4 @@ #morse MS T0ov16 66ms points M T3ov 20ms points S T3ov 10ms +tick MS T2period 10ms diff --git a/detpic/tick.asm b/detpic/tick.asm new file mode 100644 index 0000000..70a9095 --- /dev/null +++ b/detpic/tick.asm @@ -0,0 +1,31 @@ +;====================================================================== +; TICKER - regular 10ms timer interrupt +; +; after ticker_init, and after interrupts enabled, +; we call _tick every 10ms. + +;---------------------------------------- +ticker_init +; Timer 2 not used used for ticker + mov_lw tick_timer2period + mov_wf PR2 + mov_lw tick_timer2scale | (1<