LPC5516 SCT0 No IRQ

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 
5,700件の閲覧回数
sanders7284
Contributor III

Hello I'm using the config tools to set up the SCT and I am having troble getting the IRQ to generate, even thou the counter is running and going passed the match value.

Config Screen Shots

paulsanders_0-1606819344012.png

paulsanders_1-1606819370438.png

Code generated

* BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS **********/
/* clang-format on */
const sctimer_config_t SCT0_initConfig = {
.enableCounterUnify = true,
.clockMode = kSCTIMER_System_ClockMode,
.clockSelect = kSCTIMER_Clock_On_Rise_Input_0,
.enableBidirection_l = false,
.enableBidirection_h = false,
.prescale_l = 0U,
.prescale_h = 0U,
.outInitState = 0U,
.inputsync = 0U
};
uint32_t SCT0_event[1];

static void SCT0_init(void) {
SCTIMER_Init(SCT0_PERIPHERAL, &SCT0_initConfig);
/* Initialization of state 0 */
SCTIMER_CreateAndScheduleEvent(SCT0_PERIPHERAL, kSCTIMER_MatchEventOnly, 25, kSCTIMER_Out_0, kSCTIMER_Counter_L, &SCT0_event[0]);
SCTIMER_SetupCounterLimitAction(SCT0_PERIPHERAL, kSCTIMER_Counter_L, SCT0_event[0]);
/* Enable interrupt SCT0_IRQn request in the NVIC. */
EnableIRQ(SCT0_IRQN);
}

IRQ handler set up

//SCT0_IRQ ---------------------------------------------------------------------
void SCT0_IRQHANDLER (void)
{
if ((SCT0->EVFLAG & 1) == 1) //event 0 pending //1.5uS elapsed
{
SCT0->EVFLAG &= ~1; //Clear the SCT Event 0 Interrupt
GPIO_PortToggle(GPIO, BOARD_INITPINS_LED_RED_PORT, BOARD_INITPINS_LED_RED_GPIO_PIN_MASK);
}
}
//SCT0_IRQ [END] ---------------------------------------------------------------

 

ラベル(2)
タグ(1)
0 件の賞賛
返信
1 解決策
5,662件の閲覧回数
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello paulsanders,

 

It seems the Event0 interrupt haven't enable in the generated code, please enable it by hand, then test

whether interrupt can work.

 

 

元の投稿で解決策を見る

8 返答(返信)
5,663件の閲覧回数
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello paulsanders,

 

It seems the Event0 interrupt haven't enable in the generated code, please enable it by hand, then test

whether interrupt can work.

 

 

5,655件の閲覧回数
sanders7284
Contributor III

Thank you, that fixes the problem.

Thanks for your help.

Think it could be better documented in the SCT explanation in the user manual and also would be nice if the config tools showed you the evernt options not just the SCT IRQ.

0 件の賞賛
返信
5,525件の閲覧回数
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello paulsanders,

Agree with you, I will take a ticket about this suggestion, thanks.

 

Regards,

Alice

5,657件の閲覧回数
sanders7284
Contributor III

Sorry seen your attachment now, I will take a look.

0 件の賞賛
返信
5,658件の閲覧回数
sanders7284
Contributor III

Thanks Alice,

I can only see an IRQ for the SCT as a whole NVIC #12, where are the event IRQ held?

The only other place I can see to set this up is STATEMASKn, and this is already set up correctly.

paulsanders_0-1606988300858.png

 

0 件の賞賛
返信
5,608件の閲覧回数
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello,

 

As I said before "event interrupt enable register (EVEN)"

2020-12-14_9-56-37.jpg

 

 

Regards,

Alice

0 件の賞賛
返信
5,685件の閲覧回数
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello paulsanders,

Could you please share your whole project, I will help to check it on my side, thanks.

 

Regards,

Alice

0 件の賞賛
返信
5,681件の閲覧回数
sanders7284
Contributor III

Thanks Alice, I have attached what files I can.

Regards Paul Sanders

0 件の賞賛
返信