I'm learning the example project of BlinkLED. And it runs well. However, the example is to make LED2 blink, then I'm trying to modify the code to make other LED blinking. (let's say LED1 as an example)
Original Code:(same as a tutorial)
void pitCh0Handler(void){
PIT_DRV_ClearStatusFlags(INST_PIT1, 0U); /* Clear PIT channel 0 interrupt flag */
SIUL2->GPDO[0] ^= SIUL2_GPDO_PDO_4n_MASK; / * Toggle LED (GPIO 0 connected to user LED 2) */
}
int main(void){
CLOCK_DRV_Init(&clockMan1_InitConfig0);
PINS_DRV_Init(NUM_OF_CONFIGURED_PINS, g_pin_mux_InitConfigArr);
INT_SYS_InstallHandler(PIT_Ch0_IRQn, &pitCh0Handler, NULL);
PIT_DRV_Init(INST_PIT1, &pit1_InitConfig);
PIT_DRV_InitChannel(INST_PIT1, &pit1_ChnConfig0);
PIT_DRV_StartChannel(INST_PIT1,0U);
}
Modify area:
change pin mux to PA[4], which represents LED1.
SIUL2->GPDO[4] ^= SIUL2_GPDO_PDO_4n_MASK
Result: LED1 turns on, but never blink.
Does anyone know why?
I think the problem is "SIUL2_GPDO_PDO_4n_MASK", but I couldn't find any pin muxing in the MPC5748G datasheet!
No matter what I search ("SIUL", "GPDO", “GPDI”) inside the datasheet, I receive very limited information. Unlike MPC5744P datasheet, clear and helpful. Or am I looking at wrong data datasheet?
Please helps!