Chapter 26 eTimer
MPC5602P Microcontroller Reference Manual, Rev. 4
738
Freescale Semiconductor
frequency. This method of PWM generation has the advantage of allowing almost any desired PWM
frequency and/or constant on or off periods. This mode of operation is often used to drive PWM amplifiers
used to power motors and inverters. The CMPLD1 and CMPLD2 registers are especially useful for this
mode, as they allow the programmer time to calculate values for the next PWM cycle while the PWM
current cycle is underway.
Figure 26-28. Variable PWM waveform
26.7.2.13 Usage of compare registers
The dual compare registers (COMP1 and COMP2) provide a bidirectional modulo count capability.
The COMP1 register should be set to the desired maximum count value or 0xFFFF to indicate the
maximum unsigned value prior to roll-over, and the COMP2 register should be set to the minimum count
value or 0x0000 to indicate the minimum unsigned value prior to roll-under.
When the output mode is set to 0100, the OFLAG will toggle while using alternating compare registers.
In this variable frequency PWM mode, the COMP2 value defines the desired pulse width of the on time,
and the COMP1 register defines the off time. COMP1 is used when OFLAG == 0 and COMP2 is used
when OFLAG == 1.
Use caution when changing COMP1 and COMP2 while the counter is active. If the counter has already
passed the new value, it will count to 0xFFFF or 0x0000, roll over, then begin counting toward the new
value. The check is: CNTR = COMPx,
not
CNTR > COMP1 or CNTR < COMP2.
Using the CMPLD1 and CMPLD2 registers to preload compare values helps to minimize this problem.
26.7.2.14 Usage of Compare Load registers
The CMPLD1, CMPLD2, and CCCTRL registers offer a high degree of flexibility for loading compare
registers with user-defined values on different compare events. To ensure correct functionality while using
these registers, the following methods are recommended.
The purpose of the compare load feature is to allow quicker updating of the compare registers. A compare
register can be updated using interrupts. However, because of the latency between an interrupt event
occurring and the service of that interrupt, there is the possibility that the counter may have already
COMP1
COMP2
PWM Period
Содержание SAFE ASSURE Qorivva MPC5601P
Страница 2: ...MPC5602P Microcontroller Reference Manual Rev 4 2 Freescale Semiconductor ...
Страница 4: ...MPC5602P Microcontroller Reference Manual Rev 4 4 Freescale Semiconductor ...
Страница 62: ...Chapter 2 MPC5602P Memory Map MPC5602P Microcontroller Reference Manual Rev 4 62 Freescale Semiconductor ...
Страница 104: ...Chapter 4 Clock Description MPC5602P Microcontroller Reference Manual Rev 4 104 Freescale Semiconductor ...
Страница 128: ...Chapter 6 Power Control Unit MC_PCU MPC5602P Microcontroller Reference Manual Rev 4 128 Freescale Semiconductor ...
Страница 272: ...Chapter 12 e200z0 and e200z0h Core MPC5602P Microcontroller Reference Manual Rev 4 272 Freescale Semiconductor ...
Страница 280: ...Chapter 14 Crossbar Switch XBAR MPC5602P Microcontroller Reference Manual Rev 4 280 Freescale Semiconductor ...
Страница 306: ...Chapter 16 Internal Static RAM SRAM MPC5602P Microcontroller Reference Manual Rev 4 306 Freescale Semiconductor ...
Страница 380: ...Chapter 17 Flash Memory MPC5602P Microcontroller Reference Manual Rev 4 380 Freescale Semiconductor ...
Страница 532: ...Chapter 21 LIN Controller LINFlex MPC5602P Microcontroller Reference Manual Rev 4 532 Freescale Semiconductor ...
Страница 578: ...Chapter 22 FlexCAN MPC5602P Microcontroller Reference Manual Rev 4 578 Freescale Semiconductor ...
Страница 708: ...Chapter 25 FlexPWM MPC5602P Microcontroller Reference Manual Rev 4 708 Freescale Semiconductor ...
Страница 742: ...Chapter 26 eTimer MPC5602P Microcontroller Reference Manual Rev 4 742 Freescale Semiconductor ...
Страница 760: ...Chapter 27 Functional Safety MPC5602P Microcontroller Reference Manual Rev 4 760 Freescale Semiconductor ...
Страница 782: ...Chapter 28 Fault Collection Unit FCU MPC5602P Microcontroller Reference Manual Rev 4 782 Freescale Semiconductor ...
Страница 788: ...Chapter 29 Wakeup Unit WKPU MPC5602P Microcontroller Reference Manual Rev 4 788 Freescale Semiconductor ...
Страница 798: ...Chapter 30 Periodic Interrupt Timer PIT MPC5602P Microcontroller Reference Manual Rev 4 798 Freescale Semiconductor ...
Страница 816: ...Chapter 32 Cyclic Redundancy Check CRC MPC5602P Microcontroller Reference Manual Rev 4 816 Freescale Semiconductor ...
Страница 848: ...Chapter 33 Boot Assist Module BAM MPC5602P Microcontroller Reference Manual Rev 4 848 Freescale Semiconductor ...
Страница 930: ...Chapter 36 Nexus Development Interface NDI MPC5602P Microcontroller Reference Manual Rev 4 930 Freescale Semiconductor ...