Main Content

Encoder Peripheral Configuration

Map encoder peripherals in the Infineon AURIX model to peripheral registers in the MCU

Since R2022b

Description

View and edit the map of peripherals in the Infineon® AURIX™ model to the hardware peripherals.

Encoder block is developed based on GPT12 (general purpose timer) module available in the AURIX TC4x devices.

Using the Peripheral Configuration tool, you can:

  • View and edit the configuration parameters for the Encoder peripheral block.

  • Configure the module specific parameters in Browser > Peripherals > Encoder. For more, see Hardware Mapping

  • Check for conflicts, if any between peripherals.

In this workflow, we have used pwm_hw as the project name and hence peripheral block name is named as pwm_hw/Encoder.

Encoder Peripheral

Open the Encoder Peripheral Configuration

  • In the Simulink toolstrip, go to Hardware tab and click Hardware Mapping.

Parameters

expand all

Global parameters

Select the general purpose timer (GPT) prescaler for GPT1.

Basic

Specify the encoder resolution.

Specify the encoder offset in counts.

GPT12

Select the GPT12 module.

Select the GPT12 resolution.

  • Two-Fold - Considers two edges of encoder sensor signal A.

  • Four-Fold - Considers both the edges of both encoder sensor signals A and B.

Select the encoder pin A.

Select the encoder pin B.

Select this parameter if encoder has Z signal.

Select the encoder pin Z.

Dependencies

To enable the PinZ parameter, select the Enable zero signal parameter.

Enable this parameter to measure slower speeds.

Note

Enable this parameter, if the application requires to measure the speed of the encoder at a rate faster than the encoder signals.

Select the general purpose timer (GPT) prescaler for GPT2.

Dependencies

To enable the GPT2 prescaler parameter, select the Enable slow speed detection parameter.

Slow speed threshold calculation is enabled when the threshold goes below the default value.

Dependencies

To enable the Speed mode threshold(RPM) parameter, select the Enable slow speed detection parameter.

Select this parameter to enable the interrupt on zero signal.

Enabling this parameter, will enable the event source name. The event source name is displayed and can be mapped in the tasks(CPU1)

Dependencies

To enable the Enable interrupt on zero signal parameter, select the Enable zero signal parameter.

Select the input mode for the pinA/B/Z.

Select the pin speed.

Select the pin voltage level.

Version History

Introduced in R2022b