
General-Purpose Timers
17-8
Élan™SC520 Microcontroller User’s Manual
In this example, the second value read for GP Timer 2 (14h) is less than the first value
(7997h), and both values read for GP Timer 0 are 0. So this falls under case 1, and the
correct 32-bit value of the cascaded timer is:
32764 ms + (7997h * 121.2 ns) = 32767.8 ms = 32.7678 s
17.5.7.2.5
Example 2
Suppose GP Timer 0 and GP Timer 2 are programmed as in Example 1, but the values
returned from the timers are:
1. GP Timer 2 = 7997h
2. GP Timer 0 = 15h
3. GP Timer 2 = 5h
4. GP Timer 0 = 16h
In this example, the second value read for GP Timer 2 (5h) is less than the first value
(7997h). However, because the first value read for GP Timer 0 (15h) is less than the second
value (16h), case 3 applies and the correct 32-bit value of the cascaded timer is:
15h * 4ms + 7997 * 121.2 ns = 72.772 ms
17.6
INITIALIZATION
At system reset, all the general-purpose timer registers are reset to zero. Each timer must
be programmed before it can be used.
1. Write the maximum compare count value into the GP Timer x Maxcount Compare
(GPTMR0MAXCMPx) registers.
2. Enable the counting with the desired operation and mode in the GP Timer x Mode/Control
(GPTMRxCTL) register.
Содержание Elan SC520
Страница 1: ...lan SC520 Microcontroller User s Manual Order 22004A...
Страница 4: ...iv lan SC520 Microcontroller User s Manual...
Страница 28: ...Introduction xxviii lan SC520 Microcontroller User s Manual...
Страница 42: ...Architectural Overview 1 14 lan SC520 Microcontroller User s Manual...
Страница 78: ...System Initialization 3 22 lan SC520 Microcontroller User s Manual...
Страница 108: ...Clock Generation and Control 5 10 lan SC520 Microcontroller User s Manual...
Страница 118: ...Reset Generation 6 10 lan SC520 Microcontroller User s Manual...
Страница 148: ...System Arbitration 8 24 lan SC520 Microcontroller User s Manual...
Страница 214: ...SDRAM Controller 10 36 lan SC520 Microcontroller User s Manual...
Страница 230: ...Write Buffer and Read Buffer 11 16 lan SC520 Microcontroller User s Manual...
Страница 288: ...GP Bus DMA Controller 14 22 lan SC520 Microcontroller User s Manual...
Страница 316: ...Programmable Interval Timer 16 8 lan SC520 Microcontroller User s Manual...
Страница 328: ...Software Timer 18 4 lan SC520 Microcontroller User s Manual...
Страница 346: ...Real Time Clock 20 12 lan SC520 Microcontroller User s Manual...
Страница 360: ...UART Serial Ports 21 14 lan SC520 Microcontroller User s Manual...
Страница 414: ...AMDebug Technology 26 8 lan SC520 Microcontroller User s Manual...