LAB 2-2
COMMUNICATE WITH 7-SEGMENT LED AND LED
MATRIX
OBJECTIVE:
• Communicate with a 7-segment LED display.
• Communicate with a matrix LED display.
REFERENCES:
• Lab manual chapter 4
• Atmel-2505-Setup-and-Use-of-AVR-Timers_ApplicationNote_AVR130.pdf
EXPERIMENT 1:
a) Connect one AVR port to header J34. Connect two other port pins to signals nLE0 and
nLE1 on header J82. Set jumpers to power the 7-segment LED display.
b) Use sample programs from the experiment guide to write a program that displays the
numbers 0, 1, 2, and 3 on the 4 7-segment LED displays. Use Timer 0 to scan the LEDs at
a scanning frequency of 50 Hz.
EXPERIMENT 2:
a) Connect an AVR port to a dip switch, assuming it's PORTA.
b) Write a program to display the value of PORTA * 9 on the 4 7-segment LED displays.
c) Change the dip switch value and observe the results.
EXPERIMENT 3:
a) Connect the necessary signals to control the matrix LED display.
b) Use the provided sample program, modify it if necessary, to display the letter 'A' on the
matrix LED display. Scan the matrix LED display using a timer to create a delay with a
scanning frequency of 25 Hz.
c) Modify the program to achieve a scanning frequency of 125 Hz.
https://doe.dee.hcmut.edu.vn/
LAB REPORT
Group:
Class group: Subject:
EXPERIMENT 1:
1. Answer the following questions:
a. To have a scanning frequency of 50 Hz, how long does one LED stay
lit?
b. How do you configure the timer to achieve this delay?
2. Provide the source code with comments.
........................................................................................................................
EXPERIMENT 2:
1. Answer the following questions:
a. How many bits is the value of PORTA * 9?
b. How can you display each digit on the 4 7-segment LEDs?
2. Provide the source code with comments.
........................................................................................................................
EXPERIMENT 3:
1. Answer the following questions:
a. How many bits is the value of PORTA * 9?
b. How can you display each digit on the 4 7-segment LEDs?
2. Provide the source code with comments.
........................................................................................................................
https://doe.dee.hcmut.edu.vn/