In Simulink library browser, select C28x Hardware Interrupt block from Embedded Coder Support Package for Texas Instruments C2000 Processor > Scheduling.
In C28x Hardware Interrupt block mask dialog, update the settings to configure hardware interrupt ADCINT1. From the C28x Hardware Interrupt, identify the PIE and CPU for ADCINT1.
Parameter in C28x Hardware Interrupt Block | Settings |
---|---|
CPU interrupt numbers | [1] |
PIE interrupt numbers | [2] |
In Current control, add a Trigger block and change the Trigger type to
function-call
. Connect this subsystem trigger input to the
Hardware interrupt block as shown in the below figure.
In the Rate Transition block's input to Current Control, change the sample time to -1.
Add a Function-Call Generator block in variant source to support the model simulation. In Function-Call Generator, set the Sample time as Ts (50e-6).
Simulate the model with updated drivers blocks and ensure that the simulation results in Simulink Data Inspector. Variants ensure that ADC, PWM drivers and interrupts are not active for simulation.