Jump to content

Component: DAC Quad (MCP4728) (MCP4728) (Analog Output): Difference between revisions

From Flowcode Help
m Text replacement - "style="background-color:#EAE1EA; color:#4B008D;"" to "class="mtx-class-propfolder""
m Text replacement - "style="background-color:#EAE1EA;"" to "class="mtx-class-propfolder""
 
Line 272: Line 272:
| colspan="2" | Specifies the Resolution per digital bit in terms of Voltage. 
| colspan="2" | Specifies the Resolution per digital bit in terms of Voltage. 
|-
|-
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
| width="10%" align="center" class="mtx-class-propfolder" | [[File:Fc9-conn-icon.png]]
| width="90%" class="mtx-class-propfolder" | I2C Connections
| width="90%" class="mtx-class-propfolder" | I2C Connections
|-
|-
Line 316: Line 316:
| colspan="2" | Allows the LDAC pin to be driven from an output pin on the microcontroller. If not used then tie the LDAC pin to GND to allow the DAC to function. 
| colspan="2" | Allows the LDAC pin to be driven from an output pin on the microcontroller. If not used then tie the LDAC pin to GND to allow the DAC to function. 
|-
|-
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
| width="10%" align="center" class="mtx-class-propfolder" | [[File:Fc9-conn-icon.png]]
| width="90%" class="mtx-class-propfolder" | Simulation
| width="90%" class="mtx-class-propfolder" | Simulation
|-
|-

Latest revision as of 14:37, 13 July 2026

Author Matrix TSL
Version 1.0
Category Analog Output


DAC Quad (MCP4728) component

Component to drive a quad digital to analogue converter (DAC) IC from Microchip via an I2C interface. Compatible with MCP4728 (12-Bit) devices.

Detailed description

No detailed description exists yet for this component

Examples

No additional examples







Macro reference

ControlPins

ControlPins
Allows Shutdown (SHDN) and Latch (LDAC) pins to be controlled directly if enabled. 
- BOOL Latch
0 = Data output driven from DAC register, 1 = Data output locked 
- VOID Return


Disable

Disable
Disables the DAC output. 
- BYTE Channel
Range: 0-3 / 0=DAC Channel 0 / 1=DAC Channel 1 ... 
- VOID Return


Enable

Enable
Enables the DAC Output. 
- BYTE Channel
Range: 0-3 / 0=DAC Channel 0 / 1=DAC Channel 1 ... 
- VOID Return


Initialise

Initialise
Configures the SPI peripheral ready for communications and initialises the internal variables. DAC needs to be enabled before any output voltage can be generated. 
- VOID Return


SetDeviceAddress

SetDeviceAddress
Writes a new device address into EE memory. The use LDAC pin component property must be set to true and the LDAC pin should be unique for every MCP4728 device connected to the I2C bus. 
- BYTE OldAddress
Range: 0-7 
- BYTE NewAddress
Range: 0-7 
- VOID Return


SetInitialEEOutput

SetInitialEEOutput
Stores a DAC value into EE memory to be used on power up. 
- BYTE Channel
Range: 0-3 / 0=DAC Channel 0 / 1=DAC Channel 1 ... 
- UINT DAC_Value
The value to output to the DAC 
- VOID Return


SetOutput

SetOutput
Sets the output voltage of the DAC 12-Bit: Range 0-4095 
- BYTE Channel
Range: 0-3 / 0=DAC Channel 0 / 1=DAC Channel 1 ... 
- UINT DAC_Value
The value to output to the DAC 
- VOID Return


Property reference

Properties
Pull Down Option
 
VREF Option
 
Gain Option
Selects the maximum reference value for the DAC 
Vref Voltage
Reference Voltage, Used to calculate the Voltage resolution. 
Steps
Number of discrete output states available from the DAC. 
Control Bits
Number of digital control bits 
Resolution
Maximum output resolution based on number of control bits. 
Voltage Resolution
Specifies the Resolution per digital bit in terms of Voltage. 
I2C Connections
Device Address
 
Channel
Channel selection 
SDA
Pin used for SDA (data signal) 
SCL
Pin used for SCL (clock signal) 
Baud Select
Baud rate option selector 
Baud Rate
Baud rate to be used 
Stop Delay
On older microcontroller devices there is a potential for the I2C hardware channel to lock up if there is not a 10ms delay between an I2C stop event and the next I2C start event. Most modern microcontrollers will not have a problem so this property can be disabled to speed up the I2C communications.  
Use LDAC Pin
Allows the LDAC pin to be driven from an output pin on the microcontroller. If not used then tie the LDAC pin to GND to allow the DAC to function. 
Simulation
Simulation Comms
 

Component Source Code

Please click here to download the component source project: FC_Comp_Source_DAC_MCP4728.fcfx

Please click here to view the component source code (Beta): FC_Comp_Source_DAC_MCP4728.fcfx