1541.launchpad Basics
1541.launchpad Basics
Requisites: CCSV5.5 installed in C:\TI; ControlSUITE installed in C:\TI; C2000 PICCOLO Launchpad hardware (LAUNCHXL-F28027).
Objective: To create first project with CCS and debug. This lab will use CPU Timers and
blink an LED connected to GPIO.
Start CCS IDE. When you open CCS, you will get the “Workspace Launcher” window. Type in C:\C2000Workspace
Close the resource explorer window and Click on File>New>New CCS Project to create a
new project.
Enter the project name and select the microcontroller and Connections settings as
shown below:
After creating the project, click on Window>Preferences to edit the project preferences. Type
“Linked” in the search bar and select Linked resources.
Click on “New” to add a new path variable and Name it “controlSUITE”. Give the path location
as C:\ti\controlSUITE
Note: In case if your controlSUITE installation path is different, enter the location of your
controlSUITE install folder in the location field. Click OK when done.
Go to window>Preferences again, and type “Variables” in the search field. Select “Build
Variables” and click “Add” to add controlSUITE as a build variable as shown below:
Enter the variable name and path as shown below. Be sure to select the Type as “Directory”.
Note: In case if your controlSUITE installation path is different, enter the location of your
controlSUITE install folder in the “Value” field. Click OK when done.
Open Windows Explorer and navigate to
C:\ti\controlSUITE\device_support\f2802x\v129\DSP2802x_common\source
Select the following files and drag and drop them into the CCS project.
DSP2802x_CodeStartBranch.asm
DSP2802x _CpuTimers.c
DSP2802x _DefaultIsr.c
DSP2802x_Gpio.c
DSP2802x _PieCtrl.c
F2806x_PieVect.c
DSP2802x _SysCtrl.c
DSP2802x _usDelay.asm
When prompted, select “Link to files” as follows, and select “controlSUITE” in the drop down
menu:
Similarly,
Go to C:\ti\controlSUITE\device_support\f2802x\v129\DSP2802x_headers\source
Add the file DSP2802x_GlobalVariableDefs.c
Go to C:\ti\controlSUITE\device_support\f2802x\v129\DSP2802x_headers\cmd
Add the file DSP2802x_Headers_nonBIOS.cmd
Note: ${controlSUITE} uses the build variable “controlSUITE” to search for the file path. We had defined “controlSUITE”
as C:\ti\controlSUITE
We are done with creating a project!. Now let’s Build and Debug the program.
Build the project by clicking on the “Build” Icon (Hammer symbol)
Open file “Example_2802xCpuTimer.c” and go through the code.
Click on the “Debug” button which is next to the Build button, to enter the debug session.
Scroll to line 178 of the file “Example_2802xCpuTimer.c” and copy the variable
“CpuTimer0.InterruptCount” and Paste it in the “Expressions” window. You can also, select
the variable “CpuTimer0.InterruptCount”, right click on it and select “Add Watch Expression…”
Enable “Silicon Realtime Debug mode enable” and then click on the green “Resume”(F8)
button to start program execution. While enabling realtime debug, you would get a
confirmation Window and you select “Yes”.
Now the program will be executing and you can see the CpuTimer0.InterruptCount getting
incremented every second. To terminate, press on the Red Stop button.
Part 2:
Scroll to line 179 and add the following code to toggle an LED
(GpioDataRegs.GPATOGGLE.bit.GPIO0 = 1;).
Build the program, click on debug and then run. Is the LED toggling?...
The LED will NOT toggle. Note that, the GPIO control registers are EALLOW protected. Exit the
debug session and add the EALLOW and EDIS statements in the GPIO initialization code as
follows:
Now rebuild the code and execute. You will see the LED at GPIO0 toggling.
Exercise: Try toggling the LEDs connected at GPIO1, GPIO2 and GPIO3 also.