Timer Interrupt

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

Timer Interrupt

1,012 Views
JLABB
Contributor I

Hello,

I am using the LPC55S06 board and the MCUXpresso Config Tool Version 9  and I am trying to use CTIMER1 to generate an interrupt after a period of 799 us and call a function that I wrote. I am using the NVIC to make the interrupt through CTIMER1 and then use the IRQHandler that is generated from the peripherals.h file as a void function to call the function I wrote. I am trying this method but the function that I am trying to call gets a warning that it is being unused.

 

Labels (1)
Tags (1)
0 Kudos
5 Replies

996 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello JLABB,

Usually, warning can ignore. Does the interrupt function work well when run your project?

If no, you can share your project, I will help to check.

 

BR

Alice

0 Kudos

990 Views
JLABB
Contributor I

Morning Alice, I ran the project in debug mode and it looks like the interrupt register is changing but the function I have in the handler's body is not being used. I will send the project in a zip file which will have the config from MCUXpresso and I am running the project from Keil.

0 Kudos

956 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello JLABB,

 I have help you change your  project, now it can run into Citmer0 interrupt , please see my attachment.

It seems you haven't enable interrupt.

 

BR

Alice

0 Kudos

984 Views
frank_m
Senior Contributor III

Your interrupt handler needs to have the same name as defined in your toolchain, usually the startup file. Which is often assembler code.

In the generated map file, you should see your handler/address present in the respective vector table entry.

Toolchains often provide default handler for interrupt or fault handlers, which are declared as "__WEAK" and can be overwritten.

The handling of such linking issues is not identical across toolchains, so you might need to consult the Keil tutorials.

0 Kudos

976 Views
JLABB
Contributor I

Hello Frank,

I changed the name of my interrupt handler to CTIMER1_IRQHandler to match the one in the startup file and in my map file I can see CTIMER1_IRQHandler in the vector table so that is good but it did not fix my linking issue. I contacted Keil about my project.

0 Kudos