Difference between revisions of "Component: DAC (AD5662) (Analog Output)"

From Flowcode Help
Jump to navigationJump to search
 
(17 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
+
{| style="width:50%"
 
 
{| width="50%"
 
 
|-
 
|-
| width="20%" style="color: gray;" | Author
+
| width="20%" style="color:gray;" | Author
 
| Matrix TSL
 
| Matrix TSL
 
|-
 
|-
| width="20%" style="color: gray;" | Version
+
| width="20%" style="color:gray;" | Version
| 1.0 (Release)
+
| 1.0
 
|-
 
|-
| width="20%" style="color: gray;" | Category
+
| width="20%" style="color:gray;" | Category
 
| Analog Output
 
| Analog Output
 
|}
 
|}
  
  
 +
==DAC (AD5662) component==
 +
16-bit external DAC connected to the microcontroller using SPI.
 +
 +
==Component Source Code==
 +
 +
Please click here to download the component source project: [https://www.flowcode.co.uk/wiki/componentsource/FC_Comp_Source_DAC_AD5662.fcfx FC_Comp_Source_DAC_AD5662.fcfx]
  
==[[File:Component Icon 3d87ffe9_97c1_4013_a2cd_82c24d0ccb48.png|Image]] DAC (AD5662) component==
+
Please click here to view the component source code (Beta): [https://www.flowcode.co.uk/FlowchartView/?wfile=componentsource/FC_Comp_Source_DAC_AD5662.fcfx FC_Comp_Source_DAC_AD5662.fcfx]
16-bit external DAC connected to the microcontroller using SPI.
 
  
 
==Detailed description==
 
==Detailed description==
  
===Overview===
 
The AD5662 is a 3V/5V general purpose SPI compatible, high-resolution digital to analog converter (DAC), capable of generating a rail-to-rail voltage output.
 
  
With 16-Bit resolution, the AD5662 is capable of finely tuning the voltage output across 65,536 steps, with an individual step voltage of 5/65536 = 0.0000763 volts DC.
 
  
The AD5662 requires an external reference voltage to set the output range of the DAC.
 
  
  
Pin reference from the datasheet:
 
  
[[File:AD5662 Pin Reference.png]]
 
  
==Examples==
 
  
This example reads a potentiometer that is connected across the supply voltage.
 
The output from the DAC should mimic the voltage that's across ADC pin & GND.
 
  
{{Fcfile|AD5662_Demo.fcfx|AD5662_Demo}}
 
==Circuit Diagram==
 
[[File:AD5662 Circuit Diagram.png]]
 
==Downloadable macro reference==
 
  
===<span style="font-weight: normal;"><u><tt>OutputDAC</tt></u></span>===
 
Outputs a value to the DAC,
 
  
'''Parameters'''
 
  
:[[Variable Types|UINT]] ''Output''
 
::Range: 0-65535 / 0=0V / 65535=VCC
 
  
  
'''Return value'''
 
  
:''This call does not return a value''
 
  
  
===<span style="font-weight: normal;"><u><tt>Initialise</tt></u></span>===
 
Initialise the SPI bus ready for communications,
 
  
'''Parameters'''
 
  
:''This macro has no parameters''
 
  
  
'''Return value'''
 
  
:''This call does not return a value''
 
  
  
  
==Simulation macro reference==
 
  
''This component does not contain any simulation macros''
+
 
 +
===Overview===
 +
The AD5662 is a 3V/5V general purpose SPI compatible, high-resolution digital to analog converter (DAC), capable of generating a rail-to-rail voltage output.
 +
 
 +
With 16-Bit resolution, the AD5662 is capable of finely tuning the voltage output across 65,536 steps, with an individual step voltage of 5/65536 = 0.0000763 volts DC.
 +
 
 +
The AD5662 requires an external reference voltage to set the output range of the DAC.
 +
 
 +
 
 +
Pin reference from the datasheet:
 +
 
 +
[[File:AD5662 Pin Reference.png]]
 +
 
 +
===Circuit Diagram===
 +
[[File:AD5662 Circuit Diagram.png]]
 +
 
 +
==Examples==
 +
 
 +
 
 +
 
 +
 
 +
 
 +
 
 +
 
 +
 
 +
 
  
  
==Property reference==
 
<span style="font-weight: normal;"><u>Channel</u></span>
 
  
This property is of type ''Fixed list of ints'' and can be referenced with the variable name ''cal_spi1::CHANNEL''.
 
  
SPI Channel selector
 
  
<span style="font-weight: normal;"><u>Prescale</u></span>
 
  
This property is of type ''Fixed list of ints'' and can be referenced with the variable name ''cal_spi1::PR_SCALE''.
 
  
Prescale option selector
 
  
<span style="font-weight: normal;"><u>MOSI</u></span>
 
  
This property is of type ''Single digital pin'' and can be referenced with the variable name ''cal_spi1::MOSI''.
 
  
SPI Data Out Pin SDO - Also Known as Master Out Slave In (MOSI) when used in Master mode.
 
  
<span style="font-weight: normal;"><u>MISO</u></span>
 
  
This property is of type ''Single digital pin'' and can be referenced with the variable name ''cal_spi1::MISO''.
 
  
SPI Data In Pin SDI - Also Known as Master In Slave Out (MISO) when used in Master mode.
 
  
<span style="font-weight: normal;"><u>CLK</u></span>
 
  
This property is of type ''Single digital pin'' and can be referenced with the variable name ''cal_spi1::CLK''.
 
  
SPI Clock Pin CLK - The Clock signal is driven by the SPI master.
 
  
<span style="font-weight: normal;"><u>CS / SS</u></span>
 
  
This property is of type ''Single digital pin'' and can be referenced with the variable name ''cal_spi1::SS''.
+
This example reads a potentiometer that is connected across the supply voltage.
 +
The output from the DAC should mimic the voltage that's across ADC pin & GND.
  
Chip Select / Slave Select Pin
+
{{Fcfile|AD5662_Demo.fcfx|AD5662_Demo}}
  
Master Mode: General purpose output pin used to select the remote SPI device.
 
  
Slave Mode: Hardware chip select pin input used to select the SPI device.
 
  
<span style="font-weight: normal;"><u>Simulate Comms</u></span>
 
  
This property is of type ''True or false'' and can be referenced with the variable name ''SimulateComms''.
 
  
''<span style="color:red;">No additional information</span>''
 
  
  
  
<span style="font-weight: normal;"><u>Console Data</u></span>
 
  
This property is of type ''True or false'' and can be referenced with the variable name ''cal_spi1::ConsoleData''.
 
  
Selects if the console data is automatically generated or not
 
  
<span style="font-weight: normal;"><u>Scope Traces</u></span>
+
==Macro reference==
  
This property is of type ''True or false'' and can be referenced with the variable name ''cal_spi1::ScopeTraces''.
+
===Initialise===
 +
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Initialise'''
 +
|-
 +
| colspan="2" | Initialise the SPI bus ready for communications,&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
Selects if the scope traces are automatically generated or not
 
  
<span style="font-weight: normal;"><u>Injector</u></span>
+
===OutputDAC===
 +
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''OutputDAC'''
 +
|-
 +
| colspan="2" | Outputs a value to the DAC,  &nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 +
| width="90%" | Output
 +
|-
 +
| colspan="2" | Range: 0-65535 / 0=0V / 65535=VCC&nbsp;
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
 +
 
  
This property is of type ''Fixed list of ints'' and can be referenced with the variable name ''cal_spi1::Injector''.
+
==Property reference==
  
''<span style="color:red;">No additional information</span>''
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-prop-icon.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Properties'''
 +
|-
 +
|-
 +
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
 +
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | SPI Properties
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
 +
| width="90%" | Channel
 +
|-
 +
| colspan="2" | SPI Channel selector&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
 +
| width="90%" | Prescale
 +
|-
 +
| colspan="2" | Prescale option selector&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
 +
| width="90%" | MOSI
 +
|-
 +
| colspan="2" | SPI Data Out Pin SDO - Also Known as Master Out Slave In (MOSI) when used in Master mode.&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
 +
| width="90%" | MISO
 +
|-
 +
| colspan="2" | SPI Data In Pin SDI - Also Known as Master In Slave Out (MISO) when used in Master mode.&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
 +
| width="90%" | CLK
 +
|-
 +
| colspan="2" | SPI Clock Pin CLK - The Clock signal is driven by the SPI master.&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
 +
| width="90%" | CS / SS
 +
|-
 +
| colspan="2" | Chip Select / Slave Select Pin  Master Mode: General purpose output pin used to select the remote SPI device. Slave Mode: Hardware chip select pin input used to select the SPI device. &nbsp;
 +
|-
 +
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
 +
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Simulation
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-type-7-icon.png]]
 +
| width="90%" | Data Recorder Trace
 +
|-
 +
| colspan="2" | &nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-type-7-icon.png]]
 +
| width="90%" | Simulate Comms
 +
|-
 +
| colspan="2" | &nbsp;
 +
|}

Latest revision as of 13:09, 7 February 2023

Author Matrix TSL
Version 1.0
Category Analog Output


DAC (AD5662) component

16-bit external DAC connected to the microcontroller using SPI.

Component Source Code

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

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

Detailed description

Overview

The AD5662 is a 3V/5V general purpose SPI compatible, high-resolution digital to analog converter (DAC), capable of generating a rail-to-rail voltage output.

With 16-Bit resolution, the AD5662 is capable of finely tuning the voltage output across 65,536 steps, with an individual step voltage of 5/65536 = 0.0000763 volts DC.

The AD5662 requires an external reference voltage to set the output range of the DAC.


Pin reference from the datasheet:

AD5662 Pin Reference.png

Circuit Diagram

AD5662 Circuit Diagram.png

Examples

This example reads a potentiometer that is connected across the supply voltage. The output from the DAC should mimic the voltage that's across ADC pin & GND.

FC6 Icon.png AD5662_Demo






Macro reference

Initialise

Fc9-comp-macro.png Initialise
Initialise the SPI bus ready for communications, 
Fc9-void-icon.png - VOID Return


OutputDAC

Fc9-comp-macro.png OutputDAC
Outputs a value to the DAC,  
Fc9-u16-icon.png - UINT Output
Range: 0-65535 / 0=0V / 65535=VCC 
Fc9-void-icon.png - VOID Return


Property reference

Fc9-prop-icon.png Properties
Fc9-conn-icon.png SPI Properties
Fc9-type-16-icon.png Channel
SPI Channel selector 
Fc9-type-16-icon.png Prescale
Prescale option selector 
Fc9-type-5-icon.png MOSI
SPI Data Out Pin SDO - Also Known as Master Out Slave In (MOSI) when used in Master mode. 
Fc9-type-5-icon.png MISO
SPI Data In Pin SDI - Also Known as Master In Slave Out (MISO) when used in Master mode. 
Fc9-type-5-icon.png CLK
SPI Clock Pin CLK - The Clock signal is driven by the SPI master. 
Fc9-type-5-icon.png CS / SS
Chip Select / Slave Select Pin Master Mode: General purpose output pin used to select the remote SPI device. Slave Mode: Hardware chip select pin input used to select the SPI device.  
Fc9-conn-icon.png Simulation
Fc9-type-7-icon.png Data Recorder Trace
 
Fc9-type-7-icon.png Simulate Comms