This is an old revision of the document!
Exercises
The goal is to write a program which is able to perform tasks described below.
Warm up exercise
For beginner
Present numbers in hexadecimal system randomly on the 7-segment display. The frequency is 1 Hz.
Light into circling 6 outside segments on the 7-segment indicator with the period of 500 ms.
On the alphanumerical LCD write the following text: “õun öö äpu ülo”
Show special symbols on the alphanumerical LCD. Display the following text in two rows: “My program ©”, “Home Lab™”
Display 10 rows of text on the graphic display which can be scrolled up and down using the buttons S1 and S2.
Make user interface with three buttons for inserting text. For example, one button chooses the sign, second verifies the sign and the third verifies the text finally. The maximal length of the text is 10 signs and the text must be turned backwards and displayed on the second row. You may use just Latin alphabet. Choose the LCD.
For advanced
Display Greek letters on the graphic LCD. Display the following rows: “Resistance Ω”, “∑R=∑πR²”, “π=3.141592”.
Write a converter for converting decimal numbers to binary code. Use buttons S3-S1 for inserting decimal numbers (S3- hundredths, S2 – tenths, S1 – ones) in 10 seconds. For example, 4 presses of the button S3 mean the number 400. Present the sign for starting the insertion and the result in binary code on a random LCD.
Write a function which displays a rectangle on the graphic LCD if the width, length and the coordinates of the top left corner are given. The width of the line is 1 pixel. Check if the rectangle fits inside the screen. It is advised to investigate the library of the Home Lab.
Write a simple worm game on the graphic LCD. The width of the worm is 1 pixel and the length is 5 pixels. The worm can be made turning left and right wit the buttons. The worm must avoid collision with the border of the screen (turn before). Bonus points are for ability of picking up the eggs and growing worm. The simplest solution is to make the worm of the “O” letters.
5. Write a program for displaying different weather phenomenons on the graphic LCD. Sunny weather - icon of the Sun, rainy weather – a cloud with rain, cloudy weather – just a cloud, snow – snowflake. The size of the icons may vary, main thing is that the icons are clearly distinguished. There must be possibility to change the icons by pressing a button.
Questions
How many pins uses the 7-segment number-indicator (with point segment), if it is connected directly to the controller? How many pins would be needed if if were controlled through the driver (driver - A6275)?
What determines the brightness of the 7-segment number-indicator? How can it be adjusted if the number-indicator is controlled a)directly b)through the driver (driver - A6275)?
If the 7-segment number indicator is connected directly to the controller's port A, so that the segment A is PA0, B is PA1 … and DP is PA7, then which are the values of the PORTA register when the numbers are 0…9?
Form what aspect are 4-bit and 8-bit controlling of the LCD different?
Through which pins and how is the background light of the alphanumerical LCD regulated?
What I/O protocol uses graphic LCD? Explain the meaning of the I/O pins?
How can the numbers in decimal system be converted to binary system (to text) and vice versa?
Draw the consisting layers of LCD which is built using twisted nematic technology.
How are the letters formed on a graphical LCD?
Mille poolest erineb monokromaatiline (must-valge) ja värviline LCD ekraan?