DS785UM1
24-3
Copyright 2007 Cirrus Logic
Pulse Width Modulator
EP93xx User’s Guide
2
4
2
4
24
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
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.
Table 24-2. Dynamic Programming Steps
Step
Register
Value
Program TC value with 659
PWMxTermCnt
0x0293
Program DC value with 131
PWMxDutyCycle
0x0081
Table 24-3. PWM Registers Map
Address
Register
Name
Reset Value
Access
Size
0x8091_0000
PWM0TermCnt
PWM0 Terminal Count
0x0000
R/W
16
0x8091_0004
PWM0DutyCycle
PWM0 Duty Cycle
0x0000
R/W
16
0x8091_0008
PWM0En
PWM0 Enable
0x0000
R/W
16
0x8091_000C
PWM0Invert
PWM0 Invert
0x0000
R/W
16
0x8091_0020
PWM1TermCnt
PWM1 Terminal Count
0x0000
R/W
16
0x8091_0024
PWM1DutyCycle
PWM1 Duty Cycle
0x0000
R/W
16
0x8091_0028
PWM1En
PWM1 Enable
0x0000
R/W
16
0x8091_002C
PWM1Invert
PWM1 Invert
0x0000
R/W
16
Summary of Contents for EP93 Series
Page 28: ...P 6 DS785UM1 Copyright 2007 Cirrus Logic Preface EP93xx User s Guide PP P ...
Page 162: ...5 36 DS785UM1 Copyright 2007 Cirrus Logic System Controller EP93xx User s Guide 55 5 ...
Page 576: ...15 18 DS785UM1 Copyright 2007 Cirrus Logic UART2 EP93xx User s Guide 1515 15 ...
Page 634: ...17 38 DS785UM1 Copyright 2007 Cirrus Logic IrDA EP93xx User s Guide 1717 17 ...
Page 648: ...19 6 DS785UM1 Copyright 2007 Cirrus Logic Watchdog Timer EP93xx User s Guide 1919 19 ...
Page 688: ...21 32 DS785UM1 Copyright 2007 Cirrus Logic I2S Controller EP93xx User s Guide 2121 21 ...
Page 790: ...27 20 DS785UM1 Copyright 2007 Cirrus Logic IDE Interface EP93xx User s Guide 2727 27 ...
Page 808: ...28 18 DS785UM1 Copyright 2007 Cirrus Logic GPIO Interface EP93xx User s Guide 2828 28 ...