iLLD_TC23x
1.0
|
This page describes how to use interrupts with application framework.
Hardware managed interrupts have static interrupt vector which are defined for each priority separately. These vectors have jump instruction to the interrupt handler.
Advantages:
This mechanism has less interrupt latency time.
Software managed interrupts have single interrupt vector statically defined at vector position 255. This address is assigned to BIV during startup.
For Tricore, this vector position is important, because whenever an interrupt occurs, with whichever priority, the execution control jumps to this vector position. The code at this vector position will:
1) fetch the priority of the targetted interrupt.
2) fetch the interrupt handler defined for this priority (this is done by Interrupt handler installation. Refer Step4: How to install Interrupt Service routine/handler?
3) Then call the handler as notmal function call.
Advantages:
This kind of mechanism is useful when project wants to change the handler for an interrupt during runtime.
Disadvantages:
This mechanism has more interrupt latency time.
of the interrupt and in tand jumps to the function
Dependency: Ifx_Compilers, Ifx_Cpu, Ifx_Src, IfxCpu_Irq
Following are the steps to use interrupt mechanism.
Define priorities of all interrupts with names corresponding to their functionality. It is recommended to define such priority definitions in single header file, because it is easy to detect if ISR priorities are conflicting. In Tricore architecture, two Isrs can't have same priority at same point of time.
In a user defined file eg. Ifx_IntPrioDef.h, placed in folder: 0_AppSw/Tricore/DemoApp:
Refer Hardware Managed Interrupt Mechanism. If project is designed for hardware managed interrupts, this feature is enabled at the file Ifx_Cfg.h, at path: 0_Src/0_AppSw/Config/Common/, as shown below. IFX_USE_SW_MANAGED_INT definition must be undefined (i.e. the statement "#define IFX_USE_SW_MANAGED_INT" shall be commented as below).
Refer Software Managed Interrupt Mechanism. If project is designed for software managed interrupts, this feature is enabled at the file Ifx_Cfg.h, at path: 0_Src/0_AppSw/Config/Common/, as shown below. IFX_USE_SW_MANAGED_INT definition must be defined.
Software managed interrupts must also install the "Interrupt Handlers" Refer Step4: How to install Interrupt Service routine/handler?
Interrupt service routines or interrupt handlers are defined in driver specific files or application specific files.
This step is not required for HW managed interrupts.
Interrupt service routines or interrupt handlers are installed in driver specific files or application specific files
For the interrupt to get activated, interrupt triggers are needed. These triggers are activated by peripheral modules and corresponding service request node must be
1) Configured with correct priority number
2) The request node must be enabled
Refer to How to use Service Request Mechanism?