Professional Documents
Culture Documents
Lab 1 PDF
Lab 1 PDF
1. LED Blink
The first program controls an LED connected to the general purpose I/O (GPIO) pin P0.8 of the
microcontroller. The program turns the LED ON and OFF continuously with a delay of 1 second.
Run the LED blink simulation and try to figure out how everything works.
Modify the LED blink program in such a way that LEDs connected to pins P0.8 – P0.13 turn ON
one after the other with 1 second delay.
(P0.8 ON (others OFF) delay 1 sec P0.9 ON (others OFF) delay 1 sec P0.10 ON
(others OFF) delay 1 sec …P0.13 (others OFF) delay 1 sec)
This exercise demonstrates how to read a digital GPIO pin on the microcontroller.
Write a program that toggles the LED connected to pin P0.8 when the button connected to pin
P0.14 is pressed. Use IO0PIN register to read the value of a pin. Your program should go
something like this:
Configure
P0.14 as Input
Read Button
Pin (P0.14)
Button NO
Pressed?
YES
Toggle LED