I am working on MPC5777C with s32ds.
And I want to use the eTPU function 'PWMM', but my project doesn't work.
The core clock has 260Mhz, and the system clock has 200Mhz.
And eTPU clock has 200Mhz.
Now, I have been check the system clock using ENGCLK pin and it works well.
As next step, I saw the example application AN5374, PWMM Demo with MPC5746R.
So I merged the eTPU function library from that example, and modified.
However, the TCR1 and TCR2 do not make counter. So, I think something's wrong.
But I can't find the problem.
There's not enough information about ePTU functoin with MPC5777C for me....
So Can I get the solution with my project?
First, I attatch some c files.
And I can upload my project for exactly information.
email@example.com and me are still having a problem when using the PWMM function compiled in eTPU2 config, as it won't work, whereas the same function compiled in eTPU config does work fine in our MPC5777C project. Do you also have the same problem? Do you think there could be something to fix in the host cpu side interface functions such as fs_etpu_pwmm_init, fs_etpu_pwmm_config etc.. rather than in the eTPU function itself?
We are now building the eTPU/eTPU2 functions set by ourselves using the NXP CW Compiler and in eTPU2 mode we get no run-time exception, but in that mode the PWMM function does not output any waveform, and by using FreeMASTER we can confirm that the duty cycles are just zeros at all time, despite we provide alpha/beta inputs (which make the same function work fine if compiled in eTPU mode).
sorry for issues you are seeing. I managed to reproduce the fault behavior of PWMM compiled for eTPU2 on HW. When testing the PWMM function compiled for eTPU2 within simulator everything works fine. When complied for eTPU it works with no problem on HW.
What I can observe here is illegal instruction generated by engine 1 where the function is configured to run. It implies there is something wrong with the eTPU microcode. I have not found the bug yet but I'll keep investigating. I'll let you know once I find it.
Thanks for understanding
I have also issues when trying to test etpu PWMM function with MCP5777c.
I also followed AN5374, I can see the TCR1 counting up, but there is no PWMs output visible on the ETPUA10-18 pins.
I have been checking the initialization of the etpu very carefully and I noticed an illegal instruction happens on etpuA (eTPU->MCR(ILFA)) as soon as the master channel is enabled, after the initialization.
The application note AN5374 has a little issue by the way, it says to call
fs_etpu_pwmm_config(&pwmm_instance, &pwmm_config, &pwmm_inputs);
but this function does not provide the parameter pwmm_inputs on the last version of the PWMM API (should use the set_inputs function)
I attach my source code to this message, maybe you could see what is wrong?
Edit : I tried the same code with a previous version of the etpu code for PWMM (etpu_set.h) and now it is working fine ( no illegal instruction when enabling the master channel)
Could it be a bug in the current version?
I take the liberty to reopen this topic.
PWMM works fine with me if I use etpu"1" function set but crashes when using etpu2 function (illegal instruction happens on etpuA (eTPU->MCR(ILFA)) when activates the master channel )
For now, it is OK, Im just using etpu1 functions set. But for the future, I will probably use the QD function which is only available in eTPU2.
Do you have any update why this is happening?
Thanks. I have some update :
Actually the problem only appears when using eTPU2 function set. I tried with latest version of eTPU PWMM function and it works fine.