Professional Documents
Culture Documents
April 2010
The goal of this work is program an 8051 microcontroller and connects it to and LCD
display then controls it by a PC with serial port interface. The work is divided by the
following topics:
Then is presented the commands which are sent to the LCD display.
On the figure bellow is shown the schematic of the circuit that is composed by a 8051
microcontroller, a MAX232 that connects to the serial port, and the LCD display.
Interruptions
The microcontroller is set with 2 interruption, the Serial Port interrupt that make
interface with a PC and Timer 0 interrupt that is used to count time to shift the LCD.
Configuration
The serial port is set with 19200 bit/s of baud rate, choosing SMOD = 1 and TH1= 253
that give:
𝐾 ∗ 𝐹𝑜𝑠𝑐
𝐵𝑎𝑢𝑑 𝑟𝑎𝑡𝑒 =
32 ∗ 12 ∗ 256 − 𝑇𝐻1
2 ∗ 11.0592
𝐵𝑎𝑢𝑑 𝑟𝑎𝑡𝑒 =
32 ∗ 12 ∗ 256 − 253
Clear the screen of the LCD display, and also the Data RAM memory. This
command is made by pressing 0 on the PC keyboard.
Write on line 1 or line 2 by pressing 1 or 2 respectively on the PC keyboard.
Rotate the display continuously from right to left of the first and the second line.
This command is made by pressing enter key.
Turn on and turn off the display without clearing the memory. This command is
mad by pressing 3 on the PC keyboard.
Flow Chart
The figure bellow shows the flow chart that specifies the action sequence of serial
interrupt routine.
Six commands was implemented and tested, Write on line1, write on line 2, shift left, clear the display,
turn on and turn off.
The circuit was tested with virtual simulation on the ISIS software and then on the laboratory using real
components.
Bibliography
Rickey’s World of Microcontrollers and Microprocessors: LCD interfacing with
Microcontrollers
http://www.8051projects.net/lcd-interfacing/introduction.php