SCTIMER event not triggering on input (LPC824)

cancel
Showing results for 
Search instead for 
Did you mean: 

SCTIMER event not triggering on input (LPC824)

319 Views
jamesward0001
Contributor II

Hi, I'm trying to use the SCTIMER module in my LPC824 to time input signals so i can decode them.  I've managed to get match events to work, however I can't seem to get input events working.  I've set up my event using your sdk like so:

if(SCTIMER_CreateAndScheduleEvent(SCTIMER_1_PERIPHERAL, kSCTIMER_InputRiseEvent, 0, kSCTIMER_Input_1, kSCTIMER_Counter_L, &SCTimer_1_event[0]) == kStatus_Fail){
USART_WriteBlocking(USART0, riseEventFailMsg,35);
}

but it doesn't seem to trigger (i have both a capture and led output set to activate when the event triggers, i know they work with match events).  I suspect the most likely candidate is a faulty config in pinmux.c but I can't find anything wrong, here's the relevant parts out of pinmux as well:

/* SCT_PIN0. Assign to pin using the switch matrix 1 */
INPUTMUX_AttachSignal(INPUTMUX, 1U, kINPUTMUX_SctPin0ToSct0);

/* SCT_PIN0 connect to P0_2 */
SWM_SetMovablePinSelect(SWM0, kSWM_SCT_PIN0, kSWM_PortPin_P0_2);

Anyone got any ideas?  

Thanks,

James

Labels (2)
0 Kudos
2 Replies

147 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello James Ward,

Could you please share your whole project, also tell me the detail steps  to reproduce your issue.

BR

Alice

0 Kudos

147 Views
jamesward0001
Contributor II

Hiya, attached is the project which at the moment should capture the timer value at rise and fall edges on input P0_2 (SCT input0), it should return these values over serial.  it should also blink an LED attached to pin P0_11 on reception of any pulses on that pin (I'm using a custom PCB, not a dev board).  However, the rise and fall events never trigger (no led blink and capture reg remains at 0) no matter what inputs i give them.  I know the output works because i can blink it with a match event and I have managed to get the input working using PINT and GPIO so I know my input signal is fine. 

So, steps to reproduce the problem are to try and create an input triggered event on input 0 using the MCUxpresso config tool, then trigger that event with an input and see what happens.  I think it's most likely my input config is incorrect but I don't know in what way or why.  

Thanks, fingers crossed it's just me being silly.  

James

EDIT:  just realised that i forgot to init INPUTMUX, have now done so but it still doesn't work :smileysad:  

EDIT2: Electric Boogaloo : I tried it with a different Pin and it worked perfectly.  so it looks like his SCT stuff isn't working specifically on that pin however I can still detect GPIO and PINT events on that pin so I have no idea what's causing this.  Are there some pins SCT doesn't work for?

0 Kudos