MCUXpresso SDK API Reference Manual  Rev. 0
NXP Semiconductors
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
DCDC: DCDC Converter

Overview

The MCUXpresso SDK provides a p driver for the DCDC Converter (DCDC) module of MCUXpresso SDK devices.

This section describes the programming interface of the DCDC Converter Peripheral driver.

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

Data Structures

struct  dcdc_detection_config_t
 Configuration for DCDC detection. More...
 
struct  dcdc_loop_control_config_t
 Configuration for the loop control. More...
 
struct  dcdc_low_power_config_t
 Configuration for DCDC low power. More...
 
struct  dcdc_internal_regulator_config_t
 Configuration for DCDC internal regulator. More...
 
struct  dcdc_min_power_config_t
 Configuration for min power setting. More...
 

Macros

#define FSL_DCDC_DRIVER_VERSION   (MAKE_VERSION(2, 0, 0))
 DCDC driver version. More...
 

Enumerations

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...
 

Variables

bool dcdc_detection_config_t::enableXtalokDetection
 Enable xtalok detection circuit. More...
 
bool dcdc_detection_config_t::powerDownOverVoltageDetection
 Power down over-voltage detection comparator. More...
 
bool dcdc_detection_config_t::powerDownLowVlotageDetection
 Power down low-voltage detection comparator. More...
 
bool dcdc_detection_config_t::powerDownOverCurrentDetection
 Power down over-current detection. More...
 
bool dcdc_detection_config_t::powerDownPeakCurrentDetection
 Power down peak-current detection. More...
 
bool dcdc_detection_config_t::powerDownZeroCrossDetection
 Power down the zero cross detection function for discontinuous conductor mode. More...
 
dcdc_over_current_threshold_t dcdc_detection_config_t::OverCurrentThreshold
 The threshold of over current detection. More...
 
dcdc_peak_current_threshold_t dcdc_detection_config_t::PeakCurrentThreshold
 The threshold of peak current detection. More...
 
bool dcdc_loop_control_config_t::enableCommonHysteresis
 Enable hysteresis in switching converter common mode analog comparators. More...
 
bool dcdc_loop_control_config_t::enableCommonThresholdDetection
 Increase the threshold detection for common mode analog comparator. More...
 
bool dcdc_loop_control_config_t::enableInvertHysteresisSign
 Invert the sign of the hysteresis in DC-DC analog comparators. More...
 
bool dcdc_loop_control_config_t::enableRCThresholdDetection
 Increase the threshold detection for RC scale circuit. More...
 
uint32_t dcdc_loop_control_config_t::enableRCScaleCircuit
 Available range is 0~7. More...
 
uint32_t dcdc_loop_control_config_t::complementFeedForwardStep
 Available range is 0~7. More...
 
uint32_t dcdc_loop_control_config_t::controlParameterMagnitude
 Available range is 0~15. More...
 
uint32_t dcdc_loop_control_config_t::integralProportionalRatio
 Available range is 0~3.Ratio of integral control parameter to proportional control parameter in the switching DC-DC converter, and can be used to optimize efficiency and loop response. More...
 
bool dcdc_low_power_config_t::enableOverloadDetection
 Enable the overload detection in power save mode, if current is larger than the overloading threshold (typical value is 50 mA), DCDC will switch to the run mode automatically. More...
 
bool dcdc_low_power_config_t::enableAdjustHystereticValue
 Adjust hysteretic value in low power from 12.5mV to 25mV. More...
 
dcdc_count_charging_time_period_t dcdc_low_power_config_t::countChargingTimePeriod
 The period of counting the charging times in power save mode. More...
 
dcdc_count_charging_time_threshold_t dcdc_low_power_config_t::countChargingTimeThreshold
 the threshold of the counting number of charging times during the period that lp_overload_freq_sel sets in power save mode. More...
 
bool dcdc_internal_regulator_config_t::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 dcdc_internal_regulator_config_t::feedbackPoint
 Available range is 0~3. More...
 
bool dcdc_min_power_config_t::enableUseHalfFreqForContinuous
 Set DCDC clock to half frequency for the continuous mode. More...
 

Initialization and deinitialization

void DCDC_Init (DCDC_Type *base)
 Enable the access to DCDC registers. More...
 
void DCDC_Deinit (DCDC_Type *base)
 Disable the access to DCDC registers. More...
 

Status

uint32_t DCDC_GetstatusFlags (DCDC_Type *base)
 Get DCDC status flags. More...
 

Misc control.

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_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...
 

Application guideline.

void DCDC_BootIntoDCM (DCDC_Type *base)
 Boot DCDC into DCM(discontinous conduction mode). More...
 
void DCDC_BootIntoCCM (DCDC_Type *base)
 Boot DCDC into CCM(continous conduction mode). More...
 

Data Structure Documentation

struct dcdc_detection_config_t

Data Fields

bool enableXtalokDetection
 Enable xtalok detection circuit. More...
 
bool powerDownOverVoltageDetection
 Power down over-voltage detection comparator. More...
 
bool powerDownLowVlotageDetection
 Power down low-voltage detection comparator. More...
 
bool powerDownOverCurrentDetection
 Power down over-current detection. More...
 
bool powerDownPeakCurrentDetection
 Power down peak-current detection. More...
 
bool powerDownZeroCrossDetection
 Power down the zero cross detection function for discontinuous conductor mode. More...
 
dcdc_over_current_threshold_t OverCurrentThreshold
 The threshold of over current detection. More...
 
dcdc_peak_current_threshold_t PeakCurrentThreshold
 The threshold of peak current detection. More...
 
struct dcdc_loop_control_config_t

Data Fields

bool enableCommonHysteresis
 Enable hysteresis in switching converter common mode analog comparators. More...
 
bool enableCommonThresholdDetection
 Increase the threshold detection for common mode analog comparator. More...
 
bool enableInvertHysteresisSign
 Invert the sign of the hysteresis in DC-DC analog comparators. More...
 
bool enableRCThresholdDetection
 Increase the threshold detection for RC scale circuit. More...
 
uint32_t enableRCScaleCircuit
 Available range is 0~7. More...
 
uint32_t complementFeedForwardStep
 Available range is 0~7. More...
 
uint32_t controlParameterMagnitude
 Available range is 0~15. More...
 
uint32_t integralProportionalRatio
 Available range is 0~3.Ratio of integral control parameter to proportional control parameter in the switching DC-DC converter, and can be used to optimize efficiency and loop response. More...
 
struct dcdc_low_power_config_t

Data Fields

bool enableOverloadDetection
 Enable the overload detection in power save mode, if current is larger than the overloading threshold (typical value is 50 mA), DCDC will switch to the run mode automatically. More...
 
bool enableAdjustHystereticValue
 Adjust hysteretic value in low power from 12.5mV to 25mV. More...
 
dcdc_count_charging_time_period_t countChargingTimePeriod
 The period of counting the charging times in power save mode. More...
 
dcdc_count_charging_time_threshold_t countChargingTimeThreshold
 the threshold of the counting number of charging times during the period that lp_overload_freq_sel sets in power save mode. More...
 
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...
 
struct dcdc_min_power_config_t

Data Fields

bool enableUseHalfFreqForContinuous
 Set DCDC clock to half frequency for the continuous mode. More...
 

Macro Definition Documentation

#define FSL_DCDC_DRIVER_VERSION   (MAKE_VERSION(2, 0, 0))

Version 2.0.0.

Enumeration Type Documentation

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.

Function Documentation

void DCDC_Init ( DCDC_Type *  base)
Parameters
baseDCDC peripheral base address.
void DCDC_Deinit ( DCDC_Type *  base)
Parameters
baseDCDC peripheral base address.
uint32_t DCDC_GetstatusFlags ( DCDC_Type *  base)
Parameters
baseperipheral 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
baseDCDC peripheral base address.
enableEnable the feature or not.
void DCDC_SetClockSource ( DCDC_Type *  base,
dcdc_clock_source_t  clockSource 
)
Parameters
baseDCDC peripheral base address.
clockSourceClock source for DCDC. See to "dcdc_clock_source_t".
void DCDC_GetDefaultDetectionConfig ( dcdc_detection_config_t config)

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;
* config->OverCurrentThreshold = kDCDC_OverCurrentThresholdAlt0;
* config->PeakCurrentThreshold = kDCDC_PeakCurrentThresholdAlt0;
*
Parameters
configPointer to configuration structure. See to "dcdc_detection_config_t"
void DCDC_SetDetectionConfig ( DCDC_Type *  base,
const dcdc_detection_config_t config 
)
Parameters
baseDCDC peripheral base address.
configPointer to configuration structure. See to "dcdc_detection_config_t"
void DCDC_GetDefaultLowPowerConfig ( dcdc_low_power_config_t config)

The default configuration are set according to responding registers' setting when powered on. They are:

* config->enableOverloadDetection = true;
* config->enableAdjustHystereticValue = false;
* config->countChargingTimePeriod = kDCDC_CountChargingTimePeriod8Cycle;
* config->countChargingTimeThreshold = kDCDC_CountChargingTimeThreshold32;
*
Parameters
configPointer to configuration structure. See to "dcdc_low_power_config_t"
void DCDC_SetLowPowerConfig ( DCDC_Type *  base,
const dcdc_low_power_config_t config 
)
Parameters
baseDCDC peripheral base address.
configPointer 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
baseDCDC peripheral base address.
enableSwitcher 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
baseDCDC peripheral base address.
TrimValueThe bangap trim value. Available range is 0U-31U.
void DCDC_GetDefaultLoopControlConfig ( dcdc_loop_control_config_t config)

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
configPointer to configuration structure. See to "dcdc_loop_control_config_t"
void DCDC_SetLoopControlConfig ( DCDC_Type *  base,
const dcdc_loop_control_config_t config 
)
Parameters
baseDCDC peripheral base address.
configPointer to configuration structure. See to "dcdc_loop_control_config_t".
void DCDC_SetMinPowerConfig ( DCDC_Type *  base,
const dcdc_min_power_config_t config 
)
Parameters
baseDCDC peripheral base address.
configPointer to configuration structure. See to "dcdc_min_power_config_t".
static void DCDC_SetLPComparatorBiasValue ( DCDC_Type *  base,
dcdc_comparator_current_bias_t  biasVaule 
)
inlinestatic
Parameters
baseDCDC peripheral base address.
biasVauleThe 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 
)

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
baseDCDC peripheral base address.
VDDRunTarget value in run mode. 25 mV each step from 0x00 to 0x1F. 00 is for 0.8V, 0x1F is for 1.575V.
VDDStandbyTarget 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_SetInternalRegulatorConfig ( DCDC_Type *  base,
const dcdc_internal_regulator_config_t config 
)
Parameters
baseDCDC peripheral base address.
configPointer to configuration structure. See to "dcdc_internal_regulator_config_t".
static void DCDC_EnableAdjustDelay ( DCDC_Type *  base,
bool  enable 
)
inlinestatic
Parameters
baseDCDC peripheral base address.
enableEnable 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
baseDCDC peripheral base address.
enableEnable 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
baseDCDC peripheral base address.
void DCDC_BootIntoCCM ( DCDC_Type *  base)

pwd_zcd=0x1; pwd_cmp_offset=0x0; dcdc_loopctrl_en_rcscale=0x3;

Parameters
baseDCDC peripheral base address.

Variable Documentation

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
dcdc_over_current_threshold_t dcdc_detection_config_t::OverCurrentThreshold
dcdc_peak_current_threshold_t dcdc_detection_config_t::PeakCurrentThreshold
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
bool dcdc_low_power_config_t::enableOverloadDetection
bool dcdc_low_power_config_t::enableAdjustHystereticValue
dcdc_count_charging_time_period_t dcdc_low_power_config_t::countChargingTimePeriod
dcdc_count_charging_time_threshold_t dcdc_low_power_config_t::countChargingTimeThreshold
bool dcdc_internal_regulator_config_t::enableLoadResistor
uint32_t dcdc_internal_regulator_config_t::feedbackPoint

Select the feedback point of the internal regulator.

bool dcdc_min_power_config_t::enableUseHalfFreqForContinuous