Digital Power Starter Kit 3 Firmware  DM330017-3, Rev.3.0
dsPIC33C Buck Converter Peak Current Mode Control Example

Conversion macros converting physical quantities of PWM parameters of the buck converter
into binary (integer) numbers for registers and variables. More...

+ Collaboration diagram for Buck Converter:
#define BUCK_SWITCHING_PERIOD   (float)(1.0/BUCK_SWITCHING_FREQUENCY)
 Conversion macros for user-declarations of PWM parameters. More...
 
#define BUCK_PWM_PERIOD   (uint16_t)(float)(BUCK_SWITCHING_PERIOD / PWM_CLOCK_PERIOD)
 This sets the switching period of the converter. More...
 
#define BUCK_PWM_PHASE_SHIFT   (uint16_t)((float)BUCK_PWM_PERIOD / (float)BUCK_NO_OF_PHASES)
 This sets the phase shift between phase #1 and #2. More...
 
#define BUCK_PWM_DC_MIN   (uint16_t)(BUCK_PWM_DUTY_CYCLE_MIN * (float)BUCK_PWM_PERIOD)
 This sets the minimum duty cycle. More...
 
#define BUCK_PWM_DC_MAX   (uint16_t)(BUCK_PWM_DUTY_CYCLE_MAX * (float)BUCK_PWM_PERIOD)
 This sets the maximum duty cycle. More...
 
#define BUCK_LEB_PERIOD   (uint16_t)(BUCK_LEADING_EDGE_BLANKING / (float)PWM_CLOCK_PERIOD)
 Leading Edge Blanking = n x PWM resolution (here: 50 x 2ns = 100ns) More...
 
#define BUCK_PWM_DEAD_TIME_LE   (uint16_t)(BUCK_DEAD_TIME_LEADING_EDGE / (float)PWM_CLOCK_PERIOD)
 Rising edge dead time [tick = 250ps]. More...
 
#define BUCK_PWM_DEAD_TIME_FE   (uint16_t)(BUCK_DEAD_TIME_FALLING_EDGE / (float)PWM_CLOCK_PERIOD)
 Falling edge dead time [tick = 250ps]. More...
 

Detailed Description

Conversion macros converting physical quantities of PWM parameters of the buck converter
into binary (integer) numbers for registers and variables.

Macro Definition Documentation

◆ BUCK_LEB_PERIOD

#define BUCK_LEB_PERIOD   (uint16_t)(BUCK_LEADING_EDGE_BLANKING / (float)PWM_CLOCK_PERIOD)

Leading Edge Blanking = n x PWM resolution (here: 50 x 2ns = 100ns)

Definition at line 395 of file dpsk3_hwdescr.h.

◆ BUCK_PWM_DC_MAX

#define BUCK_PWM_DC_MAX   (uint16_t)(BUCK_PWM_DUTY_CYCLE_MAX * (float)BUCK_PWM_PERIOD)

This sets the maximum duty cycle.

Definition at line 394 of file dpsk3_hwdescr.h.

◆ BUCK_PWM_DC_MIN

#define BUCK_PWM_DC_MIN   (uint16_t)(BUCK_PWM_DUTY_CYCLE_MIN * (float)BUCK_PWM_PERIOD)

This sets the minimum duty cycle.

Definition at line 393 of file dpsk3_hwdescr.h.

◆ BUCK_PWM_DEAD_TIME_FE

#define BUCK_PWM_DEAD_TIME_FE   (uint16_t)(BUCK_DEAD_TIME_FALLING_EDGE / (float)PWM_CLOCK_PERIOD)

Falling edge dead time [tick = 250ps].

Definition at line 397 of file dpsk3_hwdescr.h.

◆ BUCK_PWM_DEAD_TIME_LE

#define BUCK_PWM_DEAD_TIME_LE   (uint16_t)(BUCK_DEAD_TIME_LEADING_EDGE / (float)PWM_CLOCK_PERIOD)

Rising edge dead time [tick = 250ps].

Definition at line 396 of file dpsk3_hwdescr.h.

◆ BUCK_PWM_PERIOD

#define BUCK_PWM_PERIOD   (uint16_t)(float)(BUCK_SWITCHING_PERIOD / PWM_CLOCK_PERIOD)

This sets the switching period of the converter.

Definition at line 391 of file dpsk3_hwdescr.h.

◆ BUCK_PWM_PHASE_SHIFT

#define BUCK_PWM_PHASE_SHIFT   (uint16_t)((float)BUCK_PWM_PERIOD / (float)BUCK_NO_OF_PHASES)

This sets the phase shift between phase #1 and #2.

Definition at line 392 of file dpsk3_hwdescr.h.

◆ BUCK_SWITCHING_PERIOD

#define BUCK_SWITCHING_PERIOD   (float)(1.0/BUCK_SWITCHING_FREQUENCY)

Conversion macros for user-declarations of PWM parameters.

These conversion macros are used to convert user settings defined as physical quantities into binary (integer) numbers, which will be written to registers and variables and used in calculations throughout the firmware. Switching period in [sec]

Definition at line 390 of file dpsk3_hwdescr.h.