AnsweredAssumed Answered

Problem with external interrupt

Question asked by Patrik Schantl on Jul 27, 2014
Latest reply on Aug 14, 2014 by Erwan Y
Hello,

This question is propably really basic, but I hope to get any advice, a link to a tutorial or even a sample code which helps me to solve my problem.
I am really new in this buisness. The possibilities of the SPC56 controller familiy are huge but as a beginner their complexity confuses me. My setting is a SPC56xL Discovery Kit and the SPC5 Studio in combination with the High Tec C compiler. What I want to do is normally very simple. One of the LEDs (e.g. LED D5 on Pin A0) should be controlled by the button S2 on Pin G8. Therefore, my idea was to use an interrupt triggered by the button S2. I set up a small project, using the OSAL-HAL component.
But I really have no idea how and where i should implement this functionality in my C code. All what I have done so far is configuring an interrupt vector, but I am even not sure if i did this in the correct way. The main questions for me are:

-) What is the correct way to configure an interrupt vector?
-) How is the connection between the interrupt vector and the corresponding interrupt source made?
-) And finally, where and how to define the interrupt function to toggle my LED?

I would be really grateful for any help.

Best regards,
Patrik

Outcomes