Dear NXP experts:
Could you please provide me a MPC5642A(or MPC5644A) PIT ISR example, which is built in CodeWarrior 10.5?
I have such PIT ISR example for S32 DesignStudio and CodeWarrior 2.10.
But for some reason, I have to chose CodeWarrior 10.5 as my IDE.
thanks a lot
YiChaun
Solved! Go to Solution.
Hi, I made this in the past for CodeWarrior 10.6:
Hi, I made this in the past for CodeWarrior 10.6:
Hello David:
I'm sorry I have to ask for help again.
I've tried your example on my Target board (not an evaluation kit, it's real automotive ECU).
environment : CodeWarrior 10.5, MPC5642 A
It falls into dead loop in function FMPLL_init(), the debugger snapshot is below:
while (FMPLL.SYNSR.B.LOCK != 1) {};
Then , this initialization code block is replaced with following codes,
(it works well on the ECU, the only problem it that a PIT ISR is required in CodeWarrior 10.5)
FMPLL.SYNCR.R = 0x05080030; /* Initial setting: 40 MHz for 8 MHz crystal */
while (FMPLL.SYNSR.B.LOCK != 1) {}; /* Wait for LOCK = 1 */
FMPLL.SYNCR.R = 0x05080430; /* Enable FM */
while (FMPLL.SYNSR.B.LOCK != 1) {}; /* Wait for FMPLL to LOCK again */
FMPLL.SYNCR.R = 0x05000430; /* Final setting: 112M (X+4)*8 MHz for 8 MHz crystal */
Another error is the SW runs into A trap, please see below:
I only changed the main.c.
The main.c and the whole project are attached.
thanks and BR
YiChuan
I think you have incorrectly configured flash controller.
Please open __ppc_eabi_init.c file and add following two lines at the beginning of the file after #include "MPC5642A.h":
#define FLASH_REG FLASH_A.BIUCR.R
#define FLASH_DATA 0x00018C55
I believe it’ll solve your issue.
Thus right values are
MPC5642A:
Up to 153MHz : 0x00018C55
Up to 100MHz : 0x00016B55
Up to 90MHz : 0x00014A55
MPC5644A:
Up to 153MHz : 0x00019C55
Up to 100MHz : 0x00017B55
Up to 90MHz : 0x00015A55
Hello David:
Now the PIT ISR can work, thank you very much.
My MCU is 5642A.
Best Regards
Yichuan
Do you have MPC5644A or MPC5642A? there is a difference in used flash memory there.
Dear David:
thank you very much.
I'll try to implement my application based on your example.
BR
YiChuan