Create a Tiva project

This tutorials are simply as guidance on how to create a project for the Tiva in Energia and CCS. It's for guidance for some of my friends that had some difficulty in that and to have a place stored and of easy access for them all.

This is how i usually do it but for better, more detailed explanation, check Getting Started with the TIVA C Series TM4C123G LaunchPad Workshop

How to create in CCS with TI compiler:

This video shows how to create a project in CCS using TI compiler and how to include TivaWare API

Create a new project with all the settings fast!

Here is the code that i used for this video, it sets up the SystemTick to interrupt every 1mS, adds a delay function called "Wait" and configures the clock to 80Mhz. For the projects configurations i just used the ones from the previous video

#define PART_TM4C123GH6PM#include <stdint.h>#include <stdbool.h>#include "stdlib.h"#include "inc/hw_ints.h"#include "inc/hw_memmap.h"#include "inc/hw_uart.h"#include "inc/hw_gpio.h"#include "inc/hw_pwm.h"#include "inc/hw_types.h"#include "driverlib/timer.h"#include "driverlib/gpio.h"#include "driverlib/interrupt.h"#include "driverlib/pin_map.h"#include "driverlib/rom.h"#include "driverlib/rom_map.h"#include "driverlib/sysctl.h"#include "driverlib/uart.h"#include "driverlib/udma.h"#include "driverlib/pwm.h"#include "driverlib/ssi.h"#include "driverlib/systick.h"#include <string.h>volatile uint32_t millis=0;void SycTickInt(){ millis++;}void SysTickbegin(){ SysTickPeriodSet(80000); SysTickIntRegister(SycTickInt); SysTickIntEnable();

SysTickEnable();

}void Wait(uint32_t time){ uint32_t temp = millis; while( (millis-temp) < time){ } }int main(){ SysCtlClockSet(SYSCTL_SYSDIV_2_5|SYSCTL_USE_PLL|SYSCTL_OSC_MAIN|SYSCTL_XTAL_16MHZ); SycTickInt(); }

How to create in Energia:

In Energia it's very simple, you don't need to define any paths, only to include the files and the define the part used. Just had this in the top of the code and it should cover most of the peripherals, the most important that is easily forgotten is the PART. You can use this for CCS but remember to only use the .h files

#define PART_TM4C123GH6PM

#include <stdint.h>

#include <stdbool.h>

#include "stdlib.h"

#include "inc/hw_ints.h"

#include "inc/hw_memmap.h"

#include "inc/hw_uart.h"

#include "inc/hw_gpio.h"

#include "inc/hw_timer.h"

#include "inc/hw_types.h"

#include "driverlib/systick.c"

#include "driverlib/interrupt.c"

#include "driverlib/sysctl.c"

#include "driverlib/timer.c"

#include "driverlib/udma.c"

#include "driverlib/gpio.c"

#include "driverlib/systick.h"

#include "driverlib/interrupt.h"

#include "driverlib/pin_map.h"

#include "driverlib/rom.h"

#include "driverlib/rom_map.h"

#include "driverlib/sysctl.h"

#include "driverlib/uart.h"

#include "driverlib/udma.h"

#include "driverlib/gpio.h"

#include "driverlib/timer.h"

#include <string.h>

For the CCS i simply import a Energia sketch or just create one, there's the option for that. The reason for that i to avoid problems with the include paths which i always have allot of problems. This for GNU of course.