4.3.1 MCC SMPS Library Configuration for PCMC Closed Loop
The following instructions show how to setup the peripherals of the CIP Hybrid Power Starter Kit to be able to operate in PCMC test mode.
- Open MPLAB X. Connect the CIP Hybrid Power Starter Kit to the computer through an on-board debugger USB port using a conventional micro-USB cable. MPLAB X will detect the CIP Hybrid Power Starter Kit and an Xplained Window appears that provides relevant information about the board.
- Create new Standalone Project in MPLAB X. Select the PIC16F1779 device. Select the CIP Hybrid Starter Kit as programming tool. Name this project “PCMC”.
- Open MCC. Save the MCC configuration
as
PCMC.mc3
. - In the Project Resources area, change the internal oscillator clock to 8 MHz from the System Module. On the Pin Manager, change the package to QFN44.
- Go to the Device Resources area, click SMPS Power Controllers and expand Power Supply Topologies, double click on SyncBuck. This action will move the SyncBuck to the Project Resources area.
- In the Project Resources area, click on SyncBuck. On the Configuration tab, under Hardware Settings, select PCMC as the control mode. Change the switching frequency to 500 kHz, the duty cycle to 90%, reference voltage to 2.5V, leading edge blanking to 250 ns, rising edge dead time to 50 ns, and falling edge dead time to 40 ns. Choose PWM Controller Block 3.
- Click the Upload All button. This action will load all the peripherals of the PWM Controller Block 3 on the Project Resources area.
- Add slope compensation of 0.3 V/us.
- Go to the Pin Manager: Grid View. Assign RD3 as input pin for CS, RC6 as output pin for signal EA_OUT, RC7 as input pin for signal FB, RD5 as output pin for signal OUT_H, and RD4 as output pin for signal OUT_L.
- Soft start is enabled by default on the PCMC Control Mode section.
- Enabling soft start disables the COG, PWM and OPA peripherals at power on.
- Click Generate button to
generate the code. On the
main.c
, add the following line of code,PCMC_SoftStart();
. - Program the PIC16F1779 device on the CIP Hybrid Power Starter Kit by clicking the ”Make and Program Device Main Project” icon.
- Alternatively, the user can also
download the PCMC firmware to the CIP Hybrid Power Starter Kit by dragging the
generated
.hex
file of the project to the CURIOSITY drive. The.hex
file is located on the --dist\default\production folder. - The board is now configured for PCMC-CS operation.