Digital Power Starter Kit 3 Firmware
dsPIC33C Buck Converter Voltage Mode Control Example
+ Collaboration diagram for Digital-to-Analog Converter:
volatile uint16_t sysDacModule_Initialize (void)
 DAC Module Base Register Initialization. More...
 
volatile uint16_t sysDacOutput_Initialize (volatile uint16_t dacInstance, volatile uint16_t initValue)
 Initializes a user specified DAC instance with DAC output enabled. More...
 
volatile uint16_t sysDacOutput_Enable (volatile uint16_t dacInstance)
 
volatile uint16_t sysDacOutput_Disable (volatile uint16_t dacInstance)
 

Detailed Description

DPSK3 uses one of the available on-chip Digital-to-Analog Converters (DAC) to generate a dynamic, analog output signal, which can be used for enhanced debugging of high-speed processes such as control output monitoring.

Note
The DAC output signal is buffered by utilizing one of the available on-chip operational amplifiers. Please refer to the Operational Amplifier Configuration section for details.

Function Documentation

◆ sysDacModule_Initialize()

uint16_t sysDacModule_Initialize ( void  )

DAC Module Base Register Initialization.

Returns
unsigned integer
0=failure
1=success

This function initializes the DAC module base registers for being operated by the auxiliary oscillator at an input clock frequency of 500 MHz.

In this application the DAC is used to provide a constant reference voltage of VDD/2 = 1.65 V to the external current sense shunt amplifier devices. Neither, built-in comparator nor Pulse-Density Modulator (PDM) ramp generator are used.

Definition at line 39 of file init_dac.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ sysDacOutput_Disable()

volatile uint16_t sysDacOutput_Disable ( volatile uint16_t  dacInstance)

Definition at line 129 of file init_dac.c.

+ Here is the call graph for this function:

◆ sysDacOutput_Enable()

volatile uint16_t sysDacOutput_Enable ( volatile uint16_t  dacInstance)

Definition at line 99 of file init_dac.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ sysDacOutput_Initialize()

uint16_t sysDacOutput_Initialize ( volatile uint16_t  dacInstance,
volatile uint16_t  initValue 
)

Initializes a user specified DAC instance with DAC output enabled.

Parameters
dacInstanceIndex of the selected DAC Instance (1=DAC1, 2=DAC2, etc.)
initValueInteger value at startup of the DAC peripheral instance
Returns
unsigned integer (0=failure, 1=success)

This function clears all registers of the declared DAC instance and initializes the registers required by a static Digital-to-Analog Converter output with the given default values.

Note
The initialization function does not enable the DAC instance. Please use function sysDacOutput_Enable() to turn on the DAC instance at the appropriate time.

Definition at line 71 of file init_dac.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function: