PSMC Designer User’s Guide 2012-2013 Microchip Technology Inc.
Note the following details of the code protection feature on Microchip devices: • Microchip products meet the specification contained in their particular Microchip Data Sheet. • Microchip believes that its family of products is one of the most secure families of its kind on the market today, when used in the intended manner and under normal conditions. • There are dishonest and possibly illegal methods used to breach the code protection feature.
PSMC DESIGNER USER’S GUIDE Table of Contents Chapter 1. PSMC Designer Overview 1.1 Introduction ..................................................................................................... 9 Chapter 2. Main PSMC Configuration GUI 2.1 Introduction ................................................................................................... 11 2.2 Function Selection ........................................................................................ 12 2.3 Device Selection ...............
PSMC Designer User’s Guide 2.17 Falling Event ............................................................................................... 20 2.17.1 Synchronous Selection ............................................................................20 2.17.2 Asynchronous Selection ..........................................................................21 2.17.3 Asynchronous Polarity (not available on PIC16(L)F1782/3) ....................21 2.17.4 Interrupt ...............................................
PSMC DESIGNER USER’S GUIDE Preface NOTICE TO CUSTOMERS All documentation becomes dated, and this manual is no exception. Microchip tools and documentation are constantly evolving to meet customer needs, so some actual dialogs and/or tool descriptions may differ from those in this document. Please refer to our web site (www.microchip.com) to obtain the latest documentation available. Documents are identified with a “DS” number. This number is located on the bottom of each page, in front of the page number.
PSMC Designer User’s Guide CONVENTIONS USED IN THIS GUIDE This manual uses the following documentation conventions: DOCUMENTATION CONVENTIONS Description Arial font: Italic characters Initial caps Quotes Underlined, italic text with right angle bracket Bold characters N‘Rnnnn Text in angle brackets < > Courier New font: Plain Courier New Represents Examples Referenced books Emphasized text A window A dialog A menu selection A field name in a window or dialog A menu path MPLAB IDE User’s Guide ...
Preface THE MICROCHIP WEB SITE Microchip provides online support via our web site at www.microchip.com. This web site is used as a means to make files and information easily available to customers.
PSMC Designer User’s Guide NOTES: DS40001671B-page 8 2012-2013 Microchip Technology Inc.
PSMC DESIGNER USER’S GUIDE Chapter 1. PSMC Designer Overview 1.1 INTRODUCTION The PSMC peripheral is a sophisticated programmable switch mode controller intended to operate power conversion applications with little or no software intervention. The peripheral capabilities range from simple, single channel PWM generation to multi-channel complementary waveforms with dead bands between transitions.
PSMC Designer User’s Guide Although a brief description of each function is included at the beginning of each function section, please refer to the device data sheet for a more detailed description of the PSMC operation. The sections of this guide are arranged in the same order of progression that a user would follow when creating a PSMC configuration. DS40001671B-page 10 2012-2013 Microchip Technology Inc.
PSMC DESIGNER USER’S GUIDE Chapter 2. Main PSMC Configuration GUI 2.1 INTRODUCTION Figure 2-1 shows the main PSMC Designer user interface, referred to hereafter as the main GUI. Here you will see the eleven major functions of the PSMC: 1. Clock 2. Timer 3. Blanking 4. Period Event 5. Rising Event 6. Falling Event 7. Modulation 8. PSMC Modes 9. Output Control 10. Auto-Shutdown 11. Sync Output Control (not available on the PIC16(L)F1782/3) The main GUI also contains the following: 1.
PSMC Designer User’s Guide 2.2 FUNCTION SELECTION As you move your cursor around the display, you will notice that the cursor shape changes to a hand whenever it is within the bounds of one of the function blocks. Clicking on the mouse when the cursor is a hand will open a control GUI for the function to which the hand is pointing. When you are finished configuring that block you can either close the associated GUI or leave it open. All functions remain active whether or not they are visible. 2.
Main PSMC Configuration GUI 2.8 COPY AND SHOW BUTTON The Copy and Show button does two things: It shows all SFR values in the PSMC instance configuration, and it copies those values to the clipboard. The clipboard format is consistent with the type selected by the Code Type radio buttons. C and Assembly are the two options. The clipboard capture can be pasted into your source code, however, code for only the presently selected PSMC instance is in the clipboard.
PSMC Designer User’s Guide 2.11.3 Load Code Selecting the Load Code menu option retrieves the SFR information from the file and sets the device selection and all PSMC instance configurations contained in the code file. The load algorithm automatically recognizes whether the code was saved as C or assembly and reads it accordingly. 2.12 CLOCK The clock control determines the rate at which the synchronous event timer, blanking timers, and dead-band timers all increment.
Main PSMC Configuration GUI FIGURE 2-3: 2.13.1 TIMER CONTROL Sync Source PSMCs in the device can be synchronized to a master PSMC by routing the sync_out signal from the master as one of the timer Reset inputs. The sync source selection determines the Reset source and thereby also determines which PSMC is the master. The number of selections varies by the number of PSMC instances in the device. 2.13.
PSMC Designer User’s Guide FIGURE 2-4: BLANKING CONTROL All asynchronous inputs pass through blanking. Rising and falling events are used as the blanking triggers because these are the two events that signal the output power drivers to turn on and off. When a power driver switches it can cause spurious transients in the system that can cause false event triggers if not suppressed.
Main PSMC Configuration GUI 2.14.3 Falling Event Trigger Click on the switch at the blanking time output to enable or disable the falling event blanking trigger. Asynchronous inputs are selected for falling event blanking individually by closing the switch to the AND gate output in their path. 2.14.4 Asynchronous Input Pin Polarity One of the asynchronous inputs comes directly from an I/O pin. For example, RB0 is that input in Figure 2-4.
PSMC Designer User’s Guide The synchronous period event frequency is determined by the time or frequency entered in the Period Time/Period Freq text box. The Radio button below the box selects time or frequency as the display. When a value is entered the period count value is calculated based on the psmc_clk frequency. If the display mode is changed then the value changes to correspond with the existing count.
Main PSMC Configuration GUI FIGURE 2-6: 2.16.1 RISING EVENT CONTROL Synchronous Selection Synchronous rising event selection is made by clicking on the X leading to the upper input to the output OR gate. When clicked, the X is replaced by a straight line leading from the rising event time selection box to the output OR gate. Synchronous rising events can be deselected by clicking on the input line to the OR gate to change it back to a line terminated with an X.
PSMC Designer User’s Guide 2.16.3 Interrupt The synchronous rising event can be selected as a timed interrupt source by clicking on the switch image leading to the line labeled as interrupt. Closing this switch connects the synchronous rising event out to the PMSC timed interrupt summary bit in the device PIRx register. Enabling the synchronous rising event interrupt also requires checking the timed event interrupt enable box on the main window. 2.
Main PSMC Configuration GUI Entering the value as percent determines the active pulse width as a percentage of the period. The active pulse width is the time from when the PWM output goes active (rising event) to the time the PWM output is terminated (falling event). When the percent value is entered then the falling event count is calculated based on the existing period count and rising event values. Unlike the time value, the percent value remains constant when the psmc_clk or period values are changed.
PSMC Designer User’s Guide FIGURE 2-8: 2.18.1 MODULATION CONTROL Modulation Source Selection The modulation source is selected from one of the external asynchronous PSMC inputs or peripheral outputs internal to the device. Modulation sources are mutually exclusive. The selection is made by choosing the desired source from those available in the Modulation Source combination box. Note that when modulation is enabled and the modulation source is low, then the Timer is held in Reset.
Main PSMC Configuration GUI 2.19.1 Dead-Band Control Each of the six complementary modes contains two dead-band control blocks. One control delays the turn-on of the normal PWM output(s) and the other control delays the turn-on of the complementary PWM output(s). Dead-band control does not delay the turn-off of either normal or complementary outputs. 2.19.1.1 WHAT IS DEAD BAND? Complementary outputs are generally used to drive power devices connected in series between the power rails.
PSMC Designer User’s Guide FIGURE 2-10: 2.19.3 SINGLE PWM MODE SPWMC: Single PWM Mode with Complementary Outputs The Single PWM Complementary mode is selected by clicking on the SPWMC tab, as shown in Figure 2-11. This is identical to Single PWM mode, except the output channels are divided into two groups of three. One group has the PWM signal and the other group has the complement of the PWM signal. Click on either dead-band block to open the dead-band control. See Section 2.19.
Main PSMC Configuration GUI 2.19.4 PP: Push-Pull Mode The Push-Pull mode is selected by clicking on the PP tab as shown in Figure 2-12. The Push-pull mode is similar to the PWM mode, except that the PWM output alternates between Channel A and Channel B every PWM period. FIGURE 2-12: 2.19.5 PUSH-PULL MODE PPC: Push-Pull with Complementary Output Push-Pull Complementary mode is selected by clicking on the PPC tab, as shown in Figure 2-13.
PSMC Designer User’s Guide FIGURE 2-13: 2.19.6 PUSH-PULL COMPLEMENTARY MODE FBPP: Full-Bridge Push-Pull Full-Bridge Push-Pull mode is selected by clicking on the FBPP tab, as shown in Figure 2-14. Full-Bridge Push-Pull mode is identical to Push-Pull mode, except that there are four channels, two of which are active at a time with the same waveform. Channels A and C alternate with Channels B and D every period event.
Main PSMC Configuration GUI 2.19.7 FBPPC: Full-Bridge Push-Pull with Complementary Mode Outputs Full-Bridge Push-Pull Complementary mode is selected by clicking on the FBPPC tab as shown in Figure 2-15. This mode is identical to full-bridge push-pull with the addition of two complementary outputs on Channel E and Channel F. Channel E is the complement of Channels A and C. Channel F is the complement of Channels B and D. Click on either dead-band block to open the dead-band control. See Section 2.19.
PSMC Designer User’s Guide FIGURE 2-16: 2.19.9 PULSE-SKIPPING MODE PSC: Pulse-Skipping with Complementary Output Pulse-skipping with complementary output is selected by clicking on the PSC tab as shown in Figure 2-17. Pulse-skipping with complementary output is identical to Pulse-Skipping mode with the complement of the PWM output to Channel B. Click on either dead-band block to open the dead-band control. See Section 2.19.1 “Dead-Band Control” for more information.
Main PSMC Configuration GUI 2.19.10 ECCPR: ECC PWM Full-Bridge Mode, Reverse Direction ECC compatible PWM mode, reverse direction, is selected by clicking on the ECCPR tab as shown in Figure 2-18. This is a full-bridge driver with two of four outputs, Channels A and D, active. The Channel A output is the PWM drive and the Channel D output is true without Pulse-Width Modulation. This mode is intended to drive the high side and low side of opposite sides of an H-bridge power device configuration.
PSMC Designer User’s Guide 2.19.11 ECCPF: ECC PWM Full-Bridge Mode, Forward Direction ECC compatible PWM mode, forward direction, is selected by clicking on the ECCPF tab as shown in Figure 2-19. This mode is a full-bridge driver with two of four outputs, Channels B and C, active. The Channel B output is the PWM drive and the Channel C output is true without Pulse-Width Modulation. This mode is intended to drive the high side and low side of opposite sides of an H-bridge power device configuration.
Main PSMC Configuration GUI FIGURE 2-20: FIXED DUTY CYCLE 2.19.13 Fine Frequency Adjust After the course frequency is determined with the clock and period controls, the frequency is fine tuned with the Fine Frequency Adjust control. Click on the FFA box to open the fine frequency adjust control shown in Figure 2-21. The combination box in the center of the fixed frequency adjust control shows 16 possible selections based on the psmc_clk frequency and period count.
PSMC Designer User’s Guide FIGURE 2-22: FIXED DUTY CYCLE COMPLEMENTARY OUTPUT 2.19.15 3PH: 3-Phase PWM 3-Phase PWM mode is selected by clicking on the 3PH tab as shown in Figure 2-23. 3-Phase PWM is a special mode that generates the waveform for 6-step 3-phase systems such as those for driving brushless DC motors. These systems have three half bridges requiring two drive outputs each for a total of six channels.
Main PSMC Configuration GUI FIGURE 2-23: 2.20 3-PHASE PWM OUTPUT CONTROL Channels are directed to the output pins through the output control. Open the output control GUI shown in Figure 2-24 by clicking on the output control block in the main GUI. There are four selections for each channel in this control: 1. 2. 3. 4.
PSMC Designer User’s Guide FIGURE 2-24: 2.20.1 OUTPUT CONTROL Output Enable The output enable switch selects between the PORT latch output and the PSMC channel. When the PORT latch output is selected, then the output pin is not affected by the PSMC. When the PSMC channel is selected, then the pin is not affected by the PORT latch. 2.20.2 Output Steering Two modes, SPWM and SPWMC, include steering. Steering gives the ability to steer the PWM output to one or more of the six outputs.
Main PSMC Configuration GUI 2.20.4 Output Polarity The output polarity control determines the active-true level of the channel output. The active time starts at the rising event and ends at the falling event. Polarity is selected by clicking on the output of the channel buffer. The output will appear as a bubble for active-low polarity and as a line for active-high polarity. 2.20.5 Shutdown Level Shutdown level is the level forced on the output when a shutdown condition is active.
PSMC Designer User’s Guide FIGURE 2-25: 2.22 AUTO-SHUTDOWN SYNC OUTPUT CONTROL (NOT AVAILABLE ON THE PIC16(L)F1782/3) Slaves select the sync source as shown in Section 2.13 “Timer”. The sync output of PIC16(L)F1783/3 devices is fixed to the period event output. All other devices can select either the period event or rising event as the sync output. The sync output control, shown in Figure 2-26, is opened by clicking on the sync block of the main GUI.
PSMC DESIGNER USER’S GUIDE Chapter 3. PSMC Tips The following sections provide useful tips for getting the most out of the PSMC peripheral. 3.1 VARIABLE PERIOD WITH FIXED OFF-TIME Some power supply designs use a fixed off-time and then vary the duty cycle by asynchronous feedback to terminate drive time and also start a new period.
PSMC Designer User’s Guide FIGURE 3-2: FIXED OFF-TIME WITH FALLING EVENT DELAY This method inverts the output so that the synchronous duty cycle becomes the off-time, and the off-time after the duty cycle end becomes the on-time. Use auto-shutdown to start and stop the application. 3.2 3-PHASE VARIABLE DUTY CYCLE 3-Phase applications such as power supplies, AC induction motors, and tri-color LED lighting, require three PWMs with a fixed-phase offset from each other.
PSMC Tips - Click on the Mode Control function: Click on the tab to set the desired PWM mode - Click on the Output Control function: Connect the steering (if needed), channel polarity, and desired outputs to pins - Check the PSMC enable box - Write in the comments section notes about Phase 1 of this 3-phase setup - Copy this setup using the Copy and Show button Select PSMC2 - Paste the configuration copied from PSMC1 by clicking on the Paste button Click on the Timer function: Change the sync source to PSM
PSMC Designer User’s Guide FIGURE 3-3: DS40001671B-page 40 CENTER WEIGHTED PWM 2012-2013 Microchip Technology Inc.
PSMC Designer User’s Guide NOTES: 2012-2013 Microchip Technology Inc.
Worldwide Sales and Service AMERICAS ASIA/PACIFIC ASIA/PACIFIC EUROPE Corporate Office 2355 West Chandler Blvd. Chandler, AZ 85224-6199 Tel: 480-792-7200 Fax: 480-792-7277 Technical Support: http://www.microchip.com/ support Web Address: www.microchip.