Difference between revisions of "Component: ADC (CAL) (Misc)"
From Flowcode Help
Jump to navigationJump to search| Line 17: | Line 17: | ||
==Component Source Code== | ==Component Source Code== | ||
| − | Please click here to download the component source project: [https://www.flowcode.co.uk/ | + | 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] | 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 44: | Line 46: | ||
==Examples== | ==Examples== | ||
| + | |||
| + | |||
| Line 69: | Line 73: | ||
==Macro reference== | ==Macro reference== | ||
| + | |||
| + | {| 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;" | '''GetValue''' | ||
| + | |- | ||
| + | | colspan="2" | Gets the Name property value | ||
| + | |- | ||
| + | |- | ||
| + | | width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING | ||
| + | | width="90%" | Name | ||
| + | |- | ||
| + | | colspan="2" | The name of the property | ||
| + | |- | ||
| + | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-string-icon.png]] - STRING | ||
| + | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
| + | |} | ||
| + | |||
| + | |||
| + | {| 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;" | '''Disable''' | ||
| + | |- | ||
| + | | colspan="2" | Disables the current ADC channel Call this once sampling is complete | ||
| + | |- | ||
| + | |- | ||
| + | | 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'' | ||
| + | |} | ||
| + | |||
| + | |||
| + | {| 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;" | '''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 | ||
| + | |- | ||
| + | |- | ||
| + | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
| + | | width="90%" | Channel | ||
| + | |- | ||
| + | | colspan="2" | A value >= 0 specifying the ADC channel | ||
| + | |- | ||
| + | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
| + | | width="90%" | Conv_Speed | ||
| + | |- | ||
| + | | colspan="2" | Chip-specific rate of change read from the FCD <ADC.ConfSpeed> | ||
| + | |- | ||
| + | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
| + | | width="90%" | Vref | ||
| + | |- | ||
| + | | colspan="2" | 0 to disable Vref mode, else 1 | ||
| + | |- | ||
| + | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
| + | | width="90%" | T_Charge | ||
| + | |- | ||
| + | | colspan="2" | Aquisition time to wait in micro seconds | ||
| + | |- | ||
| + | | 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'' | ||
| + | |} | ||
| + | |||
| + | |||
| + | {| 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;" | '''Sample''' | ||
| + | |- | ||
| + | | colspan="2" | Blocking call to read a sample on the currently enabled channel | ||
| + | |- | ||
| + | |- | ||
| + | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
| + | | width="90%" | Sample_Mode | ||
| + | |- | ||
| + | | colspan="2" | True to enable full-width sample (10 or 12 bits), else false for 8 bit | ||
| + | |- | ||
| + | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u16-icon.png]] - UINT | ||
| + | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
| + | |} | ||
| + | |||
| + | |||
| + | {| 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;" | '''SetValue''' | ||
| + | |- | ||
| + | | colspan="2" | Sets the Value for the named property | ||
| + | |- | ||
| + | |- | ||
| + | | width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING | ||
| + | | width="90%" | Name | ||
| + | |- | ||
| + | | colspan="2" | Name of property to update | ||
| + | |- | ||
| + | | width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING | ||
| + | | width="90%" | Value | ||
| + | |- | ||
| + | | colspan="2" | The new value for the property | ||
| + | |- | ||
| + | | 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'' | ||
| + | |} | ||
| + | |||
| + | |||
| + | {| 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;" | '''GetList''' | ||
| + | |- | ||
| + | | colspan="2" | | ||
| + | |- | ||
| + | |- | ||
| + | | width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING | ||
| + | | width="90%" | Name | ||
| + | |- | ||
| + | | colspan="2" | | ||
| + | |- | ||
| + | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-string-icon.png]] - STRING | ||
| + | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
| + | |} | ||
| + | |||
| + | |||
| + | |||
| + | |||
| + | ==Property reference== | ||
| + | |||
| + | {| 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" | [[File:Fc9-type-16-icon.png]] | ||
| + | | width="90%" | Peripheral | ||
| + | |- | ||
| + | | colspan="2" | | ||
| + | |- | ||
| + | | width="10%" align="center" | [[File:Fc9-type-6-icon.png]] | ||
| + | | width="90%" | Channel ADC Pin | ||
| + | |- | ||
| + | | colspan="2" | ADC Channel number | ||
| + | |- | ||
| + | | width="10%" align="center" | [[File:Fc9-type-16-icon.png]] | ||
| + | | width="90%" | Vref Option | ||
| + | |- | ||
| + | | colspan="2" | selects the reference voltage option | ||
| + | |- | ||
| + | | width="10%" align="center" | [[File:Fc9-type-14-icon.png]] | ||
| + | | width="90%" | Vref+ (x10mV) | ||
| + | |- | ||
| + | | colspan="2" | sets the value of the reference voltage (used for conversion calculations) | ||
| + | |- | ||
| + | | width="10%" align="center" | [[File:Fc9-type-16-icon.png]] | ||
| + | | width="90%" | Acq Time | ||
| + | |- | ||
| + | | colspan="2" | ADC Aquisition time | ||
| + | |- | ||
| + | | width="10%" align="center" | [[File:Fc9-type-7-icon.png]] | ||
| + | | width="90%" | Use FRC clock | ||
| + | |- | ||
| + | | colspan="2" | 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. | ||
| + | |- | ||
| + | | width="10%" align="center" | [[File:Fc9-type-16-icon.png]] | ||
| + | | width="90%" | Conv Speed | ||
| + | |- | ||
| + | | colspan="2" | Conversion speed option | ||
| + | |- | ||
| + | | width="10%" align="center" | [[File:Fc9-type-14-icon.png]] | ||
| + | | width="90%" | Type | ||
| + | |- | ||
| + | | colspan="2" | | ||
| + | |- | ||
| + | | width="10%" align="center" | [[File:Fc9-type-14-icon.png]] | ||
| + | | width="90%" | Bits | ||
| + | |- | ||
| + | | colspan="2" | | ||
| + | |- | ||
| + | | width="10%" align="center" | [[File:Fc9-type-7-icon.png]] | ||
| + | | width="90%" | Custom Pins | ||
| + | |- | ||
| + | | colspan="2" | | ||
| + | |- | ||
| + | | width="10%" align="center" | [[File:Fc9-type-7-icon.png]] | ||
| + | | width="90%" | Has DMA | ||
| + | |- | ||
| + | | colspan="2" | | ||
| + | |- | ||
| + | | width="10%" align="center" | [[File:Fc9-type-7-icon.png]] | ||
| + | | width="90%" | Use DMA | ||
| + | |- | ||
| + | | colspan="2" | | ||
| + | |- | ||
| + | | width="10%" align="center" | [[File:Fc9-type-16-icon.png]] | ||
| + | | width="90%" | DMA Trigger | ||
| + | |- | ||
| + | | colspan="2" | | ||
| + | |- | ||
| + | | width="10%" align="center" | [[File:Fc9-type-7-icon.png]] | ||
| + | | width="90%" | Has Scanning | ||
| + | |- | ||
| + | | colspan="2" | | ||
| + | |- | ||
| + | | width="10%" align="center" | [[File:Fc9-type-7-icon.png]] | ||
| + | | width="90%" | Use Scanning | ||
| + | |- | ||
| + | | colspan="2" | | ||
| + | |- | ||
| + | | 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%" | Scope Traces | ||
| + | |- | ||
| + | | colspan="2" | Selects if the scope traces are automatically generated or not | ||
| + | |}==Macro reference== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
Revision as of 09:52, 27 January 2023
| Author | Matrix TSL |
| Version | 2.0 |
| Category | Misc |
Contents
ADC component
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: FC_Comp_Source_ADC.fcfx
Please click here to view the component source code (Beta): FC_Comp_Source_ADC.fcfx
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
| GetValue | |
| Gets the Name property value | |
| Name | |
| The name of the property | |
| Return | |
| Disable | |
| Disables the current ADC channel Call this once sampling is complete | |
| Return | |
| Sample | |
| Blocking call to read a sample on the currently enabled channel | |
| Sample_Mode | |
| True to enable full-width sample (10 or 12 bits), else false for 8 bit | |
| Return | |
| SetValue | |
| Sets the Value for the named property | |
| Name | |
| Name of property to update | |
| Value | |
| The new value for the property | |
| Return | |
| GetList | |
| Name | |
| Return | |
Property reference
==Macro reference==
| GetValue | |
| Gets the Name property value | |
| Name | |
| The name of the property | |
| Return | |
| Disable | |
| Disables the current ADC channel Call this once sampling is complete | |
| Return | |
| Sample | |
| Blocking call to read a sample on the currently enabled channel | |
| Sample_Mode | |
| True to enable full-width sample (10 or 12 bits), else false for 8 bit | |
| Return | |
| SetValue | |
| Sets the Value for the named property | |
| Name | |
| Name of property to update | |
| Value | |
| The new value for the property | |
| Return | |
| GetList | |
| Name | |
| Return | |
Property reference
==Macro reference==
| GetValue | |
| Gets the Name property value | |
| Name | |
| The name of the property | |
| Return | |
| Disable | |
| Disables the current ADC channel Call this once sampling is complete | |
| Return | |
| Sample | |
| Blocking call to read a sample on the currently enabled channel | |
| Sample_Mode | |
| True to enable full-width sample (10 or 12 bits), else false for 8 bit | |
| Return | |
| SetValue | |
| Sets the Value for the named property | |
| Name | |
| Name of property to update | |
| Value | |
| The new value for the property | |
| Return | |
| GetList | |
| Name | |
| Return | |
Property reference
==Macro reference==
| GetValue | |
| Gets the Name property value | |
| Name | |
| The name of the property | |
| Return | |
| Disable | |
| Disables the current ADC channel Call this once sampling is complete | |
| Return | |
| Sample | |
| Blocking call to read a sample on the currently enabled channel | |
| Sample_Mode | |
| True to enable full-width sample (10 or 12 bits), else false for 8 bit | |
| Return | |
| SetValue | |
| Sets the Value for the named property | |
| Name | |
| Name of property to update | |
| Value | |
| The new value for the property | |
| Return | |
| GetList | |
| Name | |
| Return | |