Digital Power Starter Kit 3 Firmware
dsPIC33C Buck Converter Voltage Mode Control Example
init_pmd.c
1 /*
2  * File: init_pmd.c
3  * Author: M91406
4  *
5  * Created on July 8, 2019, 6:26 PM
6  */
7 
8 
9 #include <xc.h>
10 #include "init_pmd.h"
11 
12 
40 volatile uint16_t sysPmd_Initialize(void) {
41 
42  volatile uint16_t retval=1;
43 
44  // Disable all peripheral modules
45  PMDCONbits.PMDLOCK = 0; // Unlock writes to PMD registers
46 
47  PMD1 = 0xffff; //
48  PMD2 = 0xffff; //
49  PMD3 = 0xffff; //
50 
51  PMDCONbits.PMDLOCK = 1; // Lock writes to PMD registers
52 
53  return(retval);
54 }
55 
56 // end of file