The MCUXpresso SDK provides a peripheral driver for the DCDC Converter (DCDC) module of MCUXpresso SDK devices.
The DCDC converter module is a synchronous buck mode DCDC converter. It can produce single outputs for SoC peripherals and external devices with high conversion efficiency. The converter can be operated in continuous or pulsed mode.
As a module to provide the power for hardware system, the DCDC starts working when the system is powered up before the software takes over the SoC. Some important configuration is done by the board settings. Before the software can access the DCDC's registers, the DCDC is already working normally with the default settings.
However, if the application needs to improve the DCDC's performance or change the default settings, the DCDC driver would help. The DCDC's register cannot be accessed by software before its initialization (open the clock gate). The user can configure the hardware according to the application guide from reference manual.
Function groups
Initialization and deinitialization
This function group is to enable/disable the operations to DCDC module through the driver.
Status
Provides functions to get the DCDC status.
Misc control
Provides functions to set the DCDC's miscellaneous control.
Application guideline
Continous conduction mode
Discontinous conduction mode
/*!
|
enum | _dcdc_status_flags_t { kDCDC_LockedOKStatus = (1U << 0U)
} |
| DCDC status flags. More...
|
|
enum | dcdc_comparator_current_bias_t {
kDCDC_ComparatorCurrentBias50nA = 0U,
kDCDC_ComparatorCurrentBias100nA = 1U,
kDCDC_ComparatorCurrentBias200nA = 2U,
kDCDC_ComparatorCurrentBias400nA = 3U
} |
| The current bias of low power comparator. More...
|
|
enum | dcdc_over_current_threshold_t {
kDCDC_OverCurrentThresholdAlt0 = 0U,
kDCDC_OverCurrentThresholdAlt1 = 1U,
kDCDC_OverCurrentThresholdAlt2 = 2U,
kDCDC_OverCurrentThresholdAlt3 = 3U
} |
| The threshold of over current detection. More...
|
|
enum | dcdc_peak_current_threshold_t {
kDCDC_PeakCurrentThresholdAlt0 = 0U,
kDCDC_PeakCurrentThresholdAlt1 = 1U,
kDCDC_PeakCurrentThresholdAlt2 = 2U,
kDCDC_PeakCurrentThresholdAlt3 = 3U,
kDCDC_PeakCurrentThresholdAlt4 = 4U,
kDCDC_PeakCurrentThresholdAlt5 = 5U
} |
| The threshold if peak current detection. More...
|
|
enum | dcdc_count_charging_time_period_t {
kDCDC_CountChargingTimePeriod8Cycle = 0U,
kDCDC_CountChargingTimePeriod16Cycle = 1U
} |
| The period of counting the charging times in power save mode. More...
|
|
enum | dcdc_count_charging_time_threshold_t {
kDCDC_CountChargingTimeThreshold32 = 0U,
kDCDC_CountChargingTimeThreshold64 = 1U,
kDCDC_CountChargingTimeThreshold16 = 2U,
kDCDC_CountChargingTimeThreshold8 = 3U
} |
| The threshold of the counting number of charging times. More...
|
|
enum | dcdc_clock_source_t {
kDCDC_ClockAutoSwitch = 0U,
kDCDC_ClockInternalOsc = 1U,
kDCDC_ClockExternalOsc = 2U
} |
| Oscillator clock option. More...
|
|
|
static void | DCDC_EnableOutputRangeComparator (DCDC_Type *base, bool enable) |
| Enable the output range comparator. More...
|
|
void | DCDC_SetClockSource (DCDC_Type *base, dcdc_clock_source_t clockSource) |
| Configure the DCDC clock source. More...
|
|
void | DCDC_GetDefaultDetectionConfig (dcdc_detection_config_t *config) |
| Get the default setting for detection configuration. More...
|
|
void | DCDC_SetDetectionConfig (DCDC_Type *base, const dcdc_detection_config_t *config) |
| Configure the DCDC detection. More...
|
|
void | DCDC_GetDefaultLowPowerConfig (dcdc_low_power_config_t *config) |
| Get the default setting for low power configuration. More...
|
|
void | DCDC_SetLowPowerConfig (DCDC_Type *base, const dcdc_low_power_config_t *config) |
| Configure the DCDC low power. More...
|
|
void | DCDC_ResetCurrentAlertSignal (DCDC_Type *base, bool enable) |
| Reset current alert signal. More...
|
|
static void | DCDC_SetBandgapVoltageTrimValue (DCDC_Type *base, uint32_t trimValue) |
| Set the bangap trim value to trim bandgap voltage. More...
|
|
void | DCDC_GetDefaultLoopControlConfig (dcdc_loop_control_config_t *config) |
| Get the default setting for loop control configuration. More...
|
|
void | DCDC_SetLoopControlConfig (DCDC_Type *base, const dcdc_loop_control_config_t *config) |
| Configure the DCDC loop control. More...
|
|
void | DCDC_SetMinPowerConfig (DCDC_Type *base, const dcdc_min_power_config_t *config) |
| Configure for the min power. More...
|
|
static void | DCDC_SetLPComparatorBiasValue (DCDC_Type *base, dcdc_comparator_current_bias_t biasVaule) |
| Set the current bias of low power comparator. More...
|
|
static void | DCDC_LockTargetVoltage (DCDC_Type *base) |
|
void | DCDC_AdjustTargetVoltage (DCDC_Type *base, uint32_t VDDRun, uint32_t VDDStandby) |
| Adjust the target voltage of VDD_SOC in run mode and low power mode. More...
|
|
void | DCDC_AdjustRunTargetVoltage (DCDC_Type *base, uint32_t VDDRun) |
| Adjust the target voltage of VDD_SOC in run mode. More...
|
|
void | DCDC_AdjustLowPowerTargetVoltage (DCDC_Type *base, uint32_t VDDStandby) |
| Adjust the target voltage of VDD_SOC in low power mode. More...
|
|
void | DCDC_SetInternalRegulatorConfig (DCDC_Type *base, const dcdc_internal_regulator_config_t *config) |
| Configure the DCDC internal regulator. More...
|
|
static void | DCDC_EnableAdjustDelay (DCDC_Type *base, bool enable) |
| Ajust delay to reduce ground noise. More...
|
|
static void | DCDC_EnableImproveTransition (DCDC_Type *base, bool enable) |
| Enable/Disable to improve the transition from heavy load to light load. More...
|
|
struct dcdc_detection_config_t |
bool dcdc_detection_config_t::enableXtalokDetection |
bool dcdc_detection_config_t::powerDownOverVoltageDetection |
bool dcdc_detection_config_t::powerDownLowVlotageDetection |
bool dcdc_detection_config_t::powerDownOverCurrentDetection |
bool dcdc_detection_config_t::powerDownPeakCurrentDetection |
bool dcdc_detection_config_t::powerDownZeroCrossDetection |
struct dcdc_loop_control_config_t |
bool dcdc_loop_control_config_t::enableCommonHysteresis |
This feature will improve transient supply ripple and efficiency.
bool dcdc_loop_control_config_t::enableCommonThresholdDetection |
bool dcdc_loop_control_config_t::enableInvertHysteresisSign |
bool dcdc_loop_control_config_t::enableRCThresholdDetection |
uint32_t dcdc_loop_control_config_t::enableRCScaleCircuit |
Enable analog circuit of DC-DC converter to respond faster under transient load conditions.
uint32_t dcdc_loop_control_config_t::complementFeedForwardStep |
Two's complement feed forward step in duty cycle in the switching DC-DC converter. Each time this field makes a transition from 0x0, the loop filter of the DC-DC converter is stepped once by a value proportional to the change. This can be used to force a certain control loop behavior, such as improving response under known heavy load transients.
uint32_t dcdc_loop_control_config_t::controlParameterMagnitude |
Magnitude of proportional control parameter in the switching DC-DC converter control loop.
uint32_t dcdc_loop_control_config_t::integralProportionalRatio |
struct dcdc_low_power_config_t |
bool dcdc_low_power_config_t::enableOverloadDetection |
bool dcdc_low_power_config_t::enableAdjustHystereticValue |
struct dcdc_internal_regulator_config_t |
Data Fields |
bool | enableLoadResistor |
| control the load resistor of the internal regulator of DCDC, the load resistor is connected as default "true", and need set to "false" to disconnect the load resistor. More...
|
|
uint32_t | feedbackPoint |
| Available range is 0~3. More...
|
|
bool dcdc_internal_regulator_config_t::enableLoadResistor |
uint32_t dcdc_internal_regulator_config_t::feedbackPoint |
Select the feedback point of the internal regulator.
struct dcdc_min_power_config_t |
bool dcdc_min_power_config_t::enableUseHalfFreqForContinuous |
Enumerator |
---|
kDCDC_LockedOKStatus |
Indicate DCDC status.
1'b1: DCDC already settled 1'b0: DCDC is settling.
|
Enumerator |
---|
kDCDC_ComparatorCurrentBias50nA |
The current bias of low power comparator is 50nA.
|
kDCDC_ComparatorCurrentBias100nA |
The current bias of low power comparator is 100nA.
|
kDCDC_ComparatorCurrentBias200nA |
The current bias of low power comparator is 200nA.
|
kDCDC_ComparatorCurrentBias400nA |
The current bias of low power comparator is 400nA.
|
Enumerator |
---|
kDCDC_OverCurrentThresholdAlt0 |
1A in the run mode, 0.25A in the power save mode.
|
kDCDC_OverCurrentThresholdAlt1 |
2A in the run mode, 0.25A in the power save mode.
|
kDCDC_OverCurrentThresholdAlt2 |
1A in the run mode, 0.2A in the power save mode.
|
kDCDC_OverCurrentThresholdAlt3 |
2A in the run mode, 0.2A in the power save mode.
|
Enumerator |
---|
kDCDC_PeakCurrentThresholdAlt0 |
150mA peak current threshold.
|
kDCDC_PeakCurrentThresholdAlt1 |
250mA peak current threshold.
|
kDCDC_PeakCurrentThresholdAlt2 |
350mA peak current threshold.
|
kDCDC_PeakCurrentThresholdAlt3 |
450mA peak current threshold.
|
kDCDC_PeakCurrentThresholdAlt4 |
550mA peak current threshold.
|
kDCDC_PeakCurrentThresholdAlt5 |
650mA peak current threshold.
|
Enumerator |
---|
kDCDC_CountChargingTimePeriod8Cycle |
Eight 32k cycle.
|
kDCDC_CountChargingTimePeriod16Cycle |
Sixteen 32k cycle.
|
Enumerator |
---|
kDCDC_CountChargingTimeThreshold32 |
0x0: 32.
|
kDCDC_CountChargingTimeThreshold64 |
0x1: 64.
|
kDCDC_CountChargingTimeThreshold16 |
0x2: 16.
|
kDCDC_CountChargingTimeThreshold8 |
0x3: 8.
|
Enumerator |
---|
kDCDC_ClockAutoSwitch |
Automatic clock switch from internal oscillator to external clock.
|
kDCDC_ClockInternalOsc |
Use internal oscillator.
|
kDCDC_ClockExternalOsc |
Use external 24M crystal oscillator.
|
void DCDC_Init |
( |
DCDC_Type * |
base | ) |
|
- Parameters
-
base | DCDC peripheral base address. |
void DCDC_Deinit |
( |
DCDC_Type * |
base | ) |
|
- Parameters
-
base | DCDC peripheral base address. |
uint32_t DCDC_GetstatusFlags |
( |
DCDC_Type * |
base | ) |
|
- Parameters
-
base | peripheral base address. |
- Returns
- Mask of asserted status flags. See to "_dcdc_status_flags_t".
static void DCDC_EnableOutputRangeComparator |
( |
DCDC_Type * |
base, |
|
|
bool |
enable |
|
) |
| |
|
inlinestatic |
The output range comparator is disabled by default.
- Parameters
-
base | DCDC peripheral base address. |
enable | Enable the feature or not. |
- Parameters
-
base | DCDC peripheral base address. |
clockSource | Clock source for DCDC. See to "dcdc_clock_source_t". |
The default configuration are set according to responding registers' setting when powered on. They are:
* config->enableXtalokDetection = false;
* config->powerDownOverVoltageDetection = true;
* config->powerDownLowVlotageDetection = false;
* config->powerDownOverCurrentDetection = true;
* config->powerDownPeakCurrentDetection = true;
* config->powerDownZeroCrossDetection = true;
*
- Parameters
-
config | Pointer to configuration structure. See to "dcdc_detection_config_t" |
- Parameters
-
base | DCDC peripheral base address. |
config | Pointer to configuration structure. See to "dcdc_detection_config_t" |
The default configuration are set according to responding registers' setting when powered on. They are:
* config->enableOverloadDetection = true;
* config->enableAdjustHystereticValue = false;
*
- Parameters
-
config | Pointer to configuration structure. See to "dcdc_low_power_config_t" |
- Parameters
-
base | DCDC peripheral base address. |
config | Pointer to configuration structure. See to "dcdc_low_power_config_t". |
void DCDC_ResetCurrentAlertSignal |
( |
DCDC_Type * |
base, |
|
|
bool |
enable |
|
) |
| |
Alert signal is generate by peak current detection.
- Parameters
-
base | DCDC peripheral base address. |
enable | Switcher to reset signal. True means reset signal. False means don't reset signal. |
static void DCDC_SetBandgapVoltageTrimValue |
( |
DCDC_Type * |
base, |
|
|
uint32_t |
trimValue |
|
) |
| |
|
inlinestatic |
- Parameters
-
base | DCDC peripheral base address. |
trimValue | The bangap trim value. Available range is 0U-31U. |
The default configuration are set according to responding registers' setting when powered on. They are:
* config->enableCommonHysteresis = false;
* config->enableCommonThresholdDetection = false;
* config->enableInvertHysteresisSign = false;
* config->enableRCThresholdDetection = false;
* config->enableRCScaleCircuit = 0U;
* config->complementFeedForwardStep = 0U;
* config->controlParameterMagnitude = 2U;
* config->integralProportionalRatio = 2U;
*
- Parameters
-
config | Pointer to configuration structure. See to "dcdc_loop_control_config_t" |
- Parameters
-
base | DCDC peripheral base address. |
config | Pointer to configuration structure. See to "dcdc_loop_control_config_t". |
- Parameters
-
base | DCDC peripheral base address. |
config | Pointer to configuration structure. See to "dcdc_min_power_config_t". |
- Parameters
-
base | DCDC peripheral base address. |
biasVaule | The current bias of low power comparator. Refer to "dcdc_comparator_current_bias_t". |
void DCDC_AdjustTargetVoltage |
( |
DCDC_Type * |
base, |
|
|
uint32_t |
VDDRun, |
|
|
uint32_t |
VDDStandby |
|
) |
| |
- Deprecated:
- Do not use this function. It has been superceded by DCDC_AdjustRunTargetVoltage and DCDC_AdjustLowPowerTargetVoltage
This function is to adjust the target voltage of DCDC output. Change them and finally wait until the output is stabled. Set the target value of run mode the same as low power mode before entering power save mode, because DCDC will switch back to run mode if it detects the current loading is larger than about 50 mA(typical value).
- Parameters
-
base | DCDC peripheral base address. |
VDDRun | Target value in run mode. 25 mV each step from 0x00 to 0x1F. 00 is for 0.8V, 0x1F is for 1.575V. |
VDDStandby | Target value in low power mode. 25 mV each step from 0x00 to 0x4. 00 is for 0.9V, 0x4 is for 1.0V. |
void DCDC_AdjustRunTargetVoltage |
( |
DCDC_Type * |
base, |
|
|
uint32_t |
VDDRun |
|
) |
| |
This function is to adjust the target voltage of DCDC output. Change them and finally wait until the output is stabled. Set the target value of run mode the same as low power mode before entering power save mode, because DCDC will switch back to run mode if it detects the current loading is larger than about 50 mA(typical value).
- Parameters
-
base | DCDC peripheral base address. |
VDDRun | Target value in run mode. 25 mV each step from 0x00 to 0x1F. 00 is for 0.8V, 0x1F is for 1.575V. |
void DCDC_AdjustLowPowerTargetVoltage |
( |
DCDC_Type * |
base, |
|
|
uint32_t |
VDDStandby |
|
) |
| |
This function is to adjust the target voltage of DCDC output. Change them and finally wait until the output is stabled. Set the target value of run mode the same as low power mode before entering power save mode, because DCDC will switch back to run mode if it detects the current loading is larger than about 50 mA(typical value).
- Parameters
-
base | DCDC peripheral base address. |
VDDStandby | Target value in low power mode. 25 mV each step from 0x00 to 0x4. 00 is for 0.9V, 0x4 is for 1.0V. |
- Parameters
-
base | DCDC peripheral base address. |
config | Pointer to configuration structure. See to "dcdc_internal_regulator_config_t". |
static void DCDC_EnableAdjustDelay |
( |
DCDC_Type * |
base, |
|
|
bool |
enable |
|
) |
| |
|
inlinestatic |
- Parameters
-
base | DCDC peripheral base address. |
enable | Enable the feature or not. |
static void DCDC_EnableImproveTransition |
( |
DCDC_Type * |
base, |
|
|
bool |
enable |
|
) |
| |
|
inlinestatic |
It is valid while zero cross detection is enabled. If ouput exceeds the threshold, DCDC would return CCM from DCM.
- Parameters
-
base | DCDC peripheral base address. |
enable | Enable the feature or not. |
void DCDC_BootIntoDCM |
( |
DCDC_Type * |
base | ) |
|
pwd_zcd=0x0; pwd_cmp_offset=0x0; dcdc_loopctrl_en_rcscale=0x3 or 0x5; DCM_set_ctrl=1'b1;
- Parameters
-
base | DCDC peripheral base address. |
void DCDC_BootIntoCCM |
( |
DCDC_Type * |
base | ) |
|
pwd_zcd=0x1; pwd_cmp_offset=0x0; dcdc_loopctrl_en_rcscale=0x3;
- Parameters
-
base | DCDC peripheral base address. |