Tiva Lab 01: Your First C/C++ Project for TI Tiva LaunchPad
- Learn how to create a new C project using Keil lDE for TI Tiva LaunchPad Boards
- Learn how to use #define statements to simplify or clarify the code
Required Reading Material
Create a folder, named "EE3450", in your windows desktop. Then create following sub-folders inside the "EE3450" folder:
You have to install the Keil μVisio and the drivers for TI Tiva LaunchPad board first, and then follow the next article to learn how to create a C project with Keil μVisio.
Lesson 07: Create an ARM C/C++ Application with Keil μVision MDK-ARM
In this lesson you will learn how to create a C/C++ language project with the basics of the Keil μVision MDK-ARM development system.
1. Create a C/C++ Project
Start up Keil μVision 5
- Launch Keil µVision5 by clicking on the icon from the desktop or find this program from the "Start" menu, "All Programs" on your computer. You will see the following screen.
Create a new Project for the Tiva LaunchPad Board
Next, you will use Keil μVision to create C/C++ project and execute this program on your target Tiva board.
Before you create a new project, it is recommended that you create a folder to store all your projects and files. For example: you can have a folder "EE3450" ready before hand.
Let's create your first ARM μVision project now.
- In the main μVision menu, select "Project ➤ New µVision Project". The Create New Project window opens up.
- Select the project folder that you have prepared, assign this project the following name: "MyFirstC", then click on "Save" button.
- "Select Device for Target 'Target1'... " window opens and you have to select which processor family will be used
- Texas Instruments ➤ Tiva C Series ➤ TM4C123x Series" and from the new list select TM4C123GH6PM. Click OK board: from the list of devices select "
- Texas Instruments➤Tiva C Series➤TM4C129x Series", and from the new list select TM4C1294NCPDT. Click OK board: from the list of devices select "
- Click OK and the Manage Run-Time Environment window opens and shows the related software components for the device.
There are two components that must be selected in your C project for the Tiva LaunchPad board. In the Manage Run-Time Environment window, select the following components for your project:
- Click "OK" to close this window.
- Two files are added to your project:
This file has reset handler and exception vectors (include stack and heap configuration)
This is configuration file for basic device setup (clock and memory bus)
Add the definition file into your project.
- Using Notepad++ or other text editor to add the following definitions into the file, then save the file to Common folder that you created, named the file to "MyDefines.h"
- Go back to the Keil main window. Right click on "Source Group 1" and select "Add New Item to Group 'Source Group 1'..."
- Right click on "Source Group 1" and select "Add Existing Files to Group 'Source Group 1'..."
- In the window that open, change the location to the Common folder, then change the file type to Header File (.h). Select the MyDefines.h file, or enter Name "MyDefines", click Add. and then click Close to close the window.
- Now you have already added a header file into your project.
- Add the Common folder into the "Include Paths". Open the Option for Target window, change the tab to C/C++, then add the Common folder into the Include Paths.
Click OK to close the Option window.