Main Content

DSADC

Measure voltage of an analog input pin using delta-sigma conversion

Since R2023b

  • DSADC block

Libraries:
SoC Blockset Support Package for Infineon AURIX Microcontrollers / AURIX TC4x

Description

Measure the voltage of an analog input pin.

The Delta-Sigma Analog to Digital Converter (DSADC) block outputs the voltage as an unsigned or signed 16-bit count, as a N-by-1 array. The data conversion is based on the selection of either the on-chip modulator or the external modulator in the DSADC Peripheral Configuration. The block provides conversion results continuously based on the filter parameters that are configured in the DSADC Peripheral Configuration.

Ports

Output

expand all

The block outputs the voltage as a 16-bit count (N-by-1 array, where N is defined based on the timestamp and FIFO level configuration).

The size of result output depends on the selection of other parameters in the block:

Read modeFIFOTimestampValid FIFO LevelSize of result
Number of 16-bit data to read: 1DisableDisableStage 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: 2EnableDisableStage 22-by-1
Stage 44-by-1
EnableStage 43-by-1

Data Types: uint16 | int16

The block outputs the auxiliary result as a 16-bit value. This output can be used 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: uint16

The port outputs the status of the 16-bit counter value of timestamp counter.

Dependencies

To enable this port, select the Enable timestamp parameter.

Data Types: uint16 | int16

Parameters

expand all

Enable the auxiliary result as additional output (16-bit).

Selection of this parameter enables the related parameters in the DSADC Peripheral Configuration.

Select to enable the timestamp.

When you select the Enable timestamp parameter, the block configures an additional output port, timestamp.

Selection of this parameter enables options in the Timestamp tab and Timestamp event (under Events tab) in the DSADC Peripheral Configuration.

Note

As the timestamp is always associated with the trigger, it is recommended that you configure and provide the trigger accordingly, when the timestamp is enabled. Otherwise, the FIFO functionality does not work, as timestamp is flushed into FIFO first and then to the result registers.

Enable FIFO.

Enabling this parameter results in the addition of two new parameters – Number of 16 bit data to read and FIFO Level.

Number of 16 bit data to read.

Keeping this value at 2 helps in fetching the data faster from the FIFO.

FIFO level for data transfer.

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.

Data type of the result.

Version History

Introduced in R2023b