TM4C123 GPIO Port Interrupt Tasks

From EdWiki

Revision as of 06:03, 7 February 2020 by Jshankar (Talk | contribs) (2. Multiple Interrupts of the same Portx)

GPIO Interrupt Programming Tasks

1. Sample program (SW1 Interrupt)

  • Create a CCS Project with "Empty Project"
  • Download sw1_int.c program and Add this file to your project.
  • Open tm4c123gh6pm_startup_ccs_gcc.c for editing and replace IntDefaultHandler with the GPIOPortF_Handler in the GPIO Port F vector position.
  • Build and Debug (Run) the program.
    Run this code and load it into the flash of microcontroller. You will see that the blue LED gets turned on when user switch is pressed first then if it is pressed again it gets turned off.

2. GPIOF interrupt from SW1 and SW2

  • Rewrite the above program (sw1_int.c) to distinguish between various pins of PortF. Toggle Red LED on PF1 continuously. Upon pressing either SW1 or SW2, the Green LED of PF3 should toggle for three times.

3. Interrupt from External Source

  • Write a program to toggle an LED at the same rate as the input frequency by connecting a square wave of 3.3V to a pin of Portx. (You can make it to toggle on positive or negative edge or both)