Home
Lab Exercise
Contents
1. User s Guide 1 TEXAS INSTRUMENTS Figure 6 The User s Manual for the Evaluation Kit The user should be able to open the pdf shown in Figure 6 This is an excellent resource and should be read at a later time For now skip to the schematics shown in in Figure 7 and 8 R3 c U MN a LED R gt B R DTC114EET1G VBUS D1 e iy GAJA 330 4 By VV a RGB_LED_0404_COMA LED_G gt S DT 114EET1G ij R4 Cc U KN LED B _ gt S Ne DTC114EET1G Figure 7 Three LED s in One The Tiva board that makes up the evaluation kit has an LED on it Although it is incredibly small it is actually three LED in one as shown in Figure 7 This first tutorial will combine the outputs of these three LEDs to produce a white light lab activity m u PIO PAQUORK VCP TXO 17 Pap ie e PAZ i PR ii 3 PAS nn AG g Ee i PAT S 9 pa USB_VBUS DEBUG PCOTCKISWCLK a 22 pco DEBUG _PC1 TMSISWDIO al oy DEBUG PC2 TDI rs 99 Joes for PC3TDOSWO m4 pra a m nr aa Fer a TA N pu eo ee m F B i ak Peg PE3 z 7 RPE O O O Pe PE Used for vBUS configured as a LMF 120 Ri ay 4 USR SW LED R lt LED B LED G lt USR_SWI Figure 8 Port F of the Chip Figure 8 shows how the three LEDs are connected to the processor They are connected to a port which is one byte 8 bits wide In the code we define red as 0000 0010 blue as 0000 0100 and green as 0000 1000 There are
2. TI ARM Lab 2 National Bright Light Science Foundation Funded in part by a grant from the National Science Foundation DUE 1068182 Acknowledgements Developed by Craig Kief and Brian Zufelt at the Configurable Space Microsystems Innovations amp Applications Center COSMIAC Co Developers are Bassam Matar from Chandler Gilbert and Karl Henry from Drake State Funded by the National Science Foundation NSF Lab Summary This is a lab for connecting the hardware the first time This lab will go through the process of turning on a single light This lab was originally developed for the Stellaris LaunchPad and then modified for the Tiva LaunchPad Lab Goal The goal of this lab is provide sufficient instruction and information so that individuals will be able to connect the Tiva board for the first time and create a simple project that lights an LED It will introduce the user to the building and debugging process within the Code Composer Studio CCS v6 environment Learning Objectives The student should begin to become familiar with the complier and understand the use of a main c file Grading Criteria N A Time Required Approximately one hour Lab Preparation It is highly recommended that the student read through this procedure once before actually using it was a tutorial By understanding the final goal it will be easier to use this as a tutorial This Lab will introduce the Tiva C Series TM4C123G LaunchPad Evaluation Kit
3. EK Project LED LAB 2 3 ATE Launchpad Version 1 0 Date 2 20 2013 Author Brian Zufelt Craig Kief Company COSMIAC UNM Comments This Code is intended to show how to connect compile a write your first project on the Tiva C Launchpad Board BIK gt K RK RK EK EE A EK ER EK EK KE EK EK EK EK A EE AR EK KK KK KK KK Chip type ARM TM4C123GH6PM Program type Firmware Core Clock frequency 80 000000 MHz FEEFEE KEEKEEKEEFEEREEFEEEEEKEEEEEKEEEEEEFEEEEEEEKKEKEEE include lt tm4c123gh6pm h gt include lt stdint h gt definitions define LED_RED 0x02 define LED_BLUE 0x04 define LED_GREEN 0x08 Lab definitions for the 2 versions of the lab define Lab2 define Lab3 void main void long unsigned int i 0 general counter SYSCTL_RCGC2_R SYSCTL_RCGC2_GPIOF GPIO_PORTF_DIR_R LED RED LED BLUE LED GREEN GPIO PORTF DEN R LED REDILED BLUEJ LED GREEN ifdef Lab2 GPIO_PORTF_DATA_R 0 GPIO_PORTF_DATA_R LED REDILED BLUE LED_ GREEN endif loop forever while 1 ifdef Lab3 GPIO PORTF DATA R 0 GPIO PORTF DATA R LED GREEN for i 0 i lt 2500000 i for i 0 i lt 4000000 i GPIO PORTF DATA R 0 GPIO PORTF DATA R LED GREEN LED RED lab activity enable PORT F GPIO set PORT F as output enable digital PORT F clear all PORT F set LED PORT F pins high clear all PORT F set LED PORT F pins high delay delay clear all POR
4. which is a low cost evaluation platform for ARM Cortex MA4F based microcontrollers from Texas Instruments The design of the TM4C123G LaunchPad highlights the TM4C123GH6PM microcontroller with a USB 2 0 device interface and hibernation module The EK TM4C123GXL evaluation kit also features programmable user buttons and a Red Green RGB LED for custom applications The stackable headers of the Tiva C Series TM4C123G LaunchPad BoosterPack XL Interface make it easy and simple to expand the functionality of the TM4C123G LaunchPad when interfacing to other peripherals with Texas Instruments MCU BoosterPacks Equipment and Materials Access to Tiva TM4C123 LaunchPad software and evaluation kit EK TM4C123GXL It is assumed that the student has already completed Lab 1 and the software is installed Software needed The installation files are covered in Lab 1 Hardware needed lab activity The hardware required is the Tiva LaunchPad Kit Th kit and the ORBIT daughter card can be purchased from the Digilent Corporation www digilentinc com Additional References This page is for general information http www ti com tool ek tm4c123gxl on the Tiva LauchPad Kit If the link above is no longer valid just google the Tiva LaunchPad and it will pop up Lab Procedure 1 Install Connect board to computer Step 1 Plug in the supplied USB cable to the top of the Evaluation Kit Ensure the switch on the board is set to DEBUG and no
5. Highlight the main file as shown in Figure 22 and then click Resume which looks like a green triangle The white light should be on 20 21 define LED RED 0x02 22 define LED BLUE 0x04 23 define LED GREEN x 8 4 void main void 5 SYSCTL_RCGC2 R SYSCTL_RCGC2_GPIOF enable PORT F GPIO 6 GPIO PORTF DIR R LED RED LED BLUE LED GREEN set PORT F as output 7GPIO_PORTF_DEN_R LED_RED LED BLUE LED GREEN enable digital PORT F 8 GPIO_PORTF_DATA_R clear all PORT F 9 GPIO PORTF DATA R GPIO_PORTF_DATA_R LED RED LED BLUE LED GREEN set LED PORT F pins high 0 loop forever lwhile 1 1 2 Figure 14 Going RED The final step is to have the light be red instead of white At this point it is best to explain a little more about what is going on with this line of code GPIO PORTF DATA R GPIO PORTF DATA R LED RED LED BLUE LED GREEN Remember that a 1 turns on an LED We have three LEDs we want to turn on First we set the entire port F to 0 all eight bits Then we do our functions as shown below 0000 0000 or 0000 0010 or 0000 0100 or 0000 1000 0000 1110 10 lab activity G So to turn on only Red I comment out remove the other two colors as shown in Figure 23 and rerun To rerun hit the red square change code save debug little bug symbol then green triangle again 11 Attachment 1 main c solution file PEP ENE ERE KRK KSR KORA PE KORS PONE E I E KORA ORE E
6. K KK KKK KKK KKK KKK KKK KKK KKK KKK KKK 12Chip type ARM tm4c123gh6pm 13 Program type Firmware 14 Core Clock frequency 80 000000 MHz 15 KKK KKK KKK OR OK OR ORK OK ORK OK ORK OR KKK ORK OK OK ORK OK OK OK OK OK SSSSSSSSSSSSSSS SSS SS SSS SS 16 definitions amp Included Files 17 include lt tm4c123gh6pm h gt 18 include lt stdint h gt 19 20 define LED RED 0x02 21 define LED BLUE 0x084 22 define LED GREEN 0x08 2 3 void main void 4 SYSCTL RCGC2 R SYSCTL RCGC2 GPIOF enable PORT F GPIO 5 GPIO PORTF DIR R LED RED LED BLUE LED GREEN set PORT F as output 6GPIO PORTF DEN R LED RED LED BLUE LED GREEN enable digital PORT F 7GPIO_PORTF_DATA_R 0 clear all PORT F 8 GPIO_PORTF_DATA_R GPIO PORTF DATA R LED RED LED BLUE LED GREEN set LED PORT F pins high 9 loop forever while 1 1 Figure 5 Replace the project code Copy all the code from the start of this tutorial and replace the skeleton code that was created in Figure 4 The designer should now have the design as shown in in Figure 5 As can be seen in the four lines of the code that does most of the work there is a lot of reference to port F To understand how this works it is important to first look at the user s manual for the evaluation kit The URL for this is currently this doesn t work just google the Tiva LaunchPad Evaluation Board User s Guide lab activity G Tiva C Series TM4C123G LaunchPad Evaluation Board
7. T F set LED PORT F pins high 12 lab activity for i 0 i lt 2000000 i delay GPIO PORTF DATA R 0 clear all PORT F GPIO PORTF DATA R LED GREEN LED RED set LED PORT F pins high for i 0 i lt 3000000 i delay GPIO PORTF DATA R 0 clear all PORT F GPIO PORTF DATA R LED RED set LED PORT F pins high for i 0 i lt 4000000 i delay endif 13 lab activity G Attachment 2 Block Diagram of the Pins Used in Projects 14 lab activity 21 a2 71 3073 T 21 2 Pin Humber 7 6 5 4 3 1 O CORE Hex Binary 000 0000 QO PAT Port A Pin 7 To energize send 0x80 PA ORK IN CIRCUIT SE DEBUGGER PA 1 TX ICD LPA6_ ORBIT SW 2 BA ORBIT SW 1 FE GPIO B HS iid O SDA a TEMP SENSOR PCE Device ID GPIO C ORBIT LED 1 hlf PC 7 ORBIT LED 2 GPIO D PD 6 ORBIT LED 3 ORBIT PD2 ORBIT BTN 1 GPIOE PEO ORBIT BIN 2 PFO Tiva Launch pad BTN 2 PFI Tiva Launchpad LED RED PF2 Tiva Launchpad LED BLUE PFS Tiva Launchpad LED GREEN Pra Tiva Launchpad BTN 1 15
8. ce The project will contain an empty main c source file a Empty Projects i Empty Project fe Empty Project with main c Empty Assembly only Project FE Empty RTSC Project 4 Basic Examples f Hello World Figure 3 CCS New Project Options This tutorial uses Eclipse as the Development environment but uses Code Composer as the software complier To begin go to file new project or click on the new project icon from the getting started screen shown in Figure 2 For this tutorial project select the options as shown in Figure 3 These steps identify the project name It declares it to be an executable project for our specific version of the ARM processor For the purposes of this tutorial the author chose to name the project LED however any name could have been chosen This will create and open for main c file For most every project that is ever done in the C code there will be a main c and this will be the overarching file for the project Note that the author also chose to use a folder in the Temp directory to make the work location lab activity O 6 Getting Started A main c 2 1y 2 main c 3 jint main void 1 5 6 return 0 7 8 Figure 4 main c main c 2 6 Company COSMIAC UNM 7 Comments 8 This Code is intended to show how to connect compile 9 and write your first project on the Tiva Launchpad Board 10 11 KKK OR OK OK OR OK OR OK OR OK KKK KK KKK KK
9. certain requirements for using port F that are taken care of in the first three lines of the code after void main void The first turns on port F For power saving it like all other ports is powered down by default The second sends 1s to the part which sets it as an output The third tells port F that it is digital The next two lines do the following At this point it is best to explain a little more about what is going on with this line of code GPIO PORTF DATA R GPIO PORTF DATA R LED RED LED BLUE LED GREEN Remember that a 1 turns on an LED We have three LEDs we want to turn on First we set the entire port F to 0 all eight bits Then we do our functions as shown below Port F 0000 0000 Port F 0000 0000 Or with 0000 0010 Or with 0000 0100 Or with 0000 1000 Port F 0000 1110 Turns on Red Green and Blue lab activity scripts Run Window Help Li New CCS Project amp New Energia Sketch Examples DJ Build Project Build Configurations Build Working Set Clean Biola A ritara ational Figure 9 Building the Project The next step is to build the project into an executable that will run on the TI chip Click on Project Build All If there are errors then it might be necessary the first time to include projects into your path once This would be if there was a question mark next to an include statement This include is the header file with all the important and critical
10. information about the board If when you attempt to build the project the first time there is an error it is because it can t find this file The next several steps tell it where to look Go to Project Properties as shown in Figure 10 Loge Composer stuaic te Project Run Scripts Window Help CCS Example Projects Build All Ctrl B Build Configurations Build Project Build Working Set d Clean Build Automatically OH show Build Settings Add Files Import Existing CCS Eclipse Project Import Legacy CCSv3 3 Project Properties VA Aadi nna I Ch DCOM ALA Figure 10 Project Properties lab activity type filter text Include Options EE Resource General 4 Build Configuration Debug Active v Manage Configt 4 ARM Compiler Processor Options Optimization Add dir to include search path include_path I D Include Options CG_TOOL_ROOT include MISRA C 2004 Advanced Options E Add directory path gt ARM Linker ARM Hex Utility Disablec Directory Debug Select a folder from file system 4 I TivaWare C Series 1 1 Aa J boot_loader J docs lt gt I driverlib I examples Show advanced settings m J lQmath Description I sensorlib I third party I tools J usblib J utils v Folder NC Make New Folder Cancel Figure 11 Adding the path for the h File As shown in Figure 11 click on the Include Options selection Click on the symbol t
11. o add a directory path scan to the inc directory shown in Figure 11 and click OK This now adds the included directory to the path where the board header file is stored so the compiler can find the needed information about the specific board that is being used OPEN OT pre Scripts Window Help ect ap Debug all Debug History aes Debug Configurations Figure 12 Debugger Next it is time to program the board Click on Run and then Debug as shown in Figure 12 lab activity Debug 2 a LED Code Composer Studio Device Debugging 4 g Stellaris In Circuit Debug Interface CORTEX_M4_0 Suspended HW Breakpoint main at main c 25 0x000004CC _c_int000 at boot asm 217 0x0000042E _c_int00 does not contain frame information Getting Started 4 main c 2 16 definitions amp Included Files 17 include lt tm4c123gh6pm h gt 18 include lt stdbool h gt 19 include lt stdint h gt 20 21 define LED RED 0x02 22 define LED BLUE 0x04 23 define LED GREEN 0x08 Avoid main void 5 SYSCTL_RCGC2_R SYSCTL_RCGC2_GPIOF enable PORT F GPIO 6GPIO_PORTF_DIR_R LED RED LED BLUE LED GREEN set PORT F as output 7 GPIO PORTF DEN R LED RED LED BLUE LED GREEN enable digital PORT F 8 GPIO PORTF DATA R 0 clear all PORT F 9 GPIO PORTF DATA R GPIO PORTF DATA R LED RED LED BLUE LED GREEN set LED POR A lann fnrever Figure 13 Stopping at Main
12. t DEVICE a a PPP a ea a EPP PP PE a a Project LED LAB 1 ATE Version 1 0 Date 2 20 2013 Author Brian Zufelt Craig Kief Company COSMIAC UNM Comments This Code is intended to show how to connect compile a write your first project on the Tiva Launchpad Board SK gt K EK KE KK AK EK OK AK gt K KR AE gt K A AK AE A A gt AE AK KE AK AK OK AK AK gt AK AK AK gt A gt K AR AK AE AK KK EK AK KK OK KK KK Chip type ARM TM4C123GH6PM Program type Firmware Core Clock frequency 80 000000 MHz a a a ae definitions amp Included Files include lt tm4c123gh6pm h gt include lt stdint h gt define LED_RED 0x02 define LED_BLUE 0x04 define LED_GREEN 0x08 void main void 1 SYSCTL_RCGC2_R SYSCTL_RCGC2_GPIOF enable PORT F GPIO GPIO_ PORTF_ DIR_ R LED _RED LED_ BLUE LED_ GREEN set PORT F as output GPIO_ PORTF_ DEN_ R LED REDILED BLUE JLED GREEN enable digital PORT F GPIO_ PORTF_ DATA_ R 0 clear all PORT F GPIO PORTF DATA R GPIO_PORTF_DATA_R LED RED LED BLUE LED GREEN set LED PORT F pins high loop forever while 1 The source code that will be used in this project is shown above The code is commented For now it is important to just read through the code and begin to get a feeling for what it does The purpose of each line of code will be explained later Understand that the TT part is designed to be very low power As such the lab ac
13. tivity user must turn on and activate those parts that will be used In this case activation of a single port port F and then turning the port into an output port Launch Code Composer Studio v6 by double clicking on the icon shown in figure 1 below code Composer Figure 1 Code Composer For those new to CCS 6 the screen shown in Figure 2 is where you begin This is an excellent resource and some time should be devoted watching the videos and finding out what is available there The screen only appears automatically the first time CCS is launched After that to get back to the screen shown in Figure 2 it is necessary to click on Help gt Getting Started New g Browse r Import gt App M Project Examples Project Center Would you like to use CCS in Simple mode Yes No Recommended for Energia and LaunchPad users iZ PLAYLIST 1710 Getting Started with Code Composer Studio v6 RER 2 i E an APPRI Videos Training tS il Wiki mma Forum S Zw Figure 2 Start Screen lab activity CCS Project Create a new CCS Project Target Tiva C Series Vv I Tiva TM4C123GH6PM Connection Stellaris In Circuit Debug Interface Vv ii Cortex M ARM Project name LED Use default location Location CATEMP TI uC Browse Compiler version TI v5 1 5 More Advanced settings Project templates and examples type filter text Creates an empty project fully initialized for the selected devi
Download Pdf Manuals
Related Search
Related Contents
MANUALE D`ISTRUZIONI TAGLIASIEPI HCR-1500 X100M Modern - LordRiffenstein Embedded SDK (Software Development Kit) MAN02 MAN15 MAN30 Manometer PTS RESERVATION User Guide 2011 Copyright © All rights reserved.
Failed to retrieve file