5PWM
18
Copyright © 2018, www.
bluetrum.com. All Rights Reserved
18
5
PWM
5.1
Features
Four channel PWM for Breathing-lamp
5.2
Special Function Registers
Register 5-1 PWMCON: PMW Configure Register
Bit
Name
Mode
Default
Description
31:5
5
PWMIVN
WR
0
PWM invert enable
0: duty is high level 1: duty is low level
4
AUTOADJUST
WR
0
PWM Auto Adjust enable
0: disable 1: enable
3
PWM3EN
WR
0
PWM3 enable
0: disable 1: enable
2
PWM2EN
WR
0
PWM2 enable
0: disable 1: enable
1
PWM1EN
WR
0
PWM1 enable
0: disable 1: enable
0
PWM0EN
WR
0
PWM0 enable
0: disable 1: enable
Register 5-2 PWMPR: PMW period Register
Bit
Name
Mode
Default
Description
31:16
15:0
PWMPR
WR
0xffff
PWM period = (PWMPR+1) * Tpwmclk
Register 5-3 PWM01DUT: PWM0/1 duty registers
Bit
Name
Mode
Default
Description
31:16
PWM1DUT
WR
0x0
PWM1 duty register ; Duty = PWM1DUT/ PWMPR
15:0
PWM0DUT
WR
0x0
PWM0 duty register ; Duty = PWM0DUT/ PWMPR
Register 5-4 PWM23DUT: PWM2/3 duty registers
Bit
Name
Mode
Default
Description
31:16
PWM3DUT
WR
0x0
PWM3 duty register ; Duty = PWM3DUT/ PWMPR
15:0
PWM2DUT
WR
0x0
PWM2 duty register ; Duty = PWM2DUT/ PWMPR
Register 5-5 PWMCYCNUM: PWM adjust cycle number register
Bit
Name
Mode
Default
Description
31:24
PWM3CYCNUM
WR
0x0
PWM3 Duty adjust cycle num
When AUTOADJUST = 1, each PWM3CYCNUM Duty add
(PWM3STEP/ PWMPR)
23:16
PWM2CYCNUM
WR
0x0
PWM2 Duty adjust cycle num
When AUTOADJUST = 1, each PWM2CYCNUM Duty add
(PWM2STEP/ PWMPR)
15:8
PWM1CYCNUM
WR
0x0
PWM1 Duty adjust cycle num
When AUTOADJUST = 1, each PWM1CYCNUM Duty add
(PWM1STEP/ PWMPR)
7:0
PWM0CYCNUM
WR
0x0
PWM0 Duty adjust cycle num
When AUTOADJUST = 1, each PWM0CYCNUM Duty add