This is based off of using Code Composer Studio with board TM4C123GXL Tiva C Launchpad.
Will give an upvote!
Procedure 1. From Resource Explorer search for information about our board EK-TM4C123GXL 2. Using the resulting tree (inside the Explorer panel), find the example blinky". (Software>TM4C ARM Cortex-M4F>Examples>blinky) and click on "blinky". 3. Using the icons in the upper right corner, use the "Import to IDE" get a local copy of the project. Then use the "Install" icon to create a project that you can edit. 4. Rename "blinky" to "lab2". (Click on "blinky" and then "File> Rename".) 5. Strip out all the blinky code and update the include directives to have these header files: #include
#include #include "inc/hw_types.h" #include 'inc/hw memmap.h" #include "inc/hw_nvic.h" #include "driverlib/gpio.h" #include "driverlib/sysctl.h" #include "driverlib/systick.h" #include "buttons.h" 6. Copy the buttons.h and buttons.c into your project directory; for example: cp -i --/ti/_/examples/boards/ek-tm4c123pxl/drivers/buttons.(ch). 7. Now you are ready to begin: Review the requirements below and plan out the software needed for this project. No extra hardware circuit is needed for this lab. HINT1: Create two functions: "main" and "mydelayly". HINT2: how will you alternate the two colors? HINT3: Where do you check for debounce in the design? set the clock frequency to 80 MHz enable the port for the red and green LEDs . (wait for it to be ready) . set the GPIO direction B. In the second part of main(). o set up the switchs (using calls to button.c) set SysTick RELOAD value for a 0.2 s delay enable the SysTick peripheral 9. In the last part of mainl). o create a while(1) do-forever loop o turn off all of the LEDs turn on the current LED color o delay for 4 seconds o turn off the current LED color delay for 4 seconds D. In mydelay, you will need to get into the low-level details to poll the SysTick peripheral. using HWREG macro to transfer the reload register value to the count register create a loop to count a 4 second delay based 0.2 second delay created by SysTick use HWREG macro to check the COUNT flag in the SysTick control register Last hint: here's where you want to check button_poll and use the BUTTON_PRESSED macro. Requirements Code is formatted correctly (proper indentation, descriptive names, no "magic" numbers, appropriate comments). explicitly set the clock frequency to 80 MHz add (and use) button.c and button.h to debounce switches SW1 turns LED red, SW2 turns LED green complete on-(45)delay or off-f4s delay cycle before switching colors Procedure 1. From Resource Explorer search for information about our board EK-TM4C123GXL 2. Using the resulting tree (inside the Explorer panel), find the example blinky". (Software>TM4C ARM Cortex-M4F>Examples>blinky) and click on "blinky". 3. Using the icons in the upper right corner, use the "Import to IDE" get a local copy of the project. Then use the "Install" icon to create a project that you can edit. 4. Rename "blinky" to "lab2". (Click on "blinky" and then "File> Rename".) 5. Strip out all the blinky code and update the include directives to have these header files: #include #include #include "inc/hw_types.h" #include 'inc/hw memmap.h" #include "inc/hw_nvic.h" #include "driverlib/gpio.h" #include "driverlib/sysctl.h" #include "driverlib/systick.h" #include "buttons.h" 6. Copy the buttons.h and buttons.c into your project directory; for example: cp -i --/ti/_/examples/boards/ek-tm4c123pxl/drivers/buttons.(ch). 7. Now you are ready to begin: Review the requirements below and plan out the software needed for this project. No extra hardware circuit is needed for this lab. HINT1: Create two functions: "main" and "mydelayly". HINT2: how will you alternate the two colors? HINT3: Where do you check for debounce in the design? set the clock frequency to 80 MHz enable the port for the red and green LEDs . (wait for it to be ready) . set the GPIO direction B. In the second part of main(). o set up the switchs (using calls to button.c) set SysTick RELOAD value for a 0.2 s delay enable the SysTick peripheral 9. In the last part of mainl). o create a while(1) do-forever loop o turn off all of the LEDs turn on the current LED color o delay for 4 seconds o turn off the current LED color delay for 4 seconds D. In mydelay, you will need to get into the low-level details to poll the SysTick peripheral. using HWREG macro to transfer the reload register value to the count register create a loop to count a 4 second delay based 0.2 second delay created by SysTick use HWREG macro to check the COUNT flag in the SysTick control register Last hint: here's where you want to check button_poll and use the BUTTON_PRESSED macro. Requirements Code is formatted correctly (proper indentation, descriptive names, no "magic" numbers, appropriate comments). explicitly set the clock frequency to 80 MHz add (and use) button.c and button.h to debounce switches SW1 turns LED red, SW2 turns LED green complete on-(45)delay or off-f4s delay cycle before switching colors