LAB REPORT
DEPARTMENT OF COMPUTERS AND
COMMUNICATION ENGINEERING
ROLL NUMBER: [Link].U4CCE23028
NAME: Parinitha M
BATCH: 1
SUBJECT CODE: 23CCE384
SUBMITTED TO: Dr. C. Ganesh Kumar
Procedure for Initializing a New Project in Keil Software
Step 1: Download Keil MDK-ARM
● Go to: [Link]
● Download and install the Keil MDK-ARM development environment.
● After that, install the Stellaris ICDI Add-On (available via Google
Drive link)
Step 2: Opening Keil IDE:
● Launch Keil µVision IDE.
Step 3: Install Device Support Pack:
● Open the Pack Installer by clicking its icon.
● Search for TM4C123 in the search bar.
● Select the TM4C123x Series from the list and install the device
support pack.
● Ensure the pack is completely updated.
Step 4: Install Device Support for TM4C123
● Click on the “Pack Installer” icon from the toolbar.
● In the search bar, type TM4C123.
● Select the TM4C123x Series and click Install to ensure the pack is
installed and updated.
Step 5: Start a New Project
● Navigate to Project → New uVision Project.
● Make a separate folder to store your project files.
● Give your project a name and click Save.
Step 6: Select the Target Microcontroller
● In the device selection window:
a. Go to the Software Packs tab.
b. Search for TM4C123GH6PM.
c. Select it and click OK.
Step 7: Configure the Run-Time Environment
● In the Manage Run-Time Environment window:
○ Enable CMSIS → CORE.
○ Enable Device → Startup.
○ Click OK to continue.
Step 8: Add a New Source File
● In the Project Workspace (left side):
○ Right-click on Source Group 1 and select Add New Item to
Group "Source Group 1".
○ Choose C File (.c).
○ Enter a file name (without the .c extension) and click Add.\
Step 9: Configure Debugger Settings
● Go to Project → Options for Target → Debug tab.
● From the dropdown on the right, choose Stellaris ICDI as the
debugger.
Step 10: Compile and Upload the Program
● Save all your files and code.
● Click Build (or press F7) to compile.
● Connect the Tiva C LaunchPad to your PC using a USB cable.
● Go to Flash → Download, or click the Load button to transfer the
code to the board.
EXP1: LED Blinking Program
AIM:
To write an Embedded C program that toggles the green LED (connected to
pin PF2) on the Tiva C TM4C123G LaunchPad using GPIO Port F.
Tools Used:
● Keil uVision IDE
Procedure:
● Launch Keil uVision IDE and start a new project.
● Select the microcontroller TM4C123GH6PM from the device list.
● When prompted, include the startup code.
● Create a new .c file and write the LED blinking logic in it.
● Save the file with the name main.c and add it to Source Group 1.
● Compile the project and make sure there are no errors.
● Connect the Tiva C board to your computer via USB.
● Flash the code to the microcontroller and run it.
● The green LED on PF2 should blink continuously
CODE:
#include "TM4C123.h"
void delay()
for (int i = 0; i < 100000; i++);}
int main()
SYSCTL->RCGCGPIO = 0x20; // Turn on clock for Port F
GPIOF->DEN = 0x0E; // Enable digital function for PF1, PF2, PF3
GPIOF->DIR = 0x0E; // Set PF1, PF2, PF3 as outputs
while (1)
GPIOF->DATA |= (1 << 2); // Turn on PF2 (Green LED)
delay();
GPIOF->DATA &= ~(1 << 2); // Turn off PF2
delay();
OUTPUT:
Inference
I was able to write and run the LED blinking program successfully. The green
LED on PF2 started blinking as expected, which showed that my GPIO
configuration and delay logic were working properly. This helped me
understand how to control output pins and use simple timing functions in
embedded C using the Tiva C board.