PIT Timer Problem

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

PIT Timer Problem

Jump to solution
1,445 Views
jjacp
Contributor III

Hi dumitru-daniel.popa,

 

I’m currently on Lecture 10 (Open Loop with Speed Estimator) in your MPC5744P Model-Based BLDC Motor Control class, but I am stuck. It seems that in my Open Loop model, the PIT only fires 3 to 5 times at startup, and then stops (see attached FreeMASTER screenshot), and so the estimated speed is always zero.

 

To double check the PIT, I created a new model that only has a PIT on Channel 1, and increments a variable every time it is called. The model and FreeMASTER screenshot is attached. As you can see, the Test_Count variable is never changed, so it seems as though the PIT never fires and the ISR is never invoked.

 

I checked the generated C source code files, and it looks like the PIT is getting initialized and called correctly. I also checked the intc_sw_vectable.c file (as per this issue, in which the poster’s description of the problem seems very similar), and the PIT ISRs are assigned the proper slots.

 

Have you encountered this error before??

 

Here are details on my setup:

 

Hardware:

MPC5744P Dev Kit with DEVKIT-MOTORGD

BLDC motor with 3 Hall-Effect sensors

 

Software:

MATLAB R2016b

NXP Model Based Design Toolbox v2.0.0

S32DS Power v1.2 Compiler

FreeMASTER 2.0

Hotfixes 3 and 5 from https://community.nxp.com/thread/451804#comment-916493

 

Thank you!!

1 Solution
1,219 Views
jjacp
Contributor III

So I seemed to have fixed my issue. Somehow. 

In my stand-alone PIT model that I attached, I added a test variable that always increments, and the PIT started working. 

In my Lec 10 model (Open Loop Control with Speed Estimator), I changed the PIT priority to 25 as set in the example Lec 10 model file, but I did not add a test counter variable--and now it's working. It's correctly estimating the speed as shown in SPD_RPM.

View solution in original post

0 Kudos
3 Replies
1,220 Views
jjacp
Contributor III

So I seemed to have fixed my issue. Somehow. 

In my stand-alone PIT model that I attached, I added a test variable that always increments, and the PIT started working. 

In my Lec 10 model (Open Loop Control with Speed Estimator), I changed the PIT priority to 25 as set in the example Lec 10 model file, but I did not add a test counter variable--and now it's working. It's correctly estimating the speed as shown in SPD_RPM.

0 Kudos
1,219 Views
dumitru-daniel_
NXP Employee
NXP Employee

Hi jjacp‌,

It's a bit strange. I tried your original model on my setup (Matlab 2017a + MPC5744P DevKit) and it works fine.

pastedImage_1.png

pastedImage_2.png

As a hint - try to delete the generated folder from time to time. Sometimes the MATLAB with cache some of the files needed for code generation - and that might explain why it did not work.

Best regards,

Daniel

1,219 Views
jjacp
Contributor III

Thanks Daniel. Very strange indeed, but I'll be sure to manually delete the generated folders every so often.

0 Kudos