Microchip Technology PSMC Designer User guide

PSMC Designer
User’s Guide
2012-2013 Microchip Technology Inc. DS40001671B
Note the following details of the code protection feature on Microchip devices:
YSTEM
CERTIFIED BY DNV
== ISO/TS 16949 ==
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. All of these methods, to our knowledge, require using the Microchip products in a manner outside the operating specifications contained in Microchip’s Data Sheets. Most likely, the person doing so is engaged in theft of intellectual property.
Microchip is willing to work with the customer who is concerned about the integrity of their code.
Neither Microchip nor any other semiconductor manufacturer can guarantee the security of their code. Code protection does not mean that we are guaranteeing the product as “unbreakable.”
Code protection is constantly evolving. We at Microchip are committed to continuously improving the code protection features of our products. Attempts to break Microchip’s code protection feature may be a violation of the Digital Millennium Copyright Act. If such acts allow unauthorized access to your software or other copyrighted work, you may have a right to sue for relief under that Act.
Information contained in this publication regarding device applications and the like is provided only for your convenience and may be superseded by updates. It is your responsibility to ensure that your application meets with your specifications. MICROCHIP MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND WHETHER EXPRESS OR IMPLIED, WRITTEN OR ORAL, STATUTORY OR OTHERWISE, RELATED TO THE INFORMATION, INCLUDING BUT NOT LIMITED TO ITS CONDITION, QUALITY, PERFORMANCE, MERCHANTABILITY OR FITNESS FOR PURPOSE. Microchip disclaims all liability arising from this information and its use. Use of Microchip devices in life support and/or safety applications is entirely at the buyer’s risk, and the buyer agrees to defend, indemnify and hold harmless Microchip from any and all damages, claims, suits, or expenses resulting from such use. No licenses are conveyed, implicitly or otherwise, under any Microchip intellectual property rights.
Trademarks
The Microchip name and logo, the Microchip logo, dsPIC, FlashFlex, K PICSTART, PIC and UNI/O are registered trademarks of Microchip Technology Incorporated in the U.S.A. and other countries.
FilterLab, Hampshire, HI-TECH C, Linear Active Thermistor, MTP, SEEVAL and The Embedded Control Solutions Company are registered trademarks of Microchip Technology Incorporated in the U.S.A.
Silicon Storage Technology is a registered trademark of Microchip Technology Inc. in other countries.
Analog-for-the-Digital Age, Application Maestro, BodyCom, chipKIT, chipKIT logo, CodeGuard, dsPICDEM, dsPICDEM.net, dsPICworks, dsSPEAK, ECAN, ECONOMONITOR, FanSense, HI-TIDE, In-Circuit Serial Programming, ICSP, Mindi, MiWi, MPASM, MPF, MPLAB Certified logo, MPLIB, MPLINK, mTouch, Omniscient Code Generation, PICC, PICC-18, PICDEM, PICDEM.net, PICkit, PICtail, REAL ICE, rfLAB, Select Mode, SQI, Serial Quad I/O, Total Endurance, TSHARC, UniWinDriver, WiperLock, ZENA and Z-Scale are trademarks of Microchip Technology Incorporated in the U.S.A. and other countries.
SQTP is a service mark of Microchip Technology Incorporated in the U.S.A.
GestIC and ULPP are registered trademarks of Microchip Technology Germany II GmbH & Co. KG, a subsidiary of Microchip Technology Inc., in other countries.
All other trademarks mentioned herein are property of their respective companies.
© 2012-2013, Microchip Technology Incorporated, Printed in the U.S.A., All Rights Reserved.
Printed on recycled paper.
ISBN: 9781620772737
EELOQ, KEELOQ logo, MPLAB, PIC, PICmicro,
32
logo, rfPIC, SST, SST Logo, SuperFlash
QUALITY MANAGEMENT S
DS40001671B-page 2 2012-2013 Microchip Technology Inc.
Microchip received ISO/TS-16949:2009 certification for its worldwide headquarters, design and wafer fabrication facilities in Chandler and Tempe, Arizona; Gresham, Oregon and design centers in California and India. The Company’s quality system processes and procedures are for its PIC devices, Serial EEPROMs, microperipherals, nonvolatile memory and analog products. In addition, Microchip’s quality system for the design and manufacture of development systems is ISO 9001:2000 certified.
®
MCUs and dsPIC® DSCs, KEELOQ
®
code hopping
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 ........................................................................................... 12
2.4 PSMC Selection ........................................................................................... 12
2.5 PSMC Enable ............................................................................................... 12
2.6 Interrupt Enables .......................................................................................... 12
2.6.1 Timed Event Interrupt Enable .................................................................... 12
2.6.2 Auto-Shutdown Interrupt Enable ............................................................... 12
2.7 Comments .................................................................................................... 12
2.8 Copy and Show Button ................................................................................. 13
2.8.1 PSMC SFR Displays ................................................................................. 13
2.9 Paste Button ................................................................................................. 13
2.10 Clear Button ............................................................................................... 13
2.11 Pull-down Menu .......................................................................................... 13
2.11.1 Save Assy ............................................................................................... 13
2.11.2 Save C ..................................................................................................... 13
2.11.3 Load Code ............................................................................................... 14
2.12 Clock .......................................................................................................... 14
2.12.1 Clock Source ........................................................................................... 14
2.12.2 Prescale .................................................................................................. 14
2.13 Timer .......................................................................................................... 14
2.13.1 Sync Source ............................................................................................ 15
2.13.2 Timer Interrupt ......................................................................................... 15
2.14 Blanking ...................................................................................................... 15
2.14.1 Blanking Times ........................................................................................ 16
2.14.2 Rising Event Trigger ................................................................................ 16
2.14.3 Falling Event Trigger ............................................................................... 17
2.14.4 Asynchronous Input Pin Polarity ............................................................. 17
2.15 Period Event ............................................................................................... 17
2.15.1 Synchronous Selection ............................................................................ 17
2.15.2 Asynchronous Selection .......................................................................... 18
2.15.3 Asynchronous Polarity (not available on PIC16(L)F1782/3) .................... 18
2.15.4 Interrupt ................................................................................................... 18
2.16 Rising Event ............................................................................................... 18
2.16.1 Synchronous Selection ............................................................................ 19
2.16.2 Asynchronous Selection .......................................................................... 19
2.16.3 Interrupt ................................................................................................... 20
PSMC DESIGNER
USER’S GUIDE
2012-2013 Microchip Technology Inc. DS40001671B-page 3
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 ....................................................................................................21
2.18 Modulation .................................................................................................. 21
2.18.1 Modulation Source Selection ...................................................................22
2.18.2 Modulation Enable ...................................................................................22
2.19 PSMC Modes ............................................................................................. 22
2.19.1 Dead-Band Control ..................................................................................23
2.19.2 SPWM: Single PWM Mode ......................................................................23
2.19.3 SPWMC: Single PWM Mode with Complementary Outputs ....................24
2.19.4 PP: Push-Pull Mode .................................................................................25
2.19.5 PPC: Push-Pull with Complementary Output ...........................................25
2.19.6 FBPP: Full-Bridge Push-Pull ....................................................................26
2.19.7 FBPPC: Full-Bridge Push-Pull with Complementary Mode Outputs ........27
2.19.8 PS: Pulse-Skipping Mode ........................................................................27
2.19.9 PSC: Pulse-Skipping with Complementary Output ..................................28
2.19.10 ECCPR: ECC PWM Full-Bridge Mode, Reverse Direction ....................29
2.19.11 ECCPF: ECC PWM Full-Bridge Mode, Forward Direction .....................30
2.19.12 FDC: Fixed Duty Cycle Mode ................................................................30
2.19.13 Fine Frequency Adjust ...........................................................................31
2.19.14 FDCC: Fixed Duty Cycle with Complementary Output ..........................31
2.19.15 3PH: 3-Phase PWM ...............................................................................32
2.20 Output Control ............................................................................................ 33
2.20.1 Output Enable ..........................................................................................34
2.20.2 Output Steering ........................................................................................34
2.20.3 Output Steering Synchronization .............................................................34
2.20.4 Output Polarity .........................................................................................35
2.20.5 Shutdown Level .......................................................................................35
2.21 Auto-Shutdown ........................................................................................... 35
2.21.1 Shutdown Enable .....................................................................................35
2.21.2 Shutdown Sources ...................................................................................35
2.21.3 Shutdown Override ..................................................................................35
2.21.4 Auto/Manual Restart ................................................................................35
2.22 Sync Control (not available on the PIC16(L)F1782/3) ................................ 36
Chapter 3. PSMC Tips
3.1 Variable Period with Fixed Off-time .............................................................. 37
3.2 3-Phase Variable Duty Cycle ....................................................................... 38
3.3 Center Weighted Variable PWM .................................................................. 39
DS40001671B-page 4 2012-2013 Microchip Technology Inc.
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. The numbering convention for the DS number is “DSXXXXXA”, where “XXXXX” is the document number and “A” is the revision level of the document.
For the most up-to-date information on development tools, see the MPLAB IDE online help. Select the Help menu, and then Topics to open a list of available online help files.
INTRODUCTION
This chapter contains general information that will be useful to know before using the PSMC Designer. Items discussed in this chapter include:
Conventions Used in this Guide
The Microchip Web Site
Customer Support
Document Revision History
DOCUMENT LAYOUT
This document describes how to use the PSMC Designer. The document is organized as follows:
Chapter 1. “PSMC Designer Overview”
Chapter 2. “Main PSMC Configuration GUI”
Chapter 3. “PSMC Tips”
2012-2013 Microchip Technology Inc. DS40001671B-page 5
PSMC Designer User’s Guide
CONVENTIONS USED IN THIS GUIDE
This manual uses the following documentation conventions:
DOCUMENTATION CONVENTIONS
Description Represents Examples
Arial font:
Italic characters Referenced books MPLAB IDE User’s Guide
Emphasized text ...is the only compiler...
Initial caps A window the Output window
A dialog the Settings dialog A menu selection select Enable Programmer
Quotes A field name in a window or
dialog
Underlined, italic text with right angle bracket
Bold characters A dialog button Click OK
N‘Rnnnn A number in verilog format,
Text in angle brackets < > A key on the keyboard Press <Enter>, <F1>
Courier New font:
Plain Courier New Sample source code #define START
Italic Courier New A variable argument file.o, where file can be
Square brackets [ ] Optional arguments mcc18 [options] file
Curly brackets and pipe character: { | }
Ellipses... Replaces repeated text var_name [,
A menu path File>Save
A tab Click the Power tab
where N is the total number of digits, R is the radix and n is a digit.
Filenames autoexec.bat File paths c:\mcc18\h Keywords _asm, _endasm, static Command-line options -Opa+, -Opa- Bit values 0, 1 Constants 0xFF, ‘A’
Choice of mutually exclusive arguments; an OR selection
Represents code supplied by user
“Save project before build”
4‘b0010, 2‘hF1
any valid filename
[options]
errorlevel {0|1}
var_name...] void main (void)
{ ... }
DS40001671B-page 6 2012-2013 Microchip Technology Inc.
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. Accessible by using your favorite Internet browser, the web site contains the following information:
Product Support – Data sheets and errata, application notes and sample programs, design resources, user’s guides and hardware support documents, latest software releases and archived software
General Technical Support – Frequently Asked Questions (FAQs), technical support requests, online discussion groups, Microchip consultant program member listing
Business of Microchip – Product selector and ordering guides, latest Microchip press releases, listing of seminars and events, listings of Microchip sales offices, distributors and factory representatives
CUSTOMER SUPPORT
Users of Microchip products can receive assistance through several channels:
• Distributor or Representative
• Local Sales Office
• Field Application Engineer (FAE)
• Technical Support
Customers should contact their distributor, representative or field application engineer (FAE) for support. Local sales offices are also available to help customers.
Technical support is available through the web site at:
http://www.microchip.com/support.
Preface
DOCUMENT REVISION HISTORY
Revision A (December 2012)
• Initial Release of this Document.
Revision B (June 2013)
• Updated Figure 2-3, Figure 2-6, Figure 2-7, Figure 2-18, and Figure 2-19.
2012-2013 Microchip Technology Inc. DS40001671B-page 7
PSMC Designer User’s Guide
NOTES:
DS40001671B-page 8 2012-2013 Microchip Technology Inc.

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. PWM modes include:
•PWM
• Push-Pull
• Full-bridge
• Push-Pull Full-bridge
• Pulse skipping
• High resolution fixed duty cycle
• 6-step 3-phase operation
Every mode, except the 6-step, has a complementary output mode, which drives at least two channels that are the complement of each other.
The PSMC also supports various driver and feedback configurations with the following programmable features:
• Dead band – delays the output drive for a time after the complement of that output turns off
• Blanking – Suppresses feedback signals for a time after the drive transitions on and off
• Asynchronous inputs – pulse Start and Stop events can be triggered by external asynchronous signals in combination with, or independent of, an internal time base
• Shutdown – immediate safe shutdown driven by an external asynchronous Fault signal
• Modulation – the PWM can be operated as a carrier and modulated by an independent input
There are thirty Special Function Registers (SFRs) in the PSMC configuration setup. Setting all thirty registers with the appropriate values for desired operation can be a daunting task. The PSMC Designer GUI was created to simplify that effort.
The GUI divides the PSMC into up to eleven major functions. These functions are shown in relation to each other in block diagram format in the main GUI window. Clicking on a block opens the control GUI for that function. The user is guided through the PSMC configuration design by completing signal paths and control options within each function by selecting switch positions. Entry boxes for times and frequencies appear within the diagrams where numeric entry is required.
There are two options for transferring the completed PSMC configuration to your project. One is to copy the code into the clipboard buffer which can then be pasted into your source code. The other transfer method is to generate an output file that can be included by reference in your source code. Include files are also the means by which PSMC configurations are stored for later retrieval by the PSMC designer.
PSMC DESIGNER
USER’S GUIDE
2012-2013 Microchip Technology Inc. DS40001671B-page 9
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.

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. Device Selection 2. PSMC Selection
3. Copy and Show Button 4. Paste Button
5. Clear Button 6. Copy and Show Button
7. PSMC SFR Displays 8. PSMC Enable
9. Interrupt Enables 10. Pull-down Menu
11. Comments
PSMC DESIGNER
USER’S GUIDE

FIGURE 2-1: MAIN PSMC DESIGNER GUI

2012-2013 Microchip Technology Inc. DS40001671B-page 11
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.3 DEVICE SELECTION

Selecting the device is the first step in creating a PSMC configuration. The Device combination box lists all devices with PSMC peripherals. Make the selection by scrolling through the list to the desired device. The device selection also configures controls for all PSMC instances in that device with the proper input and output names associated with that device.

2.4 PSMC SELECTION

Selecting the desired PSMC instance is the second step in creating a PSMC configuration. Make the selection by scrolling through the list to the desired PSMC instance. The PSMC selection also configures all other controls with the proper input and output names associated with that PSMC instance.

2.5 PSMC ENABLE

This checkbox in the main GUI enables or disables the currently selected PSMC of the currently selected device.

2.6 INTERRUPT ENABLES

The interrupt enable checkboxes in the main GUI enable or disable the corresponding bit of the PIEx register for the currently selected PSMC of the currently selected device.

2.6.1 Timed Event Interrupt Enable

The timed event enable is the summary enable bit for the timed event interrupts.

2.6.2 Auto-Shutdown Interrupt Enable

The auto-shutdown enable is the enable bit for auto-shutdown events.

2.7 COMMENTS

The comments section in the lower center of the main GUI is where user comments about the PSMC configuration can be entered. Each PSMC instance has its own comment data, which is displayed when that PSMC is selected. Comments entered in this box are included as comments in the saved file output.
DS40001671B-page 12 2012-2013 Microchip Technology Inc.

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. Multiple copy and paste operations are required when working with multiple PSMC instances. A better method for saving multiple PSMC instances of the same device is the File Save option. Files can be saved in either C or Assembly format (see Save Assy or Save C).

2.8.1 PSMC SFR Displays

The PSMC SFRs are displayed by name and value in the 30 text boxes between the Copy and Show button and the Paste button. Only the SFRs for the selected PSMC instance are displayed as indicated by each of the SFR name prefixes.

2.9 PASTE BUTTON

The Paste button transfers SFR values of the PSMC instance, from which they were copied with the Copy and Show button, to the presently selected PSMC instance. In this manner, one PSMC configuration can be created then quickly copied to other desired PSMC instances. It is usually easier to make a few changes to a copied configuration than it is to re-enter the entire configuration for each PSMC instance. Note that the Paste button will not paste values copied from your source code.
Main PSMC Configuration GUI

2.10 CLEAR BUTTON

The Clear button clears all SFRs in the presently selected PSMC instance to zero. All GUIs of the various functions adjust accordingly.

2.11 PULL-DOWN MENU

In the upper left of the main GUI display there is a pull-down menu titled “File”. This pull-down menu includes the following:
• Save Assy Code
• Save C Code
• Load Code
A file selection dialog will appear when the desired menu item is selected for both saving and loading code. A comment section, that includes the device number and clock frequency, is included in the saved code. This is used to reconstruct those parts of the configuration when the code is loaded back into the designer tool.

2.11.1 Save Assy

Selecting the Save Assy code menu option creates an include file containing assembly configuration code for all PSMCs in the selected device that have been configured. Any PSMC instance in the selected device that is clear will not be included in the output.

2.11.2 Save C

Selecting the Save C code menu option creates an include file containing C configuration code for all PSMCs in the selected device that have been configured. Any PSMC instance in the selected device that is clear will not be included in the output.
2012-2013 Microchip Technology Inc. DS40001671B-page 13
Loading...
+ 29 hidden pages