![NXP Semiconductors QN902 Series Скачать руководство пользователя страница 66](http://html1.mh-extra.com/html/nxp-semiconductors/qn902-series/qn902-series_user-manual_1722213066.webp)
NXP Semiconductors
QN902x
User Manual of QN902x
UM10996
All information provided in this document is subject to legal disclaimers.
© NXP Semiconductors N.V. 2018. All rights reserved.
User Manual
Rev 1.3
— 05 November 2018
66 of 128
8.
PWM
The PWM provides two
independent
channel PWM waveforms with programmable
period and duty cycle. Each channel includes 8-bit auto-reload down counter.
8.1
Features
Two independent PWM channels
Each channel has 8-bit down counter and 10-bit prescaler
Programmable period and duty cycle
Predictable PWM initial output state
Overflow interrupt generation
Buffered compare and polarity register to ensure correct output
8.2
Functional Description
The block diagram of PWM is shown in
Figure 8 PWM Block Diagram
Two independent but identical PWM channels are available with separate control
registers. There are two 10-bit prescaler values that are contained in the PSCL register.
The 10-bit prescaler divides the APB Clock to generate the scaled clock for the 8-bit
down counter. The frequency of scaled clock is calculated as follows:
(
1)
clk
scled
f
f
pscl
The period of the PWM waveform is determined by the PERIOD register. The down
counter is automatically reloaded with (PERIOD-1) once it is down to zero. An interrupt
can be generated simultaneously.
The edge of the PWM waveform is determined by the CMP register. When the counter
is larger or equal to CMP, it outputs high level, otherwise, it outputs low level. The
polarity can be changed by register POL. When POL is set to 1, the output will be high
when the counter is smaller than CMP.