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

Boost Converter
Hardware Abstraction Layer » Input Voltage Feedback » Conversion Macros

Conversion macros for user-declarations of input voltage feedback parameters of the boost converter. More...

Collaboration diagram for Boost Converter:

#define | BOOST_VIN_FEEDBACK_GAIN (float)((BOOST_VIN_R2) / (BOOST_VIN_R1 + BOOST_VIN_R2))
| Conversion macros of input voltage feedback parameters. More...
#define | BOOST_VIN_MIN (uint16_t)(BOOST_VIN_MINIMUM * BOOST_VIN_FEEDBACK_GAIN / ADC_GRANULARITY)
| Minimum input voltage. More...
#define | BOOST_VIN_NOM (uint16_t)(BOOST_VIN_NOMINAL * BOOST_VIN_FEEDBACK_GAIN / ADC_GRANULARITY)
| Nominal input voltage. More...
#define | BOOST_VIN_MAX (uint16_t)(BOOST_VIN_MAXIMUM * BOOST_VIN_FEEDBACK_GAIN / ADC_GRANULARITY)
| Maximum input voltage. More...
#define | BOOST_VIN_HYST (uint16_t)(BOOST_VIN_HYSTERESIS * BOOST_VIN_FEEDBACK_GAIN / ADC_GRANULARITY)
| Over Voltage LOck Out voltage. More...
#define | BOOST_VIN_UVLO_TRIP (uint16_t)(BOOST_VIN_UNDER_VOLTAGE * BOOST_VIN_FEEDBACK_GAIN / ADC_GRANULARITY)
| Under Voltage LOck Out voltage. More...
#define | BOOST_VIN_UVLO_RELEASE (uint16_t)((BOOST_VIN_UNDER_VOLTAGE + BOOST_VIN_HYSTERESIS) * BOOST_VIN_FEEDBACK_GAIN / ADC_GRANULARITY)
| Under Voltage LOck Out voltage. More...
#define | BOOST_VIN_OVLO_TRIP (uint16_t)(BOOST_VIN_OVER_VOLTAGE * BOOST_VIN_FEEDBACK_GAIN / ADC_GRANULARITY)
| Over Voltage LOck Out voltage. More...
#define | BOOST_VIN_OVLO_RELEASE (uint16_t)((BOOST_VIN_OVER_VOLTAGE - BOOST_VIN_HYSTERESIS) * BOOST_VIN_FEEDBACK_GAIN / ADC_GRANULARITY)
| Over Voltage LOck Out voltage. More...
#define | BOOST_VIN_ADC_TRGDLY (uint16_t)(BOOST_VIN_ADC_TRG_DELAY / PWM_CLOCK_PERIOD)
| Input voltage ADC trigger delay. More...
#define | BOOST_VIN_OFFSET (uint16_t)(BOOST_VIN_FEEDBACK_OFFSET / ADC_GRANULARITY)
| Input voltage feedback offset. More...
#define | BOOST_VIN_NORM_INV_G (float)(1.0/BOOST_VIN_FEEDBACK_GAIN)
| Inverted feedback gain required for value normalization. More...
#define | BOOST_VIN_NORM_SCALER (int16_t)(ceil(log(BOOST_VIN_NORM_INV_G)/log(2)))
| VIN normalization. More...
#define | BOOST_VIN_NORM_FACTOR (int16_t)((BOOST_VIN_NORM_INV_G / pow(2.0, BOOST_VIN_NORM_SCALER)) * (pow(2.0, 15)-1))
| VIN normalization factor scaled in Q15. More...
#define | BOOST_VIN_RANGE_MAX (float)(ADC_REFERENCE * BOOST_VIN_NORM_INV_G)

## Detailed Description

Conversion macros for user-declarations of input voltage feedback parameters of the boost converter.

## Macro Definition Documentation

## ◆ BOOST_VIN_ADC_TRGDLY

#define BOOST_VIN_ADC_TRGDLY (uint16_t)(BOOST_VIN_ADC_TRG_DELAY / PWM_CLOCK_PERIOD)

Input voltage ADC trigger delay.

Definition at line 1070 of file dpsk3_hwdescr.h.

## ◆ BOOST_VIN_FEEDBACK_GAIN

#define BOOST_VIN_FEEDBACK_GAIN (float)((BOOST_VIN_R2) / (BOOST_VIN_R1 + BOOST_VIN_R2))

Conversion macros of input voltage 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.

Definition at line 1061 of file dpsk3_hwdescr.h.

## ◆ BOOST_VIN_HYST

#define BOOST_VIN_HYST (uint16_t)(BOOST_VIN_HYSTERESIS * BOOST_VIN_FEEDBACK_GAIN / ADC_GRANULARITY)

Over Voltage LOck Out voltage.

Definition at line 1065 of file dpsk3_hwdescr.h.

## ◆ BOOST_VIN_MAX

#define BOOST_VIN_MAX (uint16_t)(BOOST_VIN_MAXIMUM * BOOST_VIN_FEEDBACK_GAIN / ADC_GRANULARITY)

Maximum input voltage.

Definition at line 1064 of file dpsk3_hwdescr.h.

## ◆ BOOST_VIN_MIN

#define BOOST_VIN_MIN (uint16_t)(BOOST_VIN_MINIMUM * BOOST_VIN_FEEDBACK_GAIN / ADC_GRANULARITY)

Minimum input voltage.

Definition at line 1062 of file dpsk3_hwdescr.h.

## ◆ BOOST_VIN_NOM

#define BOOST_VIN_NOM (uint16_t)(BOOST_VIN_NOMINAL * BOOST_VIN_FEEDBACK_GAIN / ADC_GRANULARITY)

Nominal input voltage.

Definition at line 1063 of file dpsk3_hwdescr.h.

## ◆ BOOST_VIN_NORM_FACTOR

#define BOOST_VIN_NORM_FACTOR (int16_t)((BOOST_VIN_NORM_INV_G / pow(2.0, BOOST_VIN_NORM_SCALER)) * (pow(2.0, 15)-1))

VIN normalization factor scaled in Q15.

Definition at line 1075 of file dpsk3_hwdescr.h.

## ◆ BOOST_VIN_NORM_INV_G

#define BOOST_VIN_NORM_INV_G (float)(1.0/BOOST_VIN_FEEDBACK_GAIN)

Inverted feedback gain required for value normalization.

Definition at line 1073 of file dpsk3_hwdescr.h.

## ◆ BOOST_VIN_NORM_SCALER

#define BOOST_VIN_NORM_SCALER (int16_t)(ceil(log(BOOST_VIN_NORM_INV_G)/log(2)))

VIN normalization.

Definition at line 1074 of file dpsk3_hwdescr.h.

## ◆ BOOST_VIN_OFFSET

#define BOOST_VIN_OFFSET (uint16_t)(BOOST_VIN_FEEDBACK_OFFSET / ADC_GRANULARITY)

Input voltage feedback offset.

Definition at line 1071 of file dpsk3_hwdescr.h.

## ◆ BOOST_VIN_OVLO_RELEASE

#define BOOST_VIN_OVLO_RELEASE (uint16_t)((BOOST_VIN_OVER_VOLTAGE - BOOST_VIN_HYSTERESIS) * BOOST_VIN_FEEDBACK_GAIN / ADC_GRANULARITY)

Over Voltage LOck Out voltage.

Definition at line 1069 of file dpsk3_hwdescr.h.

## ◆ BOOST_VIN_OVLO_TRIP

#define BOOST_VIN_OVLO_TRIP (uint16_t)(BOOST_VIN_OVER_VOLTAGE * BOOST_VIN_FEEDBACK_GAIN / ADC_GRANULARITY)

Over Voltage LOck Out voltage.

Definition at line 1068 of file dpsk3_hwdescr.h.

## ◆ BOOST_VIN_RANGE_MAX

#define BOOST_VIN_RANGE_MAX (float)(ADC_REFERENCE * BOOST_VIN_NORM_INV_G)

Definition at line 1077 of file dpsk3_hwdescr.h.

## ◆ BOOST_VIN_UVLO_RELEASE

#define BOOST_VIN_UVLO_RELEASE (uint16_t)((BOOST_VIN_UNDER_VOLTAGE + BOOST_VIN_HYSTERESIS) * BOOST_VIN_FEEDBACK_GAIN / ADC_GRANULARITY)

Under Voltage LOck Out voltage.

Definition at line 1067 of file dpsk3_hwdescr.h.

## ◆ BOOST_VIN_UVLO_TRIP

#define BOOST_VIN_UVLO_TRIP (uint16_t)(BOOST_VIN_UNDER_VOLTAGE * BOOST_VIN_FEEDBACK_GAIN / ADC_GRANULARITY)

Under Voltage LOck Out voltage.

Definition at line 1066 of file dpsk3_hwdescr.h.