mcf5407 Freescale Semiconductor, Inc, mcf5407 Datasheet - Page 337

no-image

mcf5407

Manufacturer Part Number
mcf5407
Description
Mcf5407 Coldfire Integrated Microprocessor User
Manufacturer
Freescale Semiconductor, Inc
Datasheet

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
mcf5407AI162
Manufacturer:
FREESCALE
Quantity:
201
Part Number:
mcf5407AI162
Manufacturer:
FREESCAL
Quantity:
132
Part Number:
mcf5407AI162
Manufacturer:
Freescale Semiconductor
Quantity:
10 000
Part Number:
mcf5407AI162
Manufacturer:
ALTERA
0
Part Number:
mcf5407AI220
Manufacturer:
freescaie
Quantity:
6
Part Number:
mcf5407AI220
Manufacturer:
Freescale Semiconductor
Quantity:
135
Part Number:
mcf5407AI220
Manufacturer:
FREESCALE
Quantity:
1 831
Part Number:
mcf5407AI220
Manufacturer:
Freescale Semiconductor
Quantity:
10 000
Part Number:
mcf5407AI220
Manufacturer:
NXP
Quantity:
25
Part Number:
mcf5407CAI162
Manufacturer:
Freescale Semiconductor
Quantity:
10 000
T0_LOOP
T0_FINISH
13.5 Calculating Time-Out Values
The formula below determines time-out periods for various reference values:
When calculating time-out periods, add 1 to the prescaler to simplify calculating, because
TMRn[PS] = 0x00 yields a prescaler of 1 and TMRn[PS] = 0xFF yields a prescaler of 256.
For example, if a 54-MHz timer clock is divided by 16, TMRn[PS] = 0x7F, and the timer
is referenced at 0xABCD (43,981 decimal), the time-out period is as follows:
The time-out values in Table 13-4 represent the time it takes the counter value in TCNn
value to go from 0x0000 to the default reference value, TRRn[REF] = 0xFFFF. Time-out
values shown for CLKIN are divided by 1 and by 16 (TMRn[CLK] is 01 or 10,
respectively).
Any clock source (CLKIN ÷ 1, CLKIN ÷ 16, or TIN) can be prescaled using TMRn[PS].
TMR[PS]
(Dec)
0
1
2
3
4
5
move.w TMR0,D0;save the contents of TMR0 while setting
bset #0,D0 ;the 0 bit. This enables timer 0 and starts counting
move.w D0, TMR0 ;load the value back into the register, setting TMR0[RST]
move.b TER0,D1 ;load TER0 and see if
btst #1,D1 ;TER0[REF] has been set
beq T0_LOOP
addi.l #1,D2;Increment D2
cmp.l #5,D2;Did D2 reach 5? (i.e. timer ref has timed)
beq T0_FINISH;If so, end timer0 example. Otherwise jump back.
move.b #0x02,D0 ;writing one to TER0[REF] clears the event flag
move.b D0,TER0
jmp T0_LOOP
HALT;End processing. Example is finished
Time-out period = (1/clock frequency) x (1 or 16) x (TMRn[PS] + 1) x
(TRRn[REF])
Time-out period = (1/54,000,000) x (16) x (127 + 1) x (43,981) = 1.67 S
0.019 0.026 0.032 0.001 0.002 0.002
0.039 0.052 0.065 0.002 0.003 0.004
0.058 0.078 0.097 0.004 0.005 0.006
0.078 0.104 0.129 0.005 0.006 0.008
0.097 0.129 0.162 0.006 0.008 0.010
0.117 0.155 0.194 0.007 0.010 0.012
54
Table 13-4. Time-Out Values (in Seconds)—TRR[REF] = 0xFFFF
CLK = 10 (÷ 1)
40.5
CLKIN (MHz)
32.4
54
CLK = 01 (÷ 16)
(162-MHz Processor Clock)
Chapter 13. Timer Module
40.5
32.4
TMR[PS]
(Dec)
128
129
130
131
132
133
2.505 3.340 4.175 0.157 0.209 0.261
2.524 3.366 4.207 0.158 0.210 0.263
2.544 3.392 4.240 0.159 0.212 0.265
2.563 3.418 4.272 0.160 0.214 0.267
2.583 3.443 4.304 0.161 0.215 0.269
2.602 3.469 4.337 0.163 0.217 0.271
54
CLK = 10 (÷ 1)
40.5
Calculating Time-Out Values
CLKIN (MHz)
32.4
54
CLK = 01 (÷ 16)
40.5
32.4
13-7

Related parts for mcf5407