Convert analog signal on ADC input pin to digital signal
SoC Blockset / Peripherals
The ADC Interface block simulates the analog-to-digital conversion (ADC) of a hardware board. The input analog signal gets sampled and converted into a representative digital value. A start event message signals the block to sample the input analog voltage signal. When the conversion completes, the block emits the digital representation of the analog signal and sends an event to a Task Manager block. At this point, a connected task can execute with the new ADC sample.
start— Start analog to digital conversion
Specify an event signal to start the sampling and measurement of the analog input port signal.
analog— Analog voltage signal
Specify an Input analog voltage signal to convert into a digital measurement.
digital— SoC message data
This port sends the ADC Interface input signal data as a message to the msg input port of the ADC Read block.
event— Task event signal
This port sends a message at each analog to digital signal conversion event. This output connects to the input of the Task Manager block to execute the associated event-driven task after executing the ADC event.
Resolution (bits)— Resolution of digital measurement
An input analog signal can be represented in digital values in the form of 12 or 16 bits. The minimum value of an analog signal that can be represented in 1 bit is called resolution. One bit represents the minimum voltage resolution measurable by the ADC. The minimum voltage resolution can be determined using the following equation:
n is the Resolution
Vref is the Voltage reference
(V) parameter values.
Voltage reference (V)— Reference voltage in ADC
The reference voltage determines the total voltage range that the ADC can convert into a digital value without saturating. Any voltage signal higher than this value produces the maximum possible value that can represented by the Resolution (bits) parameter.
Acquisition time (s)— Time required for ADC to capture input voltage
320e-9(default) | positive scalar
Specify the time required for the ADC to capture the input voltage during sampling.
Conversion time (s)— Time to convert physical voltage sample to digital value
240e-9(default) | positive scalar
Specify the required time to convert the physical voltage sample to the digital representation and output the value.
To automatically generate C code for your design, and execute on an SoC device, use the SoC Builder tool. To generate and execute C code for your SoC models, Embedded Coder® features are required. For more information on generating code for SoC designs, see Generate SoC Design.