NuMicro® NUC029LEE/NUC029SEE
32-bit Arm
®
Cortex
®
-M0 Microcontroller
Aug, 2018
Page
272
of
497
Rev 1.00
N
U
MICRO
®
N
UC02
9L
E
E
/N
UC029
S
E
E
T
E
CHN
ICA
L R
E
F
E
R
E
NC
E
M
A
NU
A
L
PWM Counter Register 3-0 (CNR3-0)
Register
Offset
R/W
Description
Reset Value
CNR0
0x0C
0x0C
R/W
PWM Counter Register 0
0x0000_0000
CNR1
0x18
0x18
R/W
PWM Counter Register 1
0x0000_0000
CNR2
0x24
R/W
PWM Counter Register 2
0x0000_0000
CNR3
0x30
R/W
PWM Counter Register 3
0x0000_0000
31
30
29
28
27
26
25
24
Reserved
23
22
21
20
19
18
17
16
Reserved
15
14
13
12
11
10
9
8
CNRx
7
6
5
4
3
2
1
0
CNRx
Bits
Description
[31:16]
Reserved
Reserved.
[15:0]
CNRx
PWM Timer Loaded Value
CNR determines the PWM period.
PWM frequency = PWMxy_CLK/[(p1)*(clock divider)*(CNR+1)]; where xy, could
be 01, 23 or 45, depends on selected PWM channel.
For Edge-aligned type:
Duty ratio = (CMR+1)/(CNR+1).
CMR >= CNR: PWM output is always high.
CMR < CNR: PWM low width = (CNR-CMR) unit; PWM high width = (CMR+1) unit.
CMR = 0: PWM low width = (CNR) unit; PWM high width = 1 unit.
For Center-aligned type:
Duty ratio = [(2 x CMR) + 1]/[2 x (CNR+1)].
CMR > CNR: PWM output is always high.
CMR <= CNR: PWM low width = 2 x (CNR-CMR) + 1 unit; PWM high width = (2 x
CMR) + 1 unit.
CMR = 0: PWM low width = 2 x CNR + 1 unit; PWM high width = 1 unit.
(Unit = one PWM clock cycle).
Note:
Any write to CNR will take effect in next PWM cycle.
Note:
When PWM operating at Center-aligned type, CNR value should be set between
0x0000 to 0xFFFE. If CNR equal to 0xFFFF, the PWM will work unpredictable.
Note:
When CNR value is set to 0, PWM output is always high.