|
|
(7 intermediate revisions by the same user not shown) |
Line 17: |
Line 17: |
| ==Component Source Code== | | ==Component Source Code== |
| | | |
− | Please click here to download the component source project: [https://www.flowcode.co.uk/wikicopy/componentsource/FC_Comp_Source_DSP_ADCInput.fcfx FC_Comp_Source_DSP_ADCInput.fcfx] | + | Please click here to download the component source project: [https://www.flowcode.co.uk/wiki/componentsource/FC_Comp_Source_DSP_ADCInput.fcfx FC_Comp_Source_DSP_ADCInput.fcfx] |
| | | |
| Please click here to view the component source code (Beta): [https://www.flowcode.co.uk/FlowchartView/?wfile=componentsource/FC_Comp_Source_DSP_ADCInput.fcfx FC_Comp_Source_DSP_ADCInput.fcfx] | | Please click here to view the component source code (Beta): [https://www.flowcode.co.uk/FlowchartView/?wfile=componentsource/FC_Comp_Source_DSP_ADCInput.fcfx FC_Comp_Source_DSP_ADCInput.fcfx] |
| | | |
| ==Detailed description== | | ==Detailed description== |
| + | |
| + | |
| + | |
| + | |
| | | |
| | | |
Line 38: |
Line 42: |
| | | |
| ==Examples== | | ==Examples== |
| + | |
| + | |
| + | |
| + | |
| | | |
| | | |
Line 53: |
Line 61: |
| ''<span style="color:red;">No additional examples</span>'' | | ''<span style="color:red;">No additional examples</span>'' |
| | | |
− | ==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;" | '''AddSample'''
| |
− | |-
| |
− | | colspan="2" | Adds a single ADC sample to the current location in the specified buffer. If Auto Scale is enabled then the sample will be scaled to correctly fit inside the buffer. Auto increments current location.
| |
− | |-
| |
− | |-
| |
− | | 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;" | '''AddSampleArray'''
| |
− | |-
| |
− | | colspan="2" | Adds a single ADC sample to the current location in the specified buffer. If Auto Scale is enabled then the sample will be scaled to correctly fit inside the buffer. Auto increments current location.
| |
− | |-
| |
− | |-
| |
− | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
| |
− | | width="90%" | SampleDelay
| |
− | |-
| |
− | | colspan="2" | Number of us in between each sample.
| |
− | |-
| |
− | | 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''
| |
− | |}
| |
| | | |
| | | |
| | | |
| | | |
− | ==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-21-icon.png]]
| |
− | | width="90%" | Buffer Size
| |
− | |-
| |
− | | colspan="2" | Number of individual elements the buffer can store, default 1.
| |
− | |-
| |
− | | width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
| |
− | | width="90%" | Buffer Type
| |
− | |-
| |
− | | colspan="2" | Sets the buffer data type, data is automatically scaled to fit and make full use of the data type.
| |
− | |-
| |
− | | width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
| |
− | | width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Connections
| |
− | |-
| |
− | |-
| |
− | | width="10%" align="center" | [[File:Fc9-type-6-icon.png]]
| |
− | | width="90%" | Channel
| |
− | |-
| |
− | | colspan="2" | Analogue Input Channel - Which pin is the analogue input connected to?
| |
− | |-
| |
− | | width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
| |
− | | width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Settings
| |
− | |-
| |
− | |-
| |
− | | width="10%" align="center" | [[File:Fc9-type-7-icon.png]]
| |
− | | width="90%" | Auto Adjust Scale
| |
− | |-
| |
− | | colspan="2" | Yes: Automatically convert ADC samples to match the full bit depth of the DSP buffer. No: Leave the ADC samples at the native bit depth.
| |
− | |-
| |
− | | width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
| |
− | | width="90%" | VRef option
| |
− | |-
| |
− | | colspan="2" | Defines what is used as the ADC maximum reference. ADC Range = GND to VRef Voltage VDD - Defines the microcontrollers power supply pin as the max reference, VREF+ Pin - Dedicated pin on the microcontroller to allow for a variable reference voltage.
| |
− | |-
| |
− | | width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
| |
− | | width="90%" | Conversion speed
| |
− | |-
| |
− | | colspan="2" | Clock setting to select how fast the ADC peripheral will perform an ADC conversion. The FRC setting is based on a RC time base and so will vary with temperature and pressure. Other settings are generally based on divisions of the master clock.
| |
− | |-
| |
− | | width="10%" align="center" | [[File:Fc9-type-14-icon.png]]
| |
− | | width="90%" | Acquisition cycles
| |
− | |-
| |
− | | colspan="2" | Number of micro seconds to wait for the ADC input to charge before starting the analogue sample.
| |
− | |-
| |
− | | width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
| |
− | | width="90%" | Bit Depth
| |
− | |-
| |
− | | colspan="2" | Maximum number of bits for each ADC sample.
| |
− | |}==Macro reference==
| |
| | | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | ==Macro reference== |
| + | |
| + | ===AddSample=== |
| {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" |
| |- | | |- |
Line 158: |
Line 91: |
| | | |
| | | |
| + | ===AddSampleArray=== |
| {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" |
| |- | | |- |
Line 174: |
Line 108: |
| | width="90%" style="border-top: 2px solid #000;" | ''Return'' | | | width="90%" style="border-top: 2px solid #000;" | ''Return'' |
| |} | | |} |
− |
| |
− |
| |
| | | |
| | | |
Line 209: |
Line 141: |
| |- | | |- |
| |- | | |- |
− | | width="10%" align="center" | [[File:Fc9-type-7-icon.png]] | + | | width="10%" align="center" | [[File:Fc9-type-21-icon.png]] |
− | | width="90%" | Auto Adjust Scale | + | | width="90%" | Bit Depth |
| |- | | |- |
− | | colspan="2" | Yes: Automatically convert ADC samples to match the full bit depth of the DSP buffer. No: Leave the ADC samples at the native bit depth. | + | | colspan="2" | Maximum number of bits for each ADC sample. |
| |- | | |- |
| | width="10%" align="center" | [[File:Fc9-type-16-icon.png]] | | | width="10%" align="center" | [[File:Fc9-type-16-icon.png]] |
Line 229: |
Line 161: |
| | colspan="2" | Number of micro seconds to wait for the ADC input to charge before starting the analogue sample. | | | colspan="2" | Number of micro seconds to wait for the ADC input to charge before starting the analogue sample. |
| |- | | |- |
− | | width="10%" align="center" | [[File:Fc9-type-21-icon.png]] | + | | width="10%" align="center" | [[File:Fc9-type-7-icon.png]] |
− | | width="90%" | Bit Depth | + | | width="90%" | Remap Values |
| |- | | |- |
− | | colspan="2" | Maximum number of bits for each ADC sample. | + | | colspan="2" | Map the analog input range to a selected output range. |
− | |}==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="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]] |
− | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''AddSample''' | + | | width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Mapping |
| |- | | |- |
− | | colspan="2" | Adds a single ADC sample to the current location in the specified buffer. If Auto Scale is enabled then the sample will be scaled to correctly fit inside the buffer. Auto increments current location.
| |
| |- | | |- |
| + | | width="10%" align="center" | [[File:Fc9-type-7-icon.png]] |
| + | | width="90%" | Input Full Range |
| |- | | |- |
− | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | + | | colspan="2" | Selects if the entire range of the ADC is mapped. Yes: Use the full ADC range No: Use a custom ADC range |
− | | 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="10%" align="center" | [[File:Fc9-type-21-icon.png]] |
− | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''AddSampleArray'''
| + | | width="90%" | Input Min |
− | |-
| |
− | | colspan="2" | Adds a single ADC sample to the current location in the specified buffer. If Auto Scale is enabled then the sample will be scaled to correctly fit inside the buffer. Auto increments current location.
| |
− | |-
| |
− | |-
| |
− | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
| |
− | | width="90%" | SampleDelay
| |
− | |-
| |
− | | colspan="2" | Number of us in between each sample.
| |
− | |-
| |
− | | 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''
| |
− | |}
| |
− | | |
− | | |
− | | |
− | | |
− | ==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''' | |
| |- | | |- |
| + | | colspan="2" | Min value provided by the ADC input |
| |- | | |- |
| | width="10%" align="center" | [[File:Fc9-type-21-icon.png]] | | | width="10%" align="center" | [[File:Fc9-type-21-icon.png]] |
− | | width="90%" | Buffer Size | + | | width="90%" | Input Max |
| |- | | |- |
− | | colspan="2" | Number of individual elements the buffer can store, default 1. | + | | colspan="2" | Max value provided by the ADC input |
| |- | | |- |
− | | width="10%" align="center" | [[File:Fc9-type-16-icon.png]] | + | | width="10%" align="center" | [[File:Fc9-type-14-icon.png]] |
− | | width="90%" | Buffer Type | + | | width="90%" | Output Min |
| |- | | |- |
− | | colspan="2" | Sets the buffer data type, data is automatically scaled to fit and make full use of the data type. | + | | colspan="2" | Min value to output |
| |- | | |- |
− | | width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]] | + | | width="10%" align="center" | [[File:Fc9-type-14-icon.png]] |
− | | width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Connections | + | | width="90%" | Output Max |
| |- | | |- |
− | |-
| + | | colspan="2" | Max value to output |
− | | width="10%" align="center" | [[File:Fc9-type-6-icon.png]]
| |
− | | width="90%" | Channel
| |
− | |-
| |
− | | colspan="2" | Analogue Input Channel - Which pin is the analogue input connected to? | |
| |- | | |- |
| | width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]] | | | width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]] |
− | | width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Settings | + | | width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Simulation Slider |
| |- | | |- |
| |- | | |- |
| | width="10%" align="center" | [[File:Fc9-type-7-icon.png]] | | | width="10%" align="center" | [[File:Fc9-type-7-icon.png]] |
− | | width="90%" | Auto Adjust Scale | + | | width="90%" | Show Slider |
| |- | | |- |
− | | colspan="2" | Yes: Automatically convert ADC samples to match the full bit depth of the DSP buffer. No: Leave the ADC samples at the native bit depth. | + | | colspan="2" | Allows the ADC input to be driven from a slider. |
| |- | | |- |
− | | width="10%" align="center" | [[File:Fc9-type-16-icon.png]] | + | | width="10%" align="center" | [[File:Fc9-type-21-icon.png]] |
− | | width="90%" | VRef option | + | | width="90%" | Major Tick Step |
| |- | | |- |
− | | colspan="2" | Defines what is used as the ADC maximum reference. ADC Range = GND to VRef Voltage VDD - Defines the microcontrollers power supply pin as the max reference, VREF+ Pin - Dedicated pin on the microcontroller to allow for a variable reference voltage. | + | | colspan="2" | The number of minor tick marks to show a major tick mark value. |
| |- | | |- |
− | | width="10%" align="center" | [[File:Fc9-type-16-icon.png]] | + | | width="10%" align="center" | [[File:Fc9-type-15-icon.png]] |
− | | width="90%" | Conversion speed | + | | width="90%" | Minor Tick Step |
− | |-
| |
− | | colspan="2" | Clock setting to select how fast the ADC peripheral will perform an ADC conversion. The FRC setting is based on a RC time base and so will vary with temperature and pressure. Other settings are generally based on divisions of the master clock.
| |
− | |-
| |
− | | width="10%" align="center" | [[File:Fc9-type-14-icon.png]]
| |
− | | width="90%" | Acquisition cycles
| |
| |- | | |- |
− | | colspan="2" | Number of micro seconds to wait for the ADC input to charge before starting the analogue sample. | + | | colspan="2" | The scale value between consecutive minor tick marks. |
| |- | | |- |
− | | width="10%" align="center" | [[File:Fc9-type-21-icon.png]] | + | | width="10%" align="center" | [[File:Fc9-type-10-icon.png]] |
− | | width="90%" | Bit Depth | + | | width="90%" | Label Format |
| |- | | |- |
− | | colspan="2" | Maximum number of bits for each ADC sample. | + | | colspan="2" | |
| |} | | |} |