From: ian Date: Tue, 20 Dec 2005 18:08:50 +0000 (+0000) Subject: timer2 ticker wip X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ijackson/git?a=commitdiff_plain;h=ee91f3f6792e26b1113c82a6dd1508c76a3a13df;p=trains.git timer2 ticker wip --- diff --git a/detpic/common.inc b/detpic/common.inc index f798a75..d842960 100644 --- a/detpic/common.inc +++ b/detpic/common.inc @@ -74,7 +74,7 @@ clock equ -1 ; ; Master Slave ; Timer 0 nmra Disabled -; Timer 2 (10ms tick, int. low) - +; Timer 2 tick: 10ms, int. low - ; Timer 1 - - ; CCP1 - - ; Timer 3 point fire timer point fire timer diff --git a/detpic/master.asm b/detpic/master.asm index 87711aa..6d5525a 100644 --- a/detpic/master.asm +++ b/detpic/master.asm @@ -37,6 +37,7 @@ master ;---------- master_interrupt_low enter_interrupt_low + call ticker_intrl call nmra_serialrx_intrl ;call serialtx_intrl call points_local_intrl diff --git a/detpic/tick.asm b/detpic/tick.asm index 70a9095..1424ae3 100644 --- a/detpic/tick.asm +++ b/detpic/tick.asm @@ -4,28 +4,35 @@ ; after ticker_init, and after interrupts enabled, ; we call _tick every 10ms. + include common.inc + code + ;---------------------------------------- ticker_init -; Timer 2 not used used for ticker +; Timer 2 any used for ticker + mov_lw tick_timer2scale ; disable (in case already running) + mov_wf T2CON mov_lw tick_timer2period mov_wf PR2 - mov_lw tick_timer2scale | (1<_tick here: + call cdu_tick + ; end of list of calls to _tick - bc_f IPR1, TMR1IP - bc_f IPR1, CCP1IP - bc_f PIR1, TMR1IF - bc_f PIR1, CCP1IF - bs_f PIE1, TMR1IE - bs_f PIE1, CCP1IE + intrl_handled_nostack -T3CCP2 +;---------------------------------------------------------------------- + include final.inc