Using a CTIMER with FreeRTOS on LPC546xx

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Using a CTIMER with FreeRTOS on LPC546xx

Jump to solution
950 Views
anealca
Contributor II

I have FreeRTOS running on my 54628 dev board (OM13098) and can use the LCD, TCP/IP and SD features.

I am using MCUXpresso v10

What I want to do is add a timer to drive 2 GPIO pins (a synchronized set of pulses).

I can use the 4 match setpoints of the timer for the synchonization and reset the TC on the last match.

I should be able to do it with 1 timer (#2) set for Match mode and let my IRQ handler manage the pin output logic.

Attached is my initialization and IRQ logic.

This code compiles without error or warning...

BUT

I cannot seem to get it to work?

It will not stop in the IRQ when debugging it?

 And I don't see the outputs?

Please help...

Labels (3)
1 Solution
812 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi, Adrian,

Regarding your question, I have checked your code, your problem is that you CAN NOT enter CTimer interrupt hadler .

I have changed your code, I attach it here,  but I do not try to compile/link, pls have a try.

BR

XiangJun Rong

View solution in original post

2 Replies
813 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi, Adrian,

Regarding your question, I have checked your code, your problem is that you CAN NOT enter CTimer interrupt hadler .

I have changed your code, I attach it here,  but I do not try to compile/link, pls have a try.

BR

XiangJun Rong

812 Views
anealca
Contributor II

xiangjunrong

YES I was missing the timer start TCR event...

Thanks for that...

I have hard coded my IRQ into the interrupt vectors (in g_pfnVectors[]) because I can't figure out how to dynamically replace the weak definition of CTIMER2_IRQHandler to my IRQ.

I shouldn't need the clocks on the digital outputs...

I have configured the pins using the configuration tool...

So they should work OK...

My other configured output pins are working...

I am now getting interrupts...

Thankyou... 

Adrian.

0 Kudos