#4 How to control the world outside?

Quantum Leaps, LLC
Quantum Leaps, LLC
193.3 هزار بار بازدید - 12 سال پیش - This lesson shows how to
This lesson shows how to blink the three-color LED of the TivaC Launchpad board.

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

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

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

You learn about the "clock gating" feature 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 code 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.


------
Resources:

Companion web page for this video course:
https://www.state-machine.com/quickstart

GitHub repository for projects for this video course:
https://github.com/QuantumLeaps/moder...

YouTube PLAYLIST of the whole course:
Modern Embedded Systems Programming C...

Resources:
"Tiva™ C Series TM4C123G LaunchPad" Board Manual (applies also to the Stellaris Launchpad)
https://www.state-machine.com/course/...

"Tiva™ TM4C123GH6PM Microcontroller" Datasheet (identical to LM4F230H5QR MCU on the Stellaris LaunchPad)
https://www.state-machine.com/course/...
12 سال پیش در تاریخ 1391/11/09 منتشر شده است.
193,351 بـار بازدید شده
... بیشتر