External interrupt generation

AURIX, ERU, ERU Interrupt 1, external request, interrupt

Infineon Technologies AG

External interrupt generation - Infineon Technologies

h. Copyright © Infineon Technologies AG 2020. All rights reserved. Page 6. Implementation. › The below figures from the AURIX™. TC29x B-Step User's Manual ...

PDF preview unavailable. Download the PDF instead.

Infineon-AURIX ERU Interrupt 1 KIT TC297 TFT-Training-v01 01-EN
ERU_Interrupt_1 for KIT_AURIX_TC297_TFT
External interrupt generation
AURIXTM TC2xx Microcontroller Training V1.0.1
Please read the Important Notice and Warnings at the end of this document

Scope of work
The ERU is used to generate an interrupt on each rising and falling edge at an input pin. The code example uses the External Request Unit (ERU) to generate an interrupt for each falling and rising edge at the input pin P02.0. The falling and rising edges are generated with pin P02.1. If an interrupt occurs, an LED will be toggled.
Copyright © Infineon Technologies AG 2020. All rights reserved.

Introduction
> The External Request Unit (ERU) is a versatile event and pattern detection unit.
> Its main task is the generation of interrupts based on selectable trigger events at different inputs, e.g. to generate external interrupt requests if an edge occurs at an input pin.
> The detected events can also be used by other modules to trigger or to gate module specific actions.
Copyright © Infineon Technologies AG 2020. All rights reserved.

Hardware setup
This code example has been developed for the board KIT_AURIX_TC297_TFT_BC-Step.
The two pins P02.0 and P02.1 have to be connected to each other.

Input

Output

Copyright © Infineon Technologies AG 2020. All rights reserved.

Implementation
> To generate an interrupt via a falling and rising edges on an input pin, a few configuration steps are required: ­ Initialize external request pin (IfxScuEru_initReqPin()) ­ Select which edge should trigger the interrupt (IfxScuEru_enableRisingEdgeDetection() and/or IfxScuEru_enableFallingEdgeDetection()) ­ Enable generation of trigger events with the function IfxScuEru_enableTriggerPulse() ­ Choose the output channel by selecting the Output Gating Unit (OGUz) and the trigger pulse output (TRxz) ­ An event from the Event Trigger Logic (ETL0) triggers the OGU0 (signal TRx0). The function IfxScuEru_connectTrigger() determines the output channel for the trigger event ­ Select the condition to generate an interrupt with the function IfxScuEru_setInterruptGatingPattern() ­ Configure and enable the service request with the functions IfxSrc_init() and IfxSrc_enable()
> The functions above are provided by the iLLD headers IfxScuEru.h and IfxSrc.h.
Copyright © Infineon Technologies AG 2020. All rights reserved.

Implementation
> The below figures from the AURIXTM TC29x B-Step User's Manual illustrate the configuration steps that were followed in this example.
Copyright © Infineon Technologies AG 2020. All rights reserved.

Implementation
The Interrupt Service Routine (ISR) Blinking an LED is implemented inside an ISR triggered by the ERU which generates interrupt requests according to its configuration. The method implementing the ISR needs to be assigned a priority and a CPU core responsible for its execution. This is done with the macro IFX_INTERRUPT(isr, vectabNum, priority). When triggered, the ISR blinks the LED by toggling the state of the connected pin using the function IfxPort_setPinState().
Copyright © Infineon Technologies AG 2020. All rights reserved.

Run and Test

After code compilation and flashing the

device, perform the following steps:

1. Connect the two pins P02.0 and

P02.1 to each other.

P02.1 is used to generate the

falling and rising edges by

toggling the state from high to

low. P02.0 is the input of the

ERU which generates the

interrupts on falling and rising

edges.

2. Toggle the P02.1 pin state via

the value of the variable

LEDstate of the structure

1

g_ERUconfig with the

debugger.

3. Check LED D107 (1) is

changing state when the

variable is modified.

Copyright © Infineon Technologies AG 2020. All rights reserved.

References
> AURIXTM Development Studio is available online: > https://www.infineon.com/aurixdevelopmentstudio > Use the ,,Import..." function to get access to more code examples.
> More code examples can be found on the GIT repository: > https://github.com/Infineon/AURIX_code_examples
> For additional trainings, visit our webpage: > https://www.infineon.com/aurix-expert-training
> For questions and support, use the AURIXTM Forum: > https://www.infineonforums.com/forums/13-Aurix-Forum
Copyright © Infineon Technologies AG 2020. All rights reserved.

Revision history

Revision V1.0.1 V1.0.0

Description of change Update of version to be in line with the code example's version Initial version

Copyright © Infineon Technologies AG 2020. All rights reserved.

Trademarks All referenced product or service names and trademarks are the property of their respective owners.

Edition 2020-12 Published by Infineon Technologies AG 81726 Munich, Germany
© 2020 Infineon Technologies AG. All Rights Reserved.
Do you have a question about this document? Email: erratum@infineon.com
Document reference ERU_Interrupt_1_KIT_TC297_TFT

IMPORTANT NOTICE The information given in this document shall in no event be regarded as a guarantee of conditions or characteristics ("Beschaffenheitsgarantie") .
With respect to any examples, hints or any typical values stated herein and/or any information regarding the application of the product, Infineon Technologies hereby disclaims any and all warranties and liabilities of any kind, including without limitation warranties of non-infringement of intellectual property rights of any third party.
In addition, any information given in this document is subject to customer's compliance with its obligations stated in this document and any applicable legal requirements, norms and standards concerning customer's products and any use of the product of Infineon Technologies in customer's applications.
The data contained in this document is exclusively intended for technically trained staff. It is the responsibility of customer's technical departments to evaluate the suitability of the product for the intended application and the completeness of the product information given in this document with respect to such application.

For further information on the product, technology, delivery terms and conditions and prices please contact your nearest Infineon Technologies office (www.infineon.com).
WARNINGS Due to technical requirements products may contain dangerous substances. For information on the types in question please contact your nearest Infineon Technologies office.
Except as otherwise explicitly approved by Infineon Technologies in a written document signed by authorized representatives of Infineon Technologies, Infineon Technologies' products may not be used in any applications where a failure of the product or any consequences of the use thereof can reasonably be expected to result in personal injury.


Microsoft PowerPoint 2016 Microsoft PowerPoint 2016