Generating an 8 usec timer interrupt on the LPC804

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

Generating an 8 usec timer interrupt on the LPC804

1,005 Views
jrevans
Contributor III

I have some stepper motor control code that I'm porting over from a PIC that uses an 8 usec (micro-seconds) timer (TMR4). To keep the control the same, I need to generate an 8 usec timer interrupt on the LPC804.  My target is an LPC804_TSSOP20 which is Part Number LPC804M101JDH20 but I have an LPCXpresso804 Rev B OM40001 board to do testing with.

I was looking at using a CTimer or an MRT timer to generate this 8 usec interrupt and I found an MRT example here on the forum from @jeremyzhou   

To test, I'm using the identical code from this posting on my LPCXpresso804 Rev B OM40001 board:
https://community.nxp.com/t5/LPC-Microcontrollers/LPC804-maximum-MRT-frequency/m-p/992300/highlight/...

But instead of seeing a frequency of 125.7 kHZ and a period of 7.956 us, I'm seeing a frequency of 44.7 kHz and a period of 22.35 us. Any ideas why?

Scope of the MRT timer firing the LEDScope of the MRT timer firing the LED

What would be the best way for me to generate the 8 usec timer interrupt that I need?

 

0 Kudos
Reply
1 Reply

969 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello @jrevans 

Maybe the bus clock not the same with code you mentioned.

 You can use Config tool inside MCUXpresso IDE to config timer, after config, it will generated code automatically.

Alice_Yang_0-1698116430285.png

 

BR

Alice

 

 

0 Kudos
Reply