I would like to turn off the SCT after its task. However I do not know which are the correct commands to insert in the code. I tried these ones:
LPC_SCT->STOP_L = 1;
LPC_SCT->HALT_L = 1;
LPC_SYSCON -> SYSAHBCLKCTRL0 |= (0<<8);
LPC_SYSCON->PRESETCTRL[0] &= ~(1<<8); //Assert the SCT reset
clean = LPC_SWM->PINASSIGN[7]; //copio Pin assign register 6 (per SCT_OUT0_O)
clean &= ~(0xFF<<24); //azzero bit di selezione pin (31:24)
but the problem is that the blue led (which is linked to the state machine) continues to stay on, and I want to turn off.
I have attached the code, in the main there is a commented section where I have to kill the SCT.
Thanks to anyone who can help me
Hello pinoernino, you can refer to the SCTIMER_Deinit() function to disable SCTTIMER:
It is under SDK driver.
void SCTIMER_Deinit(SCT_Type *base)
{
/* Halt the counters */
base->CTRL |= (SCT_CTRL_HALT_L_MASK | SCT_CTRL_HALT_H_MASK);#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL)
/* Disable the SCTimer clock*/
CLOCK_DisableClock(s_sctClocks[SCTIMER_GetInstance(base)]);
#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */
}
Hope it helps,
Alice