4.2.1 MCC SMPS Library Configuration for Open Loop with Current Limit
The following instructions show how to setup the peripherals of the CIP Hybrid Power Starter Kit to be able to operate in Open Loop with Current Limit 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 “OpenLoopCurrentLimit”.
- Open MCC. Save the MCC configuration
as
OpenLoopCurrentLimit.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 CIP Blocks, double click on ModulatorBlockPCMC. This action will move the selected module to the Project Resources area.
- In the Project Resources area, click the ModulatorBlockPCMC. Go to the Configuration tab, under Hardware Settings, change the switching frequency to 500 kHz, and the duty cycle to 50%. Uncheck Standalone Open Loop PWM.
- Under the Ramp Generator Settings, add slope compensation ramp of 2 V/us and use FVR_buffer2 as the DC offset.
- Under the Comparator Settings, select PRG3 as the positive input of the comparator.
- Under the Complementary Output Generator Settings, change rising dead time to 50 ns, falling dead time to 40 ns, and blanking time to 250 ns.
- Select PRG3, CMP8, COG4, PWM11 and FVR on the Sub-Module Selection and Upload All button. Check if all the peripherals have been correctly added to the Project Resources area.
- Go to Pin Manager: Grid View. Select RD5 as output pin for signal OUT_H, RD4 as output pin for signal OUT_L and RD3 as input pin for feedback signal CS.
- Click Generate button to generate the code. 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 Open Loop 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 CIP Hybrid Power Starter Kit can now be tested for Open Loop with Current Limit operation and will immediately start to generate the PWM output signals driving the synchronous buck converter.