From 80f50aceb23db9bc8f18fb5e5884da5c0b827d4c Mon Sep 17 00:00:00 2001 From: ian Date: Tue, 20 Dec 2005 16:14:12 +0000 Subject: [PATCH] ticks wip --- detpic/common.inc | 6 +++--- detpic/program.clocks | 1 + detpic/tick.asm | 31 +++++++++++++++++++++++++++++++ 3 files changed, 35 insertions(+), 3 deletions(-) create mode 100644 detpic/tick.asm 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<