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

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

+ Collaboration diagram for Conversion Macros:

Macros

#define MAIN_EXECUTION_PERIOD   (float)100.0e-6
 Conversion macros of fundamental microcontroller device settings. More...
 
#define CPU_TCY   (float)(1.0 / CPU_FREQUENCY)
 Conversion macros of fundamental microcontroller device settings. More...
 
#define ADC_VALUE_MAX   (uint16_t)((0x0001 << (uint16_t)ADC_RESOLUTION) - 1.0)
 
#define DAC_VALUE_MAX   (uint16_t)((0x0001 << (uint16_t)ADC_RESOLUTION) - 1.0)
 
#define ADC_GRANULARITY   (float)(ADC_REFERENCE / (float)(ADC_VALUE_MAX + 1))
 ADC granularity in [V/tick]. More...
 
#define DAC_GRANULARITY   (float)(DAC_REFERENCE / (float)(DAC_VALUE_MAX + 1))
 DAC granularity in [V/tick]. More...
 
#define PWM_CLOCK_PERIOD   (float)(1.0 / PWM_CLOCK_FREQUENCY)
 PWM Clock Period in [sec]. More...
 
#define DAC_CLOCK_PERIOD   (float)(2.0 / AUX_FREQUENCY)
 DAC Clock Period in [sec]. More...
 
#define DAC_MIN   (uint16_t)(DAC_MINIMUM / DAC_GRANULARITY)
 Integer value of minimum DAC reference. More...
 
#define DAC_MAX   (uint16_t)(DAC_MAXIMUM / DAC_GRANULARITY)
 Integer value of maximum DAC reference. More...
 
#define DAC_TMODTIME   (uint16_t)((DAC_TRANSITION_TIME / AUX_PLL_CLOCK) / 2.0)
 Integer value of transition time period based on most recent auxiliary clock settings. More...
 
#define DAC_SSTIME   (uint16_t)((DAC_STEADY_STATE_TIME / AUX_PLL_CLOCK) / 2.0)
 Integer value of Steady-State time period based on most recent auxiliary clock settings. More...
 
#define DAC_TMCB   (uint16_t)((DAC_LEADING_EDGE_PERIOD / AUX_PLL_CLOCK) / 2.0)
 Integer value of Steady-State time period based on most recent auxiliary clock settings. More...
 

Detailed Description

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

Macro Definition Documentation

◆ ADC_GRANULARITY

#define ADC_GRANULARITY   (float)(ADC_REFERENCE / (float)(ADC_VALUE_MAX + 1))

ADC granularity in [V/tick].

Definition at line 114 of file dspic33c_mcal.h.

◆ ADC_VALUE_MAX

#define ADC_VALUE_MAX   (uint16_t)((0x0001 << (uint16_t)ADC_RESOLUTION) - 1.0)

Definition at line 112 of file dspic33c_mcal.h.

◆ CPU_TCY

#define CPU_TCY   (float)(1.0 / CPU_FREQUENCY)

Conversion macros of fundamental microcontroller device settings.

This section is used to convert device specific parameters like ADC reference and resolution, main execution clock frequency and peripheral time base settings, declared in physical quantities, into binary (integer) numbers to be written to variables and SFRs.Instruction period

Definition at line 111 of file dspic33c_mcal.h.

◆ DAC_CLOCK_PERIOD

#define DAC_CLOCK_PERIOD   (float)(2.0 / AUX_FREQUENCY)

DAC Clock Period in [sec].

Definition at line 117 of file dspic33c_mcal.h.

◆ DAC_GRANULARITY

#define DAC_GRANULARITY   (float)(DAC_REFERENCE / (float)(DAC_VALUE_MAX + 1))

DAC granularity in [V/tick].

Definition at line 115 of file dspic33c_mcal.h.

◆ DAC_MAX

#define DAC_MAX   (uint16_t)(DAC_MAXIMUM / DAC_GRANULARITY)

Integer value of maximum DAC reference.

Definition at line 120 of file dspic33c_mcal.h.

◆ DAC_MIN

#define DAC_MIN   (uint16_t)(DAC_MINIMUM / DAC_GRANULARITY)

Integer value of minimum DAC reference.

Definition at line 119 of file dspic33c_mcal.h.

◆ DAC_SSTIME

#define DAC_SSTIME   (uint16_t)((DAC_STEADY_STATE_TIME / AUX_PLL_CLOCK) / 2.0)

Integer value of Steady-State time period based on most recent auxiliary clock settings.

Definition at line 122 of file dspic33c_mcal.h.

◆ DAC_TMCB

#define DAC_TMCB   (uint16_t)((DAC_LEADING_EDGE_PERIOD / AUX_PLL_CLOCK) / 2.0)

Integer value of Steady-State time period based on most recent auxiliary clock settings.

Definition at line 123 of file dspic33c_mcal.h.

◆ DAC_TMODTIME

#define DAC_TMODTIME   (uint16_t)((DAC_TRANSITION_TIME / AUX_PLL_CLOCK) / 2.0)

Integer value of transition time period based on most recent auxiliary clock settings.

Definition at line 121 of file dspic33c_mcal.h.

◆ DAC_VALUE_MAX

#define DAC_VALUE_MAX   (uint16_t)((0x0001 << (uint16_t)ADC_RESOLUTION) - 1.0)

Definition at line 113 of file dspic33c_mcal.h.

◆ MAIN_EXECUTION_PERIOD

#define MAIN_EXECUTION_PERIOD   (float)100.0e-6

Conversion macros of fundamental microcontroller device settings.

This section is used to convert device specific parameters like ADC reference and resolution, main execution clock frequency and peripheral time base settings, declared in physical quantities, into binary (integer) numbers to be written to variables and SFRs.main state machine function call period in [sec]

Definition at line 145 of file dpsk3_hwdescr.h.

◆ PWM_CLOCK_PERIOD

#define PWM_CLOCK_PERIOD   (float)(1.0 / PWM_CLOCK_FREQUENCY)

PWM Clock Period in [sec].

Definition at line 116 of file dspic33c_mcal.h.