x
Menu

Embedded Systems Programming

Other,

Updated On 02 Feb, 19

Overview

Getting Started - Counting - Flow of Control - Variables and Pointers - Blinking the LED - Preprocessor and volatile - Bit-wise operators in C - Arrays and Pointer Arithmetic - Functions and the Stack - Modules, Recursion, AAPCS - Stack Overflow and Other Pitfalls of Functions - stdint.h and mixing types - structures and CMSIS - startup code part - interrupts

Includes

Lecture 5: Blinking the LED

4.1 ( 11 )


Lecture Details

This lesson shows how to blink the three-color LED of the Stellaris Launchpad board.

The lesson starts with explaining how the LED is connected to the microcontroller based on the User Manual for the board.

Next, the you learn about the memory map of your microcontroller and you get the first look at the Microcontrollers Data Sheet.

Next, you experiment in the debugger trying to access the registers of the GPIO (General-Purpose InputOutput) block to control the LED.

You learn about the "clock gating" featrue of the modern microcontrollers and you find out in the Data Sheet how to turn the GPIO module on by setting the appropriate bit in the system clock-gating register.

Still in the debugger, you configure the GPIO bits for digital output and finally you can turn all three colors on and off.

After the experiments in the debugger, you proceed to coding the same actions in C. This turns out to be simple, because of your knowledge of pointers from lesson-3.

You run the code, and discover a need for a delay loop. Again you use the counting loop from lesson-2 to code this part.

Finally, you have the working program that blinks an LED at a rate of about once per second.

In the next lesson you will learn how to improve the program by using the C preprocessor and the volatile keyword.

Miro Samek
state-machine.com

---
YouTube PLAYLIST of the whole course
httpwww.youtube.complaylist?list=PLPW8O6W-1chwyTzI3BHwBLbGQoPFxPAPM

Resources
"Stellaris Launchpad Board User Manual"
httpwww.ti.comlitdssymlinklm4f120h5qr.pdf

"Stellaris LM4F120H5QR Microcontroller DATA SHEET"
httpwww.ti.comlitdsspms294espms294e.pdf

Course web-page
httpwww.state-machine.comquickstart

Ratings

5.0


1 Ratings
55%
30%
10%
3%
2%
Comments
comment person image

Sam

Excellent course helped me understand topic that i couldn't while attendinfg my college.

Reply
comment person image

Dembe

Great course. Thank you very much.

Reply
Send