Main Content

Add Hardware Interrupt Trigger Block for Current Control Loop

In the Simulink® Library Browser, select and add the C28x Hardware Interrupt block from Embedded Coder® Support Package for Texas Instruments™ C2000™ Processors > Scheduling.

In the block parameters dialog box, update the settings to configure the hardware interrupt ADCINT1. In the block parameters dialog box, identify and update the PIE and CPU interrupts for the hardware interrupt ADCINT1.

Parameter in C28x Hardware Interrupt BlockSettings

CPU interrupt numbers


PIE interrupt numbers


In the current control subsystem, add a Trigger block and set the Trigger type parameter to function-call. Connect this subsystem trigger input to the Hardware Interrupt block as shown in this figure.

In the Rate Transition block input to Current Control subsystem, change the Output port sample time to -1.

Add a Function-Call Generator block in variant source to support the model simulation. In the Function-Call Generator block, set the Sample time parameter as Ts (50e-6).

Simulate the model with the updated driver blocks and check the simulation results in the simulation Data Inspector. Variants ensure that ADC, PWM drivers, and interrupts are not active for simulation.