Samsung S5PC100 User Manual page 585

Table of Contents

Advertisement

PULSE WIDTH MODULATION TIMER
3.4 TIMER OPERATION EXAMPLE
The result of the following procedure is shown in Figure 7.1-5.
1
TOUTn
1. Enable the auto-reload feature. Set the TCNTBn as 159(50+109) and TCMPBn as 109. Set the manual
update bit on and set the manual update bit off. Set the inverter on/ off bit. The manual update bit sets TCNTn
and TCMPn to the value of TCNTBn and TCMPBn.
Set TCNTBn and TCMPBn as 79(40+39) and 39.
2. Start Timer: Set the start bit in TCON
3. If TCNTn and TCMPn has same value, the logic level of TOUTn is changed from low to high
4. As soon as TCNTn reaches to 0, it generates interrupt request.
5. TCNTn and TCMPn are reloaded automatically with TCNTBn and TCMPBn as (79(40+39)) and 39. In the ISR
(Interrupt Service Routine), the TCNTBn and TCMPBn are set as 79(20+59) and 59.
6. If TCNTn and TCMPn has same value, the logic level of TOUTn is changed from low to high
7. As soon as TCNTn reaches to 0, it generates interrupt request.
8. TCNTn and TCMPn are reloaded automatically with TCNTBn,TCMPBn as (79(20+59)) and 59. In the ISR
(Interrupt Service Routine), auto-reload and interrupt request are disabled to stop the timer.
9. If TCNTn and TCMPn has same value, the logic level of TOUTn is changed from low to high
10. Even if TCNTn reaches to 0, No interrupt request is generated.
11. TCNTn is not reloaded and the timer is stopped because auto-reload is disabled.
7.1-8
2
3
50
Figure 7.1-5 Example of a Timer Operation
4
109
40
110
5
S5PC100 USER'S MANUAL (REV1.0)
6
7
9
39
20
59
40
60
8
10
11

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents