Jump to content

Component: ADC (CAL) (Misc): Difference between revisions

From Flowcode Help
No edit summary
m Text replacement - "style="background-color:#EAE1EA;"" to "class="mtx-class-propfolder""
 
(6 intermediate revisions by 2 users not shown)
Line 14: Line 14:
==ADC component==
==ADC component==
CAL - Code Abstraction Layer A low level implementation giving direct access to the analogue to digital converter peripheral.
CAL - Code Abstraction Layer A low level implementation giving direct access to the analogue to digital converter peripheral.
==Component Source Code==
Please click here to download the component source project: [https://www.flowcode.co.uk/wiki/componentsource/FC_Comp_Source_ADC.fcfx FC_Comp_Source_ADC.fcfx]
Please click here to view the component source code (Beta): [https://www.flowcode.co.uk/FlowchartView/?wfile=componentsource/FC_Comp_Source_ADC.fcfx FC_Comp_Source_ADC.fcfx]


==Detailed description==
==Detailed description==
Line 97: Line 91:


===Disable===
===Disable===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| 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;" | '''Disable'''
| width="90%" class="mtx-class-macrohead" | '''Disable'''
|-
|-
| colspan="2" | Disables the current ADC channel Call this once sampling is complete 
| colspan="2" | Disables the current ADC channel Call this once sampling is complete 
Line 111: Line 105:


===Enable===
===Enable===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| 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;" | '''Enable'''
| width="90%" class="mtx-class-macrohead" | '''Enable'''
|-
|-
| colspan="2" | Enables sampling of the ADC channel This is called every time a new ADC channel needs configuring to ADC mode [u]Only one ADC channel may be enabled at any time[/u] When sampling is complete, call Disable() to restore the pin 
| colspan="2" | Enables sampling of the ADC channel This is called every time a new ADC channel needs configuring to ADC mode [u]Only one ADC channel may be enabled at any time[/u] When sampling is complete, call Disable() to restore the pin 
Line 145: Line 139:


===GetList===
===GetList===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| 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;" | '''GetList'''
| width="90%" class="mtx-class-macrohead" | '''GetList'''
|-
|-
| colspan="2" |  
| colspan="2" |  
Line 164: Line 158:


===GetValue===
===GetValue===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| 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;" | '''GetValue'''
| width="90%" class="mtx-class-macrohead" | '''GetValue'''
|-
|-
| colspan="2" | Gets the Name property value 
| colspan="2" | Gets the Name property value 
Line 183: Line 177:


===Sample===
===Sample===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| 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;" | '''Sample'''
| width="90%" class="mtx-class-macrohead" | '''Sample'''
|-
|-
| colspan="2" | Blocking call to read a sample on the currently enabled channel 
| colspan="2" | Blocking call to read a sample on the currently enabled channel 
Line 202: Line 196:


===SetValue===
===SetValue===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| 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;" | '''SetValue'''
| width="90%" class="mtx-class-macrohead" | '''SetValue'''
|-
|-
| colspan="2" | Sets the Value for the named property 
| colspan="2" | Sets the Value for the named property 
Line 227: Line 221:
==Property reference==
==Property reference==


{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| 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'''  
|-
|-
|-
|-
Line 308: Line 302:
| 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
|-
|-
|-
|-
Line 317: Line 311:
| colspan="2" | Selects if the scope traces are automatically generated or not 
| colspan="2" | Selects if the scope traces are automatically generated or not 
|}
|}
==Component Source Code==
Please click here to download the component source project: [https://www.flowcode.co.uk/wiki/componentsource/FC_Comp_Source_ADC.fcfx FC_Comp_Source_ADC.fcfx]
Please click here to view the component source code (Beta): [https://www.flowcode.co.uk/FlowchartView/?wfile=componentsource/FC_Comp_Source_ADC.fcfx FC_Comp_Source_ADC.fcfx]

Latest revision as of 14:36, 13 July 2026

Author Matrix TSL
Version 2.0
Category Misc


ADC component

CAL - Code Abstraction Layer A low level implementation giving direct access to the analogue to digital converter peripheral.

Detailed description

No detailed description exists yet for this component

Examples

Example showing how to build a component using a CAL component Using CAL Components.









Macro reference

Disable

Disable
Disables the current ADC channel Call this once sampling is complete 
- VOID Return


Enable

Enable
Enables sampling of the ADC channel This is called every time a new ADC channel needs configuring to ADC mode [u]Only one ADC channel may be enabled at any time[/u] When sampling is complete, call Disable() to restore the pin 
- BYTE Channel
A value >= 0 specifying the ADC channel 
- BYTE Conv_Speed
Chip-specific rate of change read from the FCD <ADC.ConfSpeed> 
- BYTE Vref
0 to disable Vref mode, else 1 
- BYTE T_Charge
Aquisition time to wait in micro seconds 
- VOID Return


GetList

GetList
 
- STRING Name
 
- STRING Return


GetValue

GetValue
Gets the Name property value 
- STRING Name
The name of the property 
- STRING Return


Sample

Sample
Blocking call to read a sample on the currently enabled channel 
- BYTE Sample_Mode
True to enable full-width sample (10 or 12 bits), else false for 8 bit 
- UINT Return


SetValue

SetValue
Sets the Value for the named property 
- STRING Name
Name of property to update 
- STRING Value
The new value for the property 
- VOID Return


Property reference

Properties
Peripheral
 
Channel ADC Pin
ADC Channel number 
Vref Option
selects the reference voltage option 
Vref+ (x10mV)
sets the value of the reference voltage (used for conversion calculations) 
Acq Time
ADC Aquisition time 
Use FRC clock
Uses the internal fixed RC clock to perform ADC conversions. In most cases it is better to switch this off and use the conversion speed to ensure sampling is consistent. 
Conv Speed
Conversion speed option 
Type
 
Bits
 
Custom Pins
 
Has DMA
 
Use DMA
 
DMA Trigger
 
Has Scanning
 
Use Scanning
 
Simulation
Scope Traces
Selects if the scope traces are automatically generated or not 

Component Source Code

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

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