LPC5516 SCT0 No IRQ

cancel
Showing results for 
Search instead for 
Did you mean: 

LPC5516 SCT0 No IRQ

Jump to solution
489 Views
paulsanders
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] ---------------------------------------------------------------

 

Labels (2)
Tags (1)
0 Kudos
1 Solution
454 Views
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.

 

 

View solution in original post

8 Replies
455 Views
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.

 

 

View solution in original post

446 Views
paulsanders
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 Kudos
316 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello paulsanders,

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

 

Regards,

Alice

448 Views
paulsanders
Contributor III

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

0 Kudos
449 Views
paulsanders
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 Kudos
399 Views
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 Kudos
476 Views
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 Kudos
472 Views
paulsanders
Contributor III

Thanks Alice, I have attached what files I can.

Regards Paul Sanders

0 Kudos