Interrupts

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

Interrupts

540 Views
Luke_John
Contributor I

Hello,
I am have recently obtained a new S32K118 EVB and started to work with it. I face some confusion with interrupts. Based on my understanding, interrupts source and its handlers are configured using Platform library. However, where can I can programm the activities done by the handlers. For example, if an ADC interrupt is triggered, the program counter will be redirected to a handler and that handler will trigger a sequence of functions.  I want to add extra logic in that handler. Is it possible to do so and if so how?

0 Kudos
Reply
1 Reply

526 Views
Julián_AragónM
NXP TechSupport
NXP TechSupport

Hi @Luke_John,

You can configure event-specific callbacks depending on the module you are using. For example, ADC block can configure various notifications (end of normal chain, end of injected, end of ctu, end of channel, watchdog out of range...):

Snag_188ccfcd.png

Depending on configuration, ADC IRQ Handler will invoke the respective callback, which you can modify in your main.c code:

Snag_188eca36.png

Best regards,
Julián

0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-2337624%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EInterrupts%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2337624%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHello%2C%3CBR%20%2F%3EI%20am%20have%20recently%20obtained%20a%20new%20S32K118%20EVB%20and%20started%20to%20work%20with%20it.%20I%20face%20some%20confusion%20with%20interrupts.%20Based%20on%20my%20understanding%2C%20interrupts%20source%20and%20its%20handlers%20are%20configured%20using%20Platform%20library.%20However%2C%20where%20can%20I%20can%20programm%20the%20activities%20done%20by%20the%20handlers.%20For%20example%2C%20if%20an%20ADC%20interrupt%20is%20triggered%2C%20the%20program%20counter%20will%20be%20redirected%20to%20a%20handler%20and%20that%20handler%20will%20trigger%20a%20sequence%20of%20functions.%26nbsp%3B%20I%20want%20to%20add%20extra%20logic%20in%20that%20handler.%20Is%20it%20possible%20to%20do%20so%20and%20if%20so%20how%3F%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2337776%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20Interrupts%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2337776%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F260942%22%20target%3D%22_blank%22%3E%40Luke_John%3C%2FA%3E%2C%3C%2FP%3E%0A%3CP%3EYou%20can%20configure%20event-specific%20callbacks%20depending%20on%20the%20module%20you%20are%20using.%20For%20example%2C%20ADC%20block%20can%20configure%20various%20notifications%20(end%20of%20normal%20chain%2C%26nbsp%3Bend%20of%20injected%2C%26nbsp%3Bend%20of%20ctu%2C%26nbsp%3Bend%20of%20channel%2C%20watchdog%20out%20of%20range...)%3A%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Snag_188ccfcd.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Snag_188ccfcd.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F380096i0661CB9AE0DE61EE%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Snag_188ccfcd.png%22%20alt%3D%22Snag_188ccfcd.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EDepending%20on%20configuration%2C%20ADC%20IRQ%20Handler%20will%20invoke%20the%20respective%20callback%2C%20which%20you%20can%20modify%20in%20your%20main.c%20code%3A%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Snag_188eca36.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Snag_188eca36.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F380097i931F007C81D612F2%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Snag_188eca36.png%22%20alt%3D%22Snag_188eca36.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EBest%20regards%2C%3CBR%20%2F%3EJuli%C3%A1n%3C%2FP%3E%3C%2FLINGO-BODY%3E