I have encountered some problems in the use of SPC5604BCLQ 144pin .
I want to control Enable/Disable 5V out for sensor.
I select PG2 to set GPIO Output to control it.
There will be some error occur when I Enable the SIU.GPDO[98].B.PDO = 1; as the picture below.
I redo a minimal system circuit, no other input and output pins connected, the program can run normally
Now I want to know if there is a problem with my hardware or software program, how can I solve the problem?
void IOInit(void)
{
SIU.PCR[98].B.ODE = 1;
SIU.PCR[98].B.OBE = 1;
SIU.PCR[98].B.IBE = 0;
SIU.GPDO[98].B.PDO = 1;
}
void main(void)
{
asm(" wrteei 0"); // DisableInterrupt;
disableWatchdog();
ME.RUNPC[0].R = 0x000000FE;
/*****************************************
enable PIT_RTI
*****************************************/
ME.PCTL[92].R = 0x00;
/ *****************************************
enable SIUL
*****************************************/
ME.PCTL[68].R = 0x00;
SetupPll();
IOInit();
SIU.GPDO[98].B.PDO = 0; //5v output
for (;;)
{
......
......
}
}
Hi,
you are not initializing the Mode Entry module correctly, so the SIU module is still freezed and not accessible.
Please take a look at this SW example where you can find how to do that (function FMPLL_init):
Example MPC5604B PinToggleStationery CW210
Regards,
Lukas