Main Content

PWM Peripheral Configuration

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

Since R2022b

Description

View and edit the module and channel settings of PWM peripherals in the Infineon® AURIX™ model.

Using the Peripheral Configuration tool, you can:

  • View and edit the module and channel of PWM peripherals.

  • Configure the global parameters. To set the group peripheral, select peripheral in Browser > Peripherals > PWM.

    The PWM Global parameters are available only if more than two PWM blocks are used in the model. For more, see Map Tasks and Peripherals Using Hardware Mapping.

  • Check for any conflicts between peripherals.

PWM Peripheral

Open the PWM Peripheral Configuration

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

Parameters

expand all

Global parameters

Select to enable the PWM sync functionality between two PWM blocks.

Note

  • Enable sync group functionality parameter is displayed only if more than one PWM block is available in the model.

  • Enable this parameter only when both the PWM blocks belong to the same module (either Gtm or Egtm).

  • If you use sync functionality for two blocks PWM1 and PWM2 with same parameter configuration in the hardware mapping window except for the Pulse Alignment parameter set to Edge aligned for PWM1 block and the Pulse Alignment parameter set to centre aligned for PWM2 block, then the waveform generated by PWM1 block (IO_P02_0_pin=Z) leads the waveform generated by PWM2 block (IO_P02_8_pin=Z).

    PWM Sync functionality

When you select this option, the dialog box displays the Drive Group and Trigger Group options. Two or more PWM blocks in the model enable these global parameters, since these parameters are implied for sync functionality.

The drive group lists all the PWM blocks used in the model. Select the PWM block from the list.

Dependencies

To enable the Drive Group parameter, select the Enable sync group functionality parameter.

The trigger group lists all the PWM blocks used in the model. Select the PWM block from the list.

The PWM generated from the trigger block syncs with the PWM generated from the drive block.

Dependencies

To enable the Trigger Group parameter, select the Enable sync group functionality parameter.

Module

Select the generic timer module (Gtm) or enhanced generic timer (Egtm) module.

Select the Timer Output Module (TOM) or ARU-connected Timer Output Module (ATOM) timer submodule.

Select the timer unit for PWM.

For example, TOM0, 0 represents the cluster number.

Dependencies

The Timer Unit options depends on the selection of Timer submodule. If TOM is set as Timer submodule, then the Timer unit list TOM# options. If ATOM is set as Timer submodule, then the Timer unit list ATOM# options.

Select On to enable the high resolution PWM.

Dependencies

High-Resolution PWM parameter is disabled and Read-only. You can enable this parameter when the Module parameter is set to EGTM and Timer submodule is set to ATOM.

Select this parameter to enable high resolution for the dead-time parameter.

Dependencies

To enable this parameter set Module to EGTM and Timer submodule to ATOM.

Select the PWM clock configuration. The PWM clock configuration parameters lists all the fixed clock and CMU clock options.

For example, if you select Module as Gtm and Timer submodule as TOM, the clock configuration divider is represented as IfxGtm_Cmu_Fxclk. When you select Timer submodule as ATOM, the clock configuration divider is represented as IfxGtm_Cmu_clk. Similarly, for Module Egtm, the clock configuration divider is either IfxEgtm_Cmu_Fxclk or IfxEgtm_Cmu_clk.

For TOM modules there are five different divide values based on the selection and for ATOM there are eight different selections of clock configuration.

  • TOM - FXCLK Divider 0 (20), FXCLK Divider 1 (24), FXCLK Divider 2 (28), FXCLK Divider 3 (212), and FXCLK Divider 4 (216)

  • ATOM - CMUCLK Divider 0 (20), CMUCLK Divider 1 (21), CMUCLK Divider 2 (22), CMUCLK Divider 3 (23), CMUCLK Divider 4 (24), CMUCLK Divider 5 (25), CMUCLK Divider 6 (26), and CMUCLK Divider 7 (27).

Dependencies

Clock configuration depends on the selection made in Module and Timer submodule.

  • If TOM submodule is selected, then fixed clocks are displayed.

  • If ATOM is selected, then configurable CMU clocks are displayed.

Specify the initial frequency (Hz) for PWM.

Select the pulse alignment for PWM.

  • Select edge aligned if you want to generate edge aligned PWM pulse.

  • Select center aligned if you want to generate symmetric center aligned PWM pulse.

Enable this parameter to synchronously update duty for all sync channels.

Enable this parameter to synchronously update frequency for all sync channels.

Dependencies

To enable this parameter, select Enable frequency input parameter in the PWM block.

Enable this parameter to synchronously update phase for all sync channels.

Dependencies

To enable this parameter, select Enable phase input parameter in the PWM block.

Enable this parameter to synchronously update dead time for all sync channels. This parameter is read-only.

Dependencies

To enable this parameter, select Enable dead time properties input parameter in the PWM block.

Specify the type of interrupt event for the PWM as one of these options.

  • None—Select this option when you do not want to specify an interrupt event.

  • Period Interrupt—Select this option to specify an interrupt event at the end of every period.

    Period Interrupt

    Selecting this option also enables the read-only parameter Period Event source name, which provides information on the source of the period interrupt. The source depends onModule, Timer submodule, and Timer unit parameters. You can map the name in the tasks (CPU1).

    Period Interrupt task

  • Duty Interrupt—Select this option to enable an interrupt at the start of every duty cycle.

Duty Interrupt

Specify the duty event based on the module and channel pair.

Channel pairs such as channel 0 and channel 1, channel 2 and channel 3, …. , channel 14 and channel 15, share same duty event sources. For example, if you select the GtmModule and the channel 0 and channel 1 pair, the available duty options are:

  • IfxGtm_Pwm_SubModule_Ch_0

  • IfxGtm_Pwm_SubModule_Ch_1

If you select the IfxGtm_Pwm_SubModule_Ch_0 event, the block enables the read-only Duty Event source name parameter in Channel 0 tab.

Note

To select the duty event for the channel pairs, set the Number of outputs parameter in the PWM block appropriately. For example, set the Number of outputs parameter in the PWM block as 13 to use the Duty event for channel 12 and channel 13.

Dependencies

To enable this parameter, set Interrupt Type to Duty Interrupt.

DTM > DTM # - TOM(ATOM) Channels # to #

Specify the source of fast-shut-off for DTM

Options vary based on the values of other parameters. The available options depend on:

  • Module selected in the module tab (Gtm or Egtm)

  • Timer Submodule (TOM or ATOM)

  • Timer unit (TOM# or ATOM#)

Select the trigger source for fast-shut-off of the DTM.

The default value vary based on the value of Fast shut off using parameter.

Note

Ensure that you have configured the appropriate ADC boundary flag in the Boundary tab of DSADC Peripheral Configuration.

Dependencies

To enable this parameter, set the Fast shut off using parameter to Auxiliary Input# or Tim_Input#.

Select pin number for trigger source.

Note

The trigger source pin must be held low or high based on the fast shut off configuration.

  • If you disable the Invert input signal parameter, PWM shuts off when pin is active high.

  • If you enable the Invert input signal parameter, PWM shuts off when pin is active low.

Dependencies

To enable this parameter, set the Trigger source parameter to General purpose pin.

Output #

The number of channel(s) selected in the PWM block will appear in their respective channel tabs of the PWM peripheral. Each of these channels must be configured respectively.

Dependencies

The channel # list depends on

  • Module selected in the module tab (Gtm or Egtm)

  • Timer Submodule (TOM or ATOM)

  • Timer unit (TOM# or ATOM#)

Select the PWM output pin channel.

Dependencies

The Output pin # list depends on

  • Module selected in the module tab (Gtm or Egtm)

  • Timer Submodule (TOM or ATOM)

  • Timer unit (TOM# or ATOM#)

  • Channel

Select the output mode for the PWM pin(s).

Select the pin speed.

Select the pin voltage level.

Select the signal polarity of PWM channel.

Specify the PWM initial duty cycle in percentage. Range varies from 0-100%.

Specify the initial offset in radians.

Select the signal to trigger the QSPI module from the PWM channel.

To trigger QSPI module, set the Trigger source parameter to Hardware trigger and Source of hardware trigger to GTM or eGTM in the corresponding Module tab of QSPI Hardware Mapping window.

For more information on QSPI trigger signals corresponding to the GTM module, see QSPI Trigger Signals Corresponding to GTM Module.

For more information on QSPI trigger signals corresponding to the eGTM module, see QSPI Trigger Signals Corresponding to eGTM.

The QSPI Trigger Signal list depends on:

  • Source of hardware trigger in the QSPI module tab (GTM or eGTM)

  • Timer Submodule in the PWM module tab (TOM or ATOM)

  • Timer unit in the PWM module tab

  • Channel

Note

You must have a QSPI block in the model to trigger the QSPI module. You can trigger multiple QSPI modules by configuring them in different QSPI blocks.

Enables the complementary output for PWM.

Select the PWM complementary output pin.

Dependencies

To enable the Complementary output pin parameter, select the Enable complementary output parameter.

Select the signal polarity of complementary pin.

Dependencies

To enable the Signal polarity of complementary pin parameter, select the Enable complementary output parameter.

Enables the dead time insertion.

For more information on standard dead time generation, see Dead-Time Module Properties.

Dependencies

To enable the Enable Dead Time Module parameter, select the Enable complementary output parameter.

Specify the PWM dead time for rising edge(s) in seconds.

For more information on standard dead time generation, see Dead-Time Module Properties.

Dependencies

To enable the Dead-time for rising edge(s) parameter, select the Enable Dead time insertion parameter.

Specify the PWM dead time for falling edge(s) in seconds.

For more information on standard dead time generation, see Dead-Time Module Properties.

Dependencies

To enable the Dead-time for falling edge(s) parameter, select the Enable Dead time insertion parameter.

Enable this parameter to trigger ADC conversion at the end of every period.

Note

You must have an ADC block in the model to trigger ADC conversion.

Select the number of ADC trigger channels.

Dependencies

To enable the Number of trigger channels parameter, select the ADC trigger parameter.

Select the ADC trigger signal channel.

Dependencies

  • To enable the Trigger channel# parameter, select the ADC trigger parameter.

  • Number of trigger channels list depends on the timer module selected.

Fast shut off

Enable this parameter to trigger the fast-shut-off of PWM channel.

Dependencies

To enable the Enable fast shut off trigger parameter, select the Enable complementary output and Enable Dead Time Moduleparameters.

Select to invert the input signal of the PWM channels. This specifies the condition for the PWM shut off, either when transitioning from low to high (default) or from high to low. By enabling Invert input signal, you set the PWM to shut off as the value at Pin in DTM tab transitions from high to low.

Dependencies

To enable the Invert input signal parameter, select the Enable fast shut off trigger parameter.

Specify the output polarity when fast shut off is active.

Dependencies

To enable the Output polarity when fast shut off is active parameter, select the Enable fast shut off trigger parameter.

Specify the complementary output polarity when fast shut off is active.

Dependencies

To enable the Output polarity when fast shut off is active parameter, select the Enable fast shut off trigger parameter.

ADC Trigger

Enable this parameter to trigger ADC conversion at the end of every period.

Note

You must have an ADC block in the model to trigger ADC conversion.

Select the number of ADC trigger channels.

Dependencies

To enable the Number of trigger channels parameter, select the ADC trigger parameter.

Select the ADC trigger signal channel.

Dependencies

  • To enable the Trigger channel# parameter, select the ADC trigger parameter.

  • Number of trigger channels list depends on the timer module selected.

SENT trigger

Enable this parameter to trigger SENT transmission at the end of every period.

To trigger SENT module, set the Trigger source parameter to Hardware trigger and select Source of hardware trigger in the corresponding SPC Protocol tab of SENT Configuration window.

The Sent trigger signal list depends on:

  • Source of hardware trigger (GTM or eGTM)

  • Timer Submodule (TOM or ATOM)

  • Timer unit

ModuleTimer unit Sent trigger signal
eGTMTOM0/ATOM0Sent_TriggerSignal_0
TOM1/ATOM1Sent_TriggerSignal_1
ATOM2Sent_TriggerSignal_2
GTMTOM0/ATOM0Sent_TriggerSignal_3
TOM1/ATOM1Sent_TriggerSignal_4
TOM2/ATOM2Sent_TriggerSignal_5
TOM3/ATOM3Sent_TriggerSignal_6
TOM4/ATOM4Sent_TriggerSignal_7
TOM5/ATOM5Sent_TriggerSignal_8
ATOM6Sent_TriggerSignal_9
ATOM7Sent_TriggerSignal_10
ATOM8Sent_TriggerSignal_11
ATOM9Sent_TriggerSignal_12
ATOM10Sent_TriggerSignal_13
ATOM11Sent_TriggerSignal_14

Note

You must have a SENT block in the model to trigger the SENT module. You can trigger multiple SENT modules by configuring them in different SENT blocks.

Select the SENT trigger modules.

More About

expand all

Version History

Introduced in R2022b