This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CCS/TM4C123GH6PM: Vector Interrupt

Part Number: TM4C123GH6PM

Tool/software: Code Composer Studio

Hi all.
I want to use 2 Switches on TivaC (PF0 and PF4) and I found that in tm4c123gh6pm_startup_ccs.c , there is only one interrupt vector for PORTF.
Besides IntDefaultHandler for PORTF, I found that there are some IntDefaultHandler for Reserved. Can I use that Reserved for my purpose.
Below is the picture captured:

+ Line 1 : GPIO PORT F

+ Line 2: Reserved.

I'm sorry for my "poor" English.

  • Your English is fine (much better than any second language that I attempt to speak) and your question is quite clear.

    No, the GPIO port will only generate one interrupt request regardless of which pin causes the interrupt. In the interrupt routine, the Interrupt Status is read to determine which pin (or pins) generated the request.

  • Hello Ân,

    In addition to Bob's advice, you could use the same interrupt handler for both pins. Then inside of your ISR, you would need to check which pin specifically caused the interrupt.

    This can be done using the GPIOIntStatus API which will read the MIS register. Based on that result, you can then structure and if-then-else statement or a series of case statements to cover each case pin. Note you'll need to use GPIOIntClear to clear the interrupt, and you should used a masked call for that in order to ensure you don't clear an unserviced interrupt.

    I would recommend reading the DriverLib User's Guide for details on the API's so you understand better how to set them up. The document can be found in the /doc folder of your TivaWare install and is titled SW-TM4C-DRL-UG-2.1.4.178.pdf

  • Thank you for talking the trouble to help me. I do appreciate it.
  • Many thanks for your assistance.