| Target Support Package™ IC1 | ![]() |
Generate asynchronous function-call trigger when interrupt occurs
Target Support Package IC1/ C166 Driver Library/ Interrupts
The Fast External Interrupt block executes a function-call triggered subsystem in the context of the service routine for a fast external interrupt. To generate the interrupt, you must select one of the upper eight pins of Port 2 (P2.8 to P2.15)
The function-call subsystem will be executed as an asynchronous task. Use this block to assign the task a Simulink® priority and a CPU interrupt level. The settings that you assign must be consistent with priorities and interrupt levels of other tasks defined in the model.
Limitations on XC16x Hardware
On XC16x hardware, this block is unable to generate code to enable fast external interrupts. Fast external interrupts must be enabled by setting bits in the register EXICON. On XC16x devices this register is write protected after execution of the special EINIT instruction by the processor's register security mechanism. It is not possible for the driver block to generate code that is executed before the EINIT instruction.
If you want to use this block on XC16x hardware, you must set the required bits in register EXICON in the Project Options within the Tasking EDE. For example, to enable fast external interrupts on rising or falling edges for both of pins P2.8 and P2.9 (as required by the demo model c166_async), follow these steps:
Build the model c166_async.
Open the project c166_async_c166 within the Tasking EDE.
Select Project > Project Options.
In the Project Options dialog box, select in the tree Application > Startup > EXICON.
Set the value to 0x000F.
Select the check box to Include in startup code.
From within the Tasking EDE, re-build the project c166_async_c166.
Download to the XC16x by launching Crossview from the CrossView button in the Tasking EDE.
Alternatively, you can create a new template project with the required setting for EXICON. You can easily create a new template project from the MATLAB® Start menu by selecting Start > Links and Targets > Embedded IDE Link TS > Create New Template Projects.

Select a port. Options are 8 to 15.
Select from Rising or falling edge (the default), Rising edge, Falling edge, or Disabled.
Set a Simulink priority. The default is 30.
Select an interrupt level from 1 to 15. The default is 5.
Select an interrupt level group from 0 to 3. The default is 1.
Select this check box (and click Apply) to get an input port for simulation.
![]() | Digital Out | Serial Receive | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |