Main Content

Modeling and Code Generation Using Hardware Interrupt

Use the Hardware Interrupt block to create an interrupt service routine (ISR) automatically in the generated code of your model. The ISR executes the downstream function-call subsystem associated with event ports of the block.

C2000™ Microcontroller Blockset provides 3 workflows to configure the interrupts and generate code in Simulink®.

The following table describes the capabilities of C28x Hardware Interrupt and Hardware Interrupt blocks during modeling and code generation.

Modeling and Code generation Using Hardware Interrupt

  • In this workflow, you can configure interrupts using CPU and PIE numbers. For more, see C28x Hardware Interrupt

  • This workflow is used for flat model approach.

  • C28x Hardware Interrupt block can be used in model config set reference.

  • No event selection capability is available.

  • On using C28x Hardware Interrupt block, the task priority order is negative. Lower priority value indicates a higher priority task.

Modeling and Code Generation Using Hardware Interrupt and Hardware Mapping

Multiprocessor Modeling and Code Generation Using Task Manager and Hardware Mapping

  • Task Manager blocks allows you to configure the interrupts using the Hardware Mapping tool.

  • Using Task Manager block, you can simulate hardware interrupts in Simulink environment and also you can implement timer-driven or event-driven. For more information, see Task Manager

  • Task manager can be used in multiprocessor modeling approach, where task in a particular core is implemented using Model block.

  • In multiprocessor modeling approach, higher priority value indicates a higher priority task. Navigate to Configuration Parameters > Solver > Tasking and sample time options and enable the Higher priority value indicates a higher priority task.

  • Event configuration for hardware interrupts other than the default event does not work with task manager.

See Also

| | | |