Professional Documents
Culture Documents
Experiment 1
To Blink an LED with TIVA GPIO
INTRODUCTION:
To blink the GREEN on-board LED (PF3) using C Language.
Objective:-
The main objective of this experiment is to blink the Green on-board using GPIO. This
experiment will help you to learn and understand the procedure for basic programming the
TM4C123GH6PM LaunchPad digital I/O pins.
Component Requirements:-
Software Requirement -
1. Code Composer Studio,
Hardware Requirement -
1. TM4C123GH6PM Launch-Pad
2. USB cable
Hardware Connection:
Embedded System Lab Manual
Flowchart:-
int main(void)
{
SysCtlClockSet(SYSCTL_SYSDIV_5|SYSCTL_USE_PLL|SYSCTL_XTAL_16MHZ|SYSCTL_
OSC_MAIN);
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOF);
GPIOPinTypeGPIOOutput(GPIO_PORTF_BASE,
GPIO_PIN_1|GPIO_PIN_2|GPIO_PIN_3);
GPIOPinWrite(GPIO_PORTF_BASE,GPIO_PIN_1|GPIO_PIN_2|GPIO_PIN_3, 0x08);
SysCtlDelay(20000000);
while(1) {
}
}
Result:-
In this experiment, we have learnt to configure and program the digital I/O pins of
TM4C123GH6PM and have successfully programmed to blink the on-board green LED of
TM4C123GH6PM LaunchPad.