st7pmc2s6 STMicroelectronics, st7pmc2s6 Datasheet - Page 112

no-image

st7pmc2s6

Manufacturer Part Number
st7pmc2s6
Description
8-bit Mcu For Automotive With Nested Interrupts, Flash, 10-bit Adc, Brushless Motor Control, 5 Timers, Spi, Linsci?
Manufacturer
STMicroelectronics
Datasheet
On-chip peripherals
Note:
112/371
1
2
3
4
5
The OC
the following formula:
Equation 1
Where:
f
PRESC
If the timer clock is an external clock, the formula is:
Equation 2
Where:
f
Clearing the output compare interrupt request (that is, clearing the OCFi bit) is done by:
1.
2.
The following procedure is recommended to prevent the OCFi bit from being set between
the time it is read and the time it is written to the OC
After a processor write cycle to the OCiHR register, the output compare function is inhibited
until the OCiLR register is also written.
If the OCiE bit is not set, the OCMPi pin is a general I/O port and the OLVLi bit does not
appear when a match is found but an interrupt could be generated if the OCIE bit is set.
In both internal and external clock modes, OCFi and OCMPi are set while the counter value
equals the OCiR register value (see
an example with f
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.
The value in the 16-bit OC
successful comparison in order to control an output waveform or establish a new elapsed
timeout.
CPU
EXT
t =
t =
=
Reading the SR register while the OCFi bit is set.
Accessing (reading or writing) the OCiLR register.
Write to the OCiHR register (further compares are inhibited).
Read the SR register (first step in 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).
=
=
i
R register value required for a specific timing application can be calculated using
output compare period (in seconds)
CPU clock frequency (in hertz)
timer prescaler factor (2, 4 or 8 depending on CC[1:0] bits, see
output compare period (in seconds)
external timer clock frequency (in hertz)
OCiR =
ST7MC1K2-Auto, ST7MC1K6-Auto, ST7MC2S4-Auto, ST7MC2S6-Auto
CPU
t
/4). This behavior is the same in OPM or PWM mode.
*
f
EXT
i
R register and the OLVi bit should be changed after each
Figure 48
OCiR =
for an example with f
PRESC
t
*
f
CPU
i
R register:
CPU
/2 and
Table
Figure 49
51)
for

Related parts for st7pmc2s6