Digital Power Starter Kit 3 Firmware
dsPIC33C Buck Converter Voltage Mode Control Example

Conversion macros for user-declarations of phase current feedback parameters of the buck converter. More...

+ Collaboration diagram for Buck Converter:
#define BUCK_ISNS_MIN   (uint16_t)(int16_t)(((BUCK_ISNS_MINIMUM-BUCK_ISNS_FEEDBACK_OFFSET) * BUCK_ISNS_FEEDBACK_GAIN) / ADC_GRANULARITY)
 Conversion macros of phase current feedback parameters. More...
 
#define BUCK_ISNS_OCL   (uint16_t)(((BUCK_ISNS_MAXIMUM-BUCK_ISNS_FEEDBACK_OFFSET) * BUCK_ISNS_FEEDBACK_GAIN) / ADC_GRANULARITY)
 Over Current Limit. More...
 
#define BUCK_ISNS_OCL_RELEASE   (uint16_t)(((BUCK_ISNS_RELEASE-BUCK_ISNS_FEEDBACK_OFFSET) * BUCK_ISNS_FEEDBACK_GAIN) / ADC_GRANULARITY)
 Over Current Release Level. More...
 
#define BUCK_ISNS_REF   (uint16_t)((BUCK_ISNS_REFERENCE * BUCK_ISNS_FEEDBACK_GAIN) / ADC_GRANULARITY)
 Output Current Reference. More...
 
#define BUCK_ISNS_FB_OFFSET   (uint16_t)(BUCK_ISNS_FEEDBACK_OFFSET / ADC_GRANULARITY)
 
#define BUCK_ISNS_ADC_TRGDLY   (uint16_t)(BUCK_ISNS_ADC_TRG_DELAY / PWM_CLOCK_PERIOD)
 
#define BUCK_ISNS_NORM_INV_G   (float)(1.0/BUCK_ISNS_FEEDBACK_GAIN)
 Inverted feedback gain required for value normalization. More...
 
#define BUCK_ISNS_NORM_SCALER   (int16_t)(ceil(log(BUCK_ISNS_NORM_INV_G)/log(2)))
 ISNS normalization
More...
 
#define BUCK_ISNS_NORM_FACTOR   (int16_t)((BUCK_ISNS_NORM_INV_G / pow(2.0, BUCK_ISNS_NORM_SCALER)) * (pow(2.0, 15)-1))
 ISNS normalization factor scaled in Q15. More...
 

Detailed Description

Conversion macros for user-declarations of phase current feedback parameters of the buck converter.

Macro Definition Documentation

◆ BUCK_ISNS_ADC_TRGDLY

#define BUCK_ISNS_ADC_TRGDLY   (uint16_t)(BUCK_ISNS_ADC_TRG_DELAY / PWM_CLOCK_PERIOD)

Definition at line 621 of file dpsk3_hwdescr.h.

◆ BUCK_ISNS_FB_OFFSET

#define BUCK_ISNS_FB_OFFSET   (uint16_t)(BUCK_ISNS_FEEDBACK_OFFSET / ADC_GRANULARITY)

Definition at line 620 of file dpsk3_hwdescr.h.

◆ BUCK_ISNS_MIN

#define BUCK_ISNS_MIN   (uint16_t)(int16_t)(((BUCK_ISNS_MINIMUM-BUCK_ISNS_FEEDBACK_OFFSET) * BUCK_ISNS_FEEDBACK_GAIN) / ADC_GRANULARITY)

Conversion macros of phase current feedback 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. Over Current Limit

Definition at line 616 of file dpsk3_hwdescr.h.

◆ BUCK_ISNS_NORM_FACTOR

#define BUCK_ISNS_NORM_FACTOR   (int16_t)((BUCK_ISNS_NORM_INV_G / pow(2.0, BUCK_ISNS_NORM_SCALER)) * (pow(2.0, 15)-1))

ISNS normalization factor scaled in Q15.

Definition at line 625 of file dpsk3_hwdescr.h.

◆ BUCK_ISNS_NORM_INV_G

#define BUCK_ISNS_NORM_INV_G   (float)(1.0/BUCK_ISNS_FEEDBACK_GAIN)

Inverted feedback gain required for value normalization.

Definition at line 623 of file dpsk3_hwdescr.h.

◆ BUCK_ISNS_NORM_SCALER

#define BUCK_ISNS_NORM_SCALER   (int16_t)(ceil(log(BUCK_ISNS_NORM_INV_G)/log(2)))

ISNS normalization

Definition at line 624 of file dpsk3_hwdescr.h.

◆ BUCK_ISNS_OCL

Over Current Limit.

Definition at line 617 of file dpsk3_hwdescr.h.

◆ BUCK_ISNS_OCL_RELEASE

#define BUCK_ISNS_OCL_RELEASE   (uint16_t)(((BUCK_ISNS_RELEASE-BUCK_ISNS_FEEDBACK_OFFSET) * BUCK_ISNS_FEEDBACK_GAIN) / ADC_GRANULARITY)

Over Current Release Level.

Definition at line 618 of file dpsk3_hwdescr.h.

◆ BUCK_ISNS_REF

#define BUCK_ISNS_REF   (uint16_t)((BUCK_ISNS_REFERENCE * BUCK_ISNS_FEEDBACK_GAIN) / ADC_GRANULARITY)

Output Current Reference.

Definition at line 619 of file dpsk3_hwdescr.h.