/* ConstCode for S-Function (c28xisr_c2000): '<Root>/C28x Hardware Interrupt' incorporates:
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Hello guy,
do somebody know how I write in the PWM CMPA/CMPB Registers directly inside of an interrupt.
I'm using Simulink.
Thanks
Hi Kevin,
We have C28x Hardware Interrupt block for the same.
Please refer the example 'c28379Dpmsmfocdual_cpu1_ert' for more information.
Here we are updating the CMPA and CMPB register inside an interrupt.
Hello Venkatesh,
I try to put all PWM blocks into the Interrupt , but it takes to much time.
I just want to write into the CMPA, CMPB and Deadband (DBRED /DBFED) register.
I did use an System Update customcode block and it work, but the variablenames are combined with the projectname. So when I'm save the project under another name, the customcode doesn't work anymore and must be edited.
Also I want to read ADC values.
Can I use the Memory Copy and how? I tried it, but it doesn't work.
Here my settings:
Best regards
Kevin
Hi,
With Memory Copy block you are probably missing on the EALLOW and EDIS instructions before and after the lines of code that update the register values.
To do this, you need to check on the 'Insert custom code.....' options under the Memory Copy 'options' tab.
The options Tab is already captured by you above.
Hello,
it doesn't work.
When I'm looking into the C-Code the Memory Copy blocks aren't in the direct Interrupt function...
I want to overwrite the CMPA/CMPA/ Deadtime values every Interrupt. Also want to read every Interrupt the ADC Values.
That's the generated code: