|
ST9 Datasheet, PDF (83/146 Pages) STMicroelectronics – USER GUIDE | |||
|
◁ |
ST9 USER GUIDE
that are symmetrically centred on half of the reload value. For example, if the reload value is
255, the compare registers are set to the following values:
Duty Cycle
10%
25%
50%
75%
90%
Compare Register 0
115
96
64
32
13
Compare Register 1
140
159
191
223
242
You need to ensure that the compare registers are not written while they are used for a com-
parison. Because of this, they are written in an interrupt service routine that is triggered by the
MFT itself. To allow maximum latency time, the interrupt is triggered either by a compare 0 or
a compare 1 event, according to the value of the duty cycle. For duty cycles between 0 and
50%, the compare 0 event is used. Between 50% and 100%, the compare 1 event is used.
The following figures shows the timing diagram.
Figure 44. Output A Timing
Reload
Value
Compare
Register 1
Value
Compare
Register 0
Value
Output A
Reload
Interrupt
83/146
|
▷ |