Main Content

EDSADC

Measure voltage of analog input pin using delta-sigma conversion

Since R2024b

  • EDSADC block icon

Libraries:
Embedded Coder Support Package for Infineon AURIX TC3x Microcontrollers / AURIX TC3x

Description

The EDSADC block measures the voltage of an analog input pin using delta-sigma conversion.

It outputs the voltage as a single-precision floating-point number, unsigned, or signed 16-bit count formatted as an N-by-1 array. The delta-sigma conversion process can utilize either the on-chip modulator or the external modulator, which you select in the EDSADC Peripheral Configuration tool. The block provides the conversion results continuously based on the filter parameters that you specify when configuring the EDSADC peripheral in the Hardware Mapping tool.

Examples

Ports

Output

expand all

When you set the Result type parameter to Voltage, the block outputs the measured voltage as a single-precision floating-point number. When you set the Result type parameter to Counts, the block outputs the voltage as a 16-bit count formatted as an N-by-1 array, where N varies based on the parameter values, as shown in this table.

Read ModeFIFOTimestampValid FIFO LevelSize of Result
Number of 16-bit data to read: 1 DisableDisableStage 11-by-1
EnableDisableStage 11-by-1
Stage 22-by-1
Stage 33-by-1
Stage 44-by-1
EnableStage 21-by-1
Stage 32-by-1
Stage 43-by-1
Number of 16-bit data to read: 2 EnableDisableStage 22-by-1
Stage 44-by-1
EnableStage 43-by-1

Data Types: uint16 | int16 | single

The block outputs the auxiliary result as a 16-bit signed value or a single-precision floating-point number, depending on the choice of Result type parameter. Use this port to obtain to obtain immediate result of conversion, bypassing the offset and integrator filter stages during conversion.

Dependencies

To enable this port, select the Auxiliary result parameter.

Data Types: int16 | single

The block outputs the current value of the 16-bit timestamp counter.

Dependencies

To enable this port, select the Enable timestamp parameter.

Data Types: uint16

Parameters

expand all

Select this parameter to enable the timestamp output port..

Selecting this parameter also enables options in the Timestamp tab and Timestamp event (under Events tab) in the EDSADC Peripheral Configuration tool.

Note

Configure the trigger signal before selecting the Enable timestamp parameter, since the timestamp is always associated with a trigger signal.

Select this parameter to enable the aux_result output port. The block outputs the auxiliary result as a single-precision floating-point number or a signed 16-bit value.

Selecting this parameter enables the related parameters in the EDSADC Peripheral Configuration tool.

Select this parameter to enable the FIFO register.

Specify the number of 16 bit output data to read.

Specify 2 to fetch the data faster from the FIFO register.

Dependencies

To enable the Number of 16 bit data to read parameter, select the Enable FIFO parameter.

Level of the FIFO register for data transfer.

The option 1 appears if you disable Enable Timestamp

Dependencies

To enable the FIFO level parameter, select the Enable FIFO parameter.

Specify the type of the output at the result port.

Specify the data type of the output at result port.

Dependencies

To enable this parameter, set the Result type parameter to Counts.

Specify in seconds how often the block should read the analog pin(s).

When you specify this parameter as -1, Simulink® determines the best sample time for the block based on the block context within the model.

Version History

Introduced in R2024b