|
Digital Power Starter Kit 3 Firmware
dsPIC33C Buck Converter Voltage Mode Control Example
|
|
10 #include "config/hal.h"
11 #include "config/apps.h"
62 volatile uint16_t FaultRecoveryCounter=0;
83 volatile uint16_t retval=1;
84 static bool pre_fault_active=
false;
116 FaultRecoveryCounter = 0;
140 volatile uint16_t retval=1;
196 volatile uint16_t retval=1;
241 volatile uint16_t retval=1;
284 volatile uint16_t retval=1;
327 volatile uint16_t retval=1;
#define BUCK_OVLO_RDLY
over voltage lock out recovery delay conversion nacro
volatile uint16_t appPowerSupply_Resume(void)
This function resumes the power supply operation.
#define BUCK_VOUT_DEV_TRIP
Macro calculating the integer number equivalent of the maximum allowed output voltage deviation given...
#define BUCK_OCP_TDLY
over current protection trip Delay conversion macro
volatile struct FAULT_OBJECT_s fltobj_BuckRegErr
Regulation Error Fault Object.
enum FLT_COMPARE_TYPE_e CompareType
Bit <10:8>: Fault check comparison type control bits.
#define BUCK_REGERR_RDLY
regulation error recovery delay conversion macro
volatile struct FLT_EVENT_RESPONSE_s RecoveryResponse
Settings defining the fault recovery event.
volatile uint16_t v_in
BUCK input voltage.
volatile struct FAULT_OBJECT_s fltobj_BuckUVLO
Under Voltage Lock Out Fault Object.
volatile struct BUCK_CONVERTER_STATUS_s status
BUCK operation status bits.
volatile struct FLT_OBJECT_STATUS_s Status
Status word of this fault object.
#define BUCK_UVLO_RDLY
under voltage lock out recovery delay conversion nacro
volatile struct FLT_EVENT_RESPONSE_s TripResponse
Settings defining the fault trip event.
volatile bool FaultActive
Bit 1: Flag bit indicating if fault condition has been detected but FAULT has not been tripped yet.
volatile struct FAULT_OBJECT_s fltObjectClear
Clears the fault objects.
volatile struct FLT_COMPARE_OBJECT_s SourceObject
Object which should be monitored.
volatile bool fault_active
Bit #5: Flag bit indicating system is in enforced shut down mode (usually due to a fault condition)
#define BUCK_ISNS_OCL_RELEASE
Over Current Release Level.
volatile struct FLT_COMPARE_OBJECT_s ReferenceObject
Reference object the source should be compared with.
volatile uint16_t eventThreshold
Bit mask will be &-ed with source as value (use 0xFFFF for full value comparison)
volatile uint16_t appPowerSupply_Suspend(void)
This function stops the power supply operation.
volatile uint16_t compareThreshold
Signal level at which the fault condition will be detected.
volatile bool Enabled
Bit 15: Control bit enabling/disabling monitoring of the fault object.
volatile uint16_t drv_FaultHandler_CheckObject(volatile struct FAULT_OBJECT_s *fltObject)
Check current fault status of a user-defined fault object.
volatile struct BUCK_CONVERTER_DATA_s data
BUCK runtime data.
#define BUCK_UVLO_TDLY
Conversion Macros of Fault Response Timing Settings.
#define BUCK_ISNS_OCL
Over Current Limit.
volatile uint16_t * ptrObject
Pointer to register or variable which should be monitored.
volatile uint16_t v_ref
User reference setting used to control the power converter controller.
volatile uint16_t(* ptrResponseFunction)(void)
pointer to a user-defined function called when a defined fault monitoring event is detected
volatile struct BUCK_CONVERTER_SETTINGS_s set_values
Control field for global access to references.
volatile uint16_t i_out
BUCK common output current.
volatile uint16_t Counter
Fault event counter (controlled by FAULT HANDLER)
#define BUCK_VIN_OVLO_TRIP
Over Voltage LOck Out voltage.
This data structure is a collection of data structures for fault handling.
volatile uint16_t ocp_FaultInitialize(void)
Initializes the user-defined fault objects for overcurrent protection.
volatile uint16_t bitMask
Bit mask will be &-ed with source as value (use 0xFFFF for full value comparison)
volatile struct FAULT_OBJECT_s fltobj_BuckOVLO
Over Voltage Lock Out Fault Object.
#define BUCK_VOUT_DEV_RELEASE
Macro calculating the integer number equivalent of the maximum allowed output voltage deviation given...
volatile bool FaultStatus
Bit 0: Flag bit indicating if FAULT has been tripped.
volatile struct FAULT_OBJECT_s fltobj_BuckOCP
Over Current Protection Fault Object.
volatile uint16_t appFaultMonitor_Execute(void)
Application wide fault object monitoring routine.
struct BUCK_STATE_ID_s::@3::@4 bits
#define BUCK_VIN_OVLO_RELEASE
Over Voltage LOck Out voltage.
volatile struct BUCK_STATE_ID_s state_id
BUCK state machine operating state ID.
#define BUCK_VIN_UVLO_TRIP
Under Voltage LOck Out voltage.
volatile uint16_t appFaultMonitor_Dispose(void)
Function clearing all fault object settings.
volatile uint16_t regerr_FaultInitialize(void)
Initializes the user-defined fault objects for regulation error.
#define BUCK_OCP_RDLY
over current protection recovery delay conversion nacro
volatile uint16_t ovlo_FaultInitialize(void)
Initializes the user-defined fault objects for overvoltage lockout.
volatile uint16_t appFaultMonitor_Initialize(void)
Initialization of user-defined fault objects.
volatile uint16_t uvlo_FaultInitialize(void)
Initializes the user-defined fault objects for under-voltage lockout.
#define BUCK_VIN_UVLO_RELEASE
Under Voltage LOck Out voltage.
volatile struct BUCK_CONVERTER_s buck
Global data object for a BUCK CONVERTER.
#define BUCK_FAULT_RESTART_CYCLES
Maximum number of restart cycles: Fault state will be latched until CPU reset or power cycle.
volatile uint16_t v_out
BUCK output voltage.
#define BUCK_REGERR_TDLY
regulation error trip delay conversion macro
#define BUCK_OVLO_TDLY
over voltage lock out trip delay conversion nacro