Datasheet
Timer Module
14-8 MCF5206e USER’S MANUAL MOTOROLA
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
1
Timer 1
TMR register
Bits 15:8 sets the prescale to 256 ($FF)
Bits 7:6 set for no interrupt ("00")
Bits 5:4 sets output mode for "toggle". No interrupts("10")
Bits 3 set for "restart" ("1")
Bits 2:1 set the clocking source to system clock/16 ("10")
Bit 0 enables/disables the timer ("0")
move.w #$FF2C,D0 ;Setup the Timer mode register (TMR1)
move.w D0,TMR1 ;; Bit 1 is set to 0 to disable the timer
move.w #$0000,D0 ; writing to the timer counter with any value resets it
to zero
move.w D0,TCN1 ;
TRR1 register
The TRR register is set to $AFAF. The timer will count up to this value (TCN = TRR), toggle
the "TOUT" pin, and reset the TCN to $0000.
move.w #$AFAF,D0 ;Setup the Timer reference register (TRR1)
move.w D0,TRR1
Other registers used for TIMER 1
TCR1 ;TIMER1 Capture Register, 16-bit, R
TER1 ;TIMER1 Event Register, 8-bit, R/W
Timer 2
TMR2 register
Bits 15:8 set the prescale to 127 ($7F)
Bits 7:6 set the capture mode and interrupt ("00")
Bits 5:4 set the output mode for "pulse" and no interrupt ("00")
Bits 3 set for free-running ("0")
Bits 2:1 set the clocking source to clk/16 ("10")
Fr
eescale S
emiconduct
or
, I
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
nc...
