Difference between revisions of "Component: Input ADC (DSP)"

From Flowcode Help
Jump to navigationJump to search
(XML import)
 
Line 21: Line 21:
  
 
==Examples==
 
==Examples==
''<span style="color:red;">No additional examples</span>''
 
  
 +
Some examples containing the Input ADC component.
 +
 +
{{fcfile|On_Off_Control_Sim.fcfx|On Off Control}}
 +
 +
{{fcfile|PID_Control_Sim.fcfx|PID Control}}
  
 
==Downloadable macro reference==
 
==Downloadable macro reference==

Revision as of 22:08, 9 August 2021


Author Matrix Ltd
Version 1.2 (Release)
Category DSP


Image Input ADC component

Allows the values from a buffer to be assigned driectly from an analog enabled pin. Either a single sample at a time or a number of samples. Auto scales the digital value to fill the entire range of the specified buffer type.

Examples

Some examples containing the Input ADC component.

FC6 Icon.png On Off Control

FC6 Icon.png PID Control

Downloadable macro reference

AddSample

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.

Parameters

This macro has no parameters


Return value

This call does not return a value


AddSampleArray

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.

Parameters

UINT SampleDelay
Number of us in between each sample.


Return value

This call does not return a value


Simulation macro reference

This component does not contain any simulation macros


Property reference

Buffer Size

This property is of type Unsigned integer and can be referenced with the variable name BuffSize.

Number of individual elements the buffer can store, default 1.

Buffer Type

This property is of type Fixed list of ints and can be referenced with the variable name BuffType.

Sets the buffer data type, data is automatically scaled to fit and make full use of the data type.

Channel

This property is of type Single analog pin and can be referenced with the variable name adc_base1::channel.

Analogue Input Channel - Which pin is the analogue input connected to?

VRef option

This property is of type Fixed list of ints and can be referenced with the variable name adc_base1::vrefop.

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.

Conversion speed

This property is of type Fixed list of ints and can be referenced with the variable name adc_base1::convspd.

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.

Acquisition cycles

This property is of type Signed integer and can be referenced with the variable name adc_base1::actime.

Number of micro seconds to wait for the ADC input to charge before starting the analogue sample.

Bit Depth

This property is of type Signed integer and can be referenced with the variable name adc_base1::bits.

Maximum number of digital bits the ADC can sample.

8 bit = ADC range 0 - 255

10 bit = ADC range 0 - 1023

12 bit = ADC range 0 - 4095

Scope Traces

This property is of type True or false and can be referenced with the variable name adc_base1::ScopeTraces.

Selects if the scope traces are automatically generated or not