The mcd_main function generated from S12ZVM_FOC.slx

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

The mcd_main function generated from S12ZVM_FOC.slx

Jump to solution
1,388 Views
jiangfeng
Contributor III

Hi, Dear Daniel

This is the main function generated from S12ZVM_FOC.slx, however ,I can't find the SYSTEM_TASK() in the while cycle. Should I put the SYSTEM_TASK in the red part or the while loop?

I  have tried to put the SYSTEM_TASK() in the red part or the while loop  ,and then my BLDC didn't work.

Thanks very much.

pastedImage_1.png

Labels (1)
1 Solution
1,181 Views
Daniel_Popa
NXP Employee
NXP Employee

Hi jiangfeng‌,

I'm not sure i've understood your question.

The MBDToolbox generates all the code and setup needed to run the application without the need for any additional hand written code.

That comment is put there in case you want to reuse the generated code for other purposes via an IDE.

By default the code generated by the Matlab is going to place the call to SYSTEM_TASK() within the callback of the TIM_Ch0_ISR interrupt.

Is this what you are looking for ?

pastedImage_1.png

Do not try to call is on the infinite loop. In case you need to use another interrupt source, just call it on that interrupt callback routine since you need a precise timing in order to control the motor.

Hope this helps!

Daniel

View solution in original post

2 Replies
1,182 Views
Daniel_Popa
NXP Employee
NXP Employee

Hi jiangfeng‌,

I'm not sure i've understood your question.

The MBDToolbox generates all the code and setup needed to run the application without the need for any additional hand written code.

That comment is put there in case you want to reuse the generated code for other purposes via an IDE.

By default the code generated by the Matlab is going to place the call to SYSTEM_TASK() within the callback of the TIM_Ch0_ISR interrupt.

Is this what you are looking for ?

pastedImage_1.png

Do not try to call is on the infinite loop. In case you need to use another interrupt source, just call it on that interrupt callback routine since you need a precise timing in order to control the motor.

Hope this helps!

Daniel

1,181 Views
jiangfeng
Contributor III

Hi,,Daniel

I understand. Thanks  very much

0 Kudos
Reply