Auto Page CPX-3600 Specifikace Strana 106

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 243
  • Tabulka s obsahem
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 105
16-bit timer ST72321xx-Auto
106/243 Doc ID 13829 Rev 1
If the timer clock is an external clock, the formula is:
Where:
t = Output compare period (in seconds)
f
CPU
= External timer clock frequency (in hertz)
Clearing the output compare interrupt request (that is, clearing the OCFi bit) is done by:
1. Reading the SR register while the OCFi bit is set
2. An access (read or write) to the OCiLR register
The following procedure is recommended to prevent the OCFi bit from being set between
the time it is read and the write to the OC
iR register:
Write to the OCiHR register (further compares are inhibited).
Read the SR register (first step of the clearance of the OCFi bit, which may be already
set).
Write to the OCiLR register (enables the output compare function and clears the OCFi
bit).
Note: 1 After a processor write cycle to the OCiHR register, the output compare function is inhibited
until the OCiLR register is also written.
2 If the OCiE bit is not set, the OCMPi pin is a general I/O port and the OLVLi bit will not
appear when a match is found but an interrupt could be generated if the OCIE bit is set.
3 In both internal and external clock modes, OCFi and OCMPi are set while the counter value
equals the OCiR register value (see Figure 49 on page 107 for an example with f
CPU
/2 and
Figure 50 on page 107 for an example with f
CPU
/4). This behavior is the same in OPM or
PWM mode.
4 The output compare functions can be used both for generating external events on the
OCMPi pins even if the input capture mode is also used.
5 The value in the 16-bit OC
iR register and the OLVi bit should be changed after each
successful comparison in order to control an output waveform or establish a new elapsed
timeout.
13.3.5 Forced compare output capability
When the FOLVi bit is set by software, the OLVLi bit is copied to the OCMPi pin. The OLVi bit
has to be toggled in order to toggle the OCMPi pin when it is enabled (OCiE bit = 1). The
OCFi bit is then not set by hardware, and thus no interrupt request is generated.
The FOLVLi bits have no effect in both one pulse mode and PWM mode.
OCiR = t
*
f
EXT
Zobrazit stránku 105
1 2 ... 101 102 103 104 105 106 107 108 109 110 111 ... 242 243

Komentáře k této Příručce

Žádné komentáře