st7pmc2s6 STMicroelectronics, st7pmc2s6 Datasheet - Page 111

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
ST7MC1K2-Auto, ST7MC1K6-Auto, ST7MC2S4-Auto, ST7MC2S6-Auto
Output compare
In this section, the index, i, may be 1 or 2 because there are two output compare functions in
the 16-bit timer.
This function can be used to control an output waveform or indicate when a period of time
has elapsed.
When a match is found between the output compare register and the free running counter,
the output compare function:
Two 16-bit registers output compare register 1 (OC1R) and output compare register 2
(OC2R) contain the value to be compared to the counter register each timer clock cycle.
These registers are readable and writable and are not affected by the timer hardware. A
reset event changes the OC
Timing resolution is one count of the free running counter: (
Procedure:
To use the output compare function, select the following in the CR2 register:
In the CR1 register select the following:
When a match is found between OCRi register and CR register:
Assigns pins with a programmable value if the OCIE bit is set
Sets a flag in the status register
Generates an interrupt if enabled
Set the OCiE bit if an output is needed then the OCMPi pin is dedicated to the output
compare i signal.
Select the timer clock (CC[1:0]) (see
Select the OLVLi bit to be applied to the OCMPi pins after the match occurs.
Set the OCIE bit to generate an interrupt if it is needed.
Set the OCFi bit.
The OCMPi pin takes OLVLi bit value (OCMPi pin latch is forced low during reset).
A timer interrupt is generated if the OCIE bit is set in the CR2 register and the I bit is
cleared in the CC register (CC).
OCiR
i
R value to 8000h.
OCiHR
MSB
Table
51).
f
CPU/
CC[1:0]
).
On-chip peripherals
OCiLR
LSB
111/371

Related parts for st7pmc2s6