24.2.1.3 Dynamic Programming (PWM is Running) Example
Note: Updates will take place at the end of the PWM cycle. Order of programming of the
Terminal Count and Duty Cycle is important. See
24.2.2 Programming Rules
1. Because the user can not tell the state of the PWM between cycles, care must be taken
while programming on the fly (while the PWM is running). To insure proper operation
observe the following rules to preserve the relationship of PWMxDutyCycle to
PWMxTermCnt:
A. If PWMxTermCnt (new) > PWMxTermCnt (current):
Program PWMxTermCnt (new) first then PWMxDutyCycle (new)
B. If PWMxTermCnt (new) < PWMxTermCnt (current):
Program PWMxDutyCycle (new) first then PWMxTermCnt (new)
If the rules "A" and "B" are not followed, a duty cycle of 100% may result until both
PWMxTermCnt and PWMxDutyCycle are updated.
2. Program PWMxTermCnt and PWMxDutyCycle with values that meet the specification.
3. When PWM is stopped (PWM_EN = 0), it does not stop immediately but waits for the
end of the current PWM cycle and then stops.
24.3 Registers
Address
0x8091_0000
0x8091_0004
0x8091_0008
0x8091_000C
0x8091_0020
0x8091_0024
0x8091_0028
0x8091_002C
Note: All pwmout outputs will drive a logical "0" during reset. Coming out of reset, it will continue
to drive a logical "0", and the PWM will be in halt mode.
DS785UM1
Table 24-2. Dynamic Programming Steps
Step
Program TC value with 659
Program DC value with 131
Table 24-3. PWM Registers Map
Register
PWM0TermCnt
PWM0 Terminal Count
PWM0DutyCycle
PWM0 Duty Cycle
PWM0En
PWM0 Enable
PWM0Invert
PWM1TermCnt
PWM1 Terminal Count
PWM1DutyCycle
PWM1 Duty Cycle
PWM1En
PWM1 Enable
PWM1Invert
Copyright 2007 Cirrus Logic
Section 24.2.2 on page 24-3
Register
PWMxTermCnt
PWMxDutyCycle
Name
Reset Value
0x0000
0x0000
0x0000
PWM0 Invert
0x0000
0x0000
0x0000
0x0000
PWM1 Invert
0x0000
Pulse Width Modulator
EP93xx User's Guide
.
Value
0x0293
0x0081
Access
Size
R/W
16
R/W
16
R/W
16
R/W
16
R/W
16
R/W
16
R/W
16
R/W
16
24-3
24
Need help?
Do you have a question about the EP93 Series and is the answer not in the manual?
Questions and answers