Turn off/kill the sct

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Turn off/kill the sct

1,515 次查看
pinoernino
Contributor I

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

标记 (1)
0 项奖励
回复
1 回复

1,505 次查看
Alice_Yang
NXP TechSupport
NXP TechSupport

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

0 项奖励
回复