Jump to content

Component: ADC 24bit ADS1220 (Analog Input): Difference between revisions

From Flowcode Help
m Text replacement - "class="wikitable" style="width:60%; background-color:#FFFFFF;"" to "class="mtx-class-macrotable wikitable""
m Text replacement - "style="background-color:#EAE1EA;"" to "class="mtx-class-propfolder""
 
(4 intermediate revisions by the same user not shown)
Line 35: Line 35:
{| class="mtx-class-macrotable wikitable"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Initialise'''
| width="90%" class="mtx-class-macrohead" | '''Initialise'''
|-
|-
| colspan="2" | Initialize the ADS1220 ADC with default settings 
| colspan="2" | Initialize the ADS1220 ADC with default settings 
Line 49: Line 49:
{| class="mtx-class-macrotable wikitable"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadRTDResistance'''
| width="90%" class="mtx-class-macrohead" | '''ReadRTDResistance'''
|-
|-
| colspan="2" | Reads the RTD sensor and returns resistance in ohms 
| colspan="2" | Reads the RTD sensor and returns resistance in ohms 
Line 63: Line 63:
{| class="mtx-class-macrotable wikitable"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadRTDTemperature'''
| width="90%" class="mtx-class-macrohead" | '''ReadRTDTemperature'''
|-
|-
| colspan="2" | Reads the RTD sensor and returns temperature in degrees Celsius using linear approximation - matches GitHub library get_temperature_from_rtd_ohms_with_linear_approx 
| colspan="2" | Reads the RTD sensor and returns temperature in degrees Celsius using linear approximation - matches GitHub library get_temperature_from_rtd_ohms_with_linear_approx 
Line 77: Line 77:
{| class="mtx-class-macrotable wikitable"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SampleDiffRAW'''
| width="90%" class="mtx-class-macrohead" | '''SampleDiffRAW'''
|-
|-
| colspan="2" | Performs a differential ADC sample between two channels and returns 24-bit raw value. Not all channel combinations are possible, see datasheet p40 section MUX. Returns 0 if the channel selection is invalid. 
| colspan="2" | Performs a differential ADC sample between two channels and returns 24-bit raw value. Not all channel combinations are possible, see datasheet p40 section MUX. Returns 0 if the channel selection is invalid. 
Line 106: Line 106:
{| class="mtx-class-macrotable wikitable"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SampleDiffVolts'''
| width="90%" class="mtx-class-macrohead" | '''SampleDiffVolts'''
|-
|-
| colspan="2" | Performs a differential ADC sample and returns voltage in volts 
| colspan="2" | Performs a differential ADC sample and returns voltage in volts 
Line 135: Line 135:
{| class="mtx-class-macrotable wikitable"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SampleSglRaw'''
| width="90%" class="mtx-class-macrohead" | '''SampleSglRaw'''
|-
|-
| colspan="2" | Performs a single-ended ADC sample on the selected channel and returns 24-bit raw value 
| colspan="2" | Performs a single-ended ADC sample on the selected channel and returns 24-bit raw value 
Line 159: Line 159:
{| class="mtx-class-macrotable wikitable"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SampleSglVolts'''
| width="90%" class="mtx-class-macrohead" | '''SampleSglVolts'''
|-
|-
| colspan="2" | Performs a single-ended ADC sample and returns voltage in volts 
| colspan="2" | Performs a single-ended ADC sample and returns voltage in volts 
Line 184: Line 184:
{| class="mtx-class-macrotable wikitable"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-prop-icon.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-prop-icon.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Properties'''  
| width="90%" class="mtx-class-macrohead" | '''Properties'''  
|-
|-
|-
|-
| 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%" style="background-color:#EAE1EA; color:#4B008D;" | Connections
| width="90%" class="mtx-class-propfolder" | Connections
|-
|-
|-
|-
Line 247: Line 247:
| colspan="2" | Data Ready pin - goes low when conversion is complete 
| colspan="2" | Data Ready pin - goes low when conversion is complete 
|-
|-
| 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%" style="background-color:#EAE1EA; color:#4B008D;" | Configuration
| width="90%" class="mtx-class-propfolder" | Configuration
|-
|-
|-
|-
Line 301: Line 301:
| colspan="2" |  
| colspan="2" |  
|-
|-
| 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%" style="background-color:#EAE1EA; color:#4B008D;" | RTD Configuration
| width="90%" class="mtx-class-propfolder" | RTD Configuration
|-
|-
|-
|-
Line 325: Line 325:
| colspan="2" |  
| colspan="2" |  
|-
|-
| 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%" style="background-color:#EAE1EA; color:#4B008D;" | Simulation
| width="90%" class="mtx-class-propfolder" | Simulation
|-
|-
|-
|-

Latest revision as of 14:36, 13 July 2026

Author Matrix TSL
Version 1.0
Category Analog Input


ADC 24bit ADS1220 component

A Precision Low power 24Bit SPI ADC 4 channel device with Programmable Gain Amplifier (PGA) and Data Rates up to 2 kSPS

Detailed description

No detailed description exists yet for this component

Examples

Example use case of a 3-wire RTD to read high resolution and high accuracy temperature.

ADS1220_Test


Example circuit schematic complete with component values. RREF should be a high accuracy resistor with a low PPM.

Macro reference

Initialise

Initialise
Initialize the ADS1220 ADC with default settings 
- BYTE Return


ReadRTDResistance

ReadRTDResistance
Reads the RTD sensor and returns resistance in ohms 
- FLOAT Return


ReadRTDTemperature

ReadRTDTemperature
Reads the RTD sensor and returns temperature in degrees Celsius using linear approximation - matches GitHub library get_temperature_from_rtd_ohms_with_linear_approx 
- FLOAT Return


SampleDiffRAW

SampleDiffRAW
Performs a differential ADC sample between two channels and returns 24-bit raw value. Not all channel combinations are possible, see datasheet p40 section MUX. Returns 0 if the channel selection is invalid. 
- BYTE ChannelA
Positive channel: 0-3 (AN0-AN3) 
- BYTE ChannelB
Negative channel: 0-3 (AN0-AN3) 
- BYTE Gain
PGA Gain: 0=1x, 1=2x, 2=4x, 3=8x, 4=16x, 5=32x, 6=64x, 7=128x 
- LONG Return


SampleDiffVolts

SampleDiffVolts
Performs a differential ADC sample and returns voltage in volts 
- BYTE ChannelA
Positive channel: 0-3 (AN0-AN3) 
- BYTE ChannelB
Negative channel: 0-3 (AN0-AN3) 
- BYTE Gain
PGA Gain: 0=1x, 1=2x, 2=4x, 3=8x, 4=16x, 5=32x, 6=64x, 7=128x 
- FLOAT Return


SampleSglRaw

SampleSglRaw
Performs a single-ended ADC sample on the selected channel and returns 24-bit raw value 
- BYTE Channel
Range: 0-3 (AN0-AN3) 
- BYTE Gain
PGA Gain: 0=1x, 1=2x, 2=4x, 3=8x, 4=16x, 5=32x, 6=64x, 7=128x 
- LONG Return


SampleSglVolts

SampleSglVolts
Performs a single-ended ADC sample and returns voltage in volts 
- BYTE Channel
Range: 0-3 (AN0-AN3) 
- BYTE Gain
PGA Gain: 0=1x, 1=2x, 2=4x, 3=8x, 4=16x, 5=32x, 6=64x, 7=128x 
- FLOAT Return


Property reference

Properties
Connections
Channel
SPI Channel selector 
Prescale
Prescale option selector 
MOSI
SPI Data Out Pin SDO - Also Known as Master Out Slave In (MOSI) when used in Master mode. 
MOSI Remap Pin
Select which the target pin to assign the MOSI hardware pin functionality. 
MISO
SPI Data In Pin SDI - Also Known as Master In Slave Out (MISO) when used in Master mode. 
MISO Remap Pin
Select which the target pin to assign the MISO hardware pin functionality. 
CLK
SPI Clock Pin CLK - The Clock signal is driven by the SPI master. 
CLK Remap Pin
Select which the target pin to assign the CLK hardware pin functionality. 
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.  
Use Ready Pin
Use DRDY pin to detect when conversion is complete. If disabled, polling will be used. 
DRDY Pin
Data Ready pin - goes low when conversion is complete 
Configuration
Data Rate
Programmable Data Rate (SPS) 
Operating Mode
 
Conversion Mode
 
PGA Gain
Programmable Gain Amplifier (PGA) gain setting 
Voltage Reference
Voltage reference source 
Reference Voltage
 
FIR Filter
 
IDAC Current (uA)
IDAC excitation current in microamperes. Typical values: 100, 250, 500, 750, 1000. Default: 250uA 
I1MUX
 
I2MUX
 
RTD Configuration
RTD Type
RTD sensor type - determines base resistance at 0°C 
RTD Configuration
 
Reference Resistor
High precision reference resistor value in ohms. Typically 400Ω for PT100 or 4000Ω for PT1000 
Temperature Coefficient
 
Simulation
Simulate Comms
Allows the communications to be simulated overriding the value on the panel slider controls. 

Component Source Code

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

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