General-purpose timers (TIM15/TIM16/TIM17)
RM0365
643/1080
DocID025202 Rev 7
22.4.13 Using the break function
The purpose of the break function is to protect power switches driven by PWM signals
generated with the TIM15/TIM16/TIM17 timers. The break input is usually connected to fault
outputs of power stages and 3-phase inverters. When activated, the break circuitry shuts
down the PWM outputs and forces them to a predefined safe state.
When using the break function, the output enable signals and inactive levels are modified
according to additional control bits (MOE, OSSI and OSSR bits in the TIMx_BDTR register,
OISx and OISxN bits in the TIMx_CR2 register). In any case, the OCx and OCxN outputs
cannot be set both to active level at a given time. Refer to
Table 123: Output control bits for
complementary OCx and OCxN channels with break feature (TIM15) on page 667
for more
details.
The break source can be:
•
An external source connected to BKIN pin (connected internally to BRK)
•
An internal source (connected internally to BRK_ACTH):
–
A clock failure event generated by CSS. For further information on the CSS, refer
to
Section 9.2.7: Clock security system (CSS)
–
An output from a comparator
–
A PVD output
–
SRAM parity error signal
–
Cortex
®
-M4 LOCKUP (Hardfault) output
When exiting from reset, the break circuit is disabled and the MOE bit is low. The break
function is enabled by setting the BKE bit in the TIMx_BDTR register. The break input
polarity can be selected by configuring the BKP bit in the same register. BKE and BKP can
be modified at the same time. When the BKE and BKP bits are written, a delay of 1 APB
clock cycle is applied before the writing is effective. Consequently, it is necessary to wait 1
APB clock period to correctly read back the bit after the write operation.
Because MOE falling edge can be asynchronous, a resynchronization circuit has been
inserted between the actual signal (acting on the outputs) and the synchronous control bit
(accessed in the TIMx_BDTR register). It results in some delays between the asynchronous
and the synchronous signals. In particular, if you write MOE to 1 whereas it was low, you
must insert a delay (dummy instruction) before reading it correctly. This is because you write
the asynchronous signal and read the synchronous signal.
The break is generated by the BRK inputs which has:
•
Programmable polarity (BKP bit in the TIMx_BDTR register)
•
Programmable enable bit (BKE bit in the TIMx_BDTR register)
It is also possible to generate break events by software using BG bit in TIMx_EGR register.