Description:
------------
A C program for 8052 microcontroller to display Hello World message on a LCD.
LCD is a 2x16 character type.
Hello must be on the first line.
World on the second line.
Clear the screen after 10 seconds and repeat.
The microcontroller used is Nuvoton W78E052DDG.
It works at 11.0592 frequency.
1602A 2x16 LCD
The datasheets of microcontroller and LCD are included in the zip file.
Challenges:
-----------
During LCD initialization, I want to do the following:
1. Clear the display
2. Turn on the display
3. Turn on the cursor
4. Blink the cursor
5. Cursor position must be on the first line at the first character
6. Set the LCD in 8-bit mode.
I ran the code on Proteus.
The backlight turned on but nothing happened on the screen.
It's blank.
There is no cursor.
I have gone through the LCD datasheet but I'm having hard time converting the instructions into code.
Am I doing the initialization correct?
I want to observe and control the behavior the LCD using the instructions.
I believe that's essential.
The second challenge I'm facing is when writing commands and data.
Especially at lcdDataPort. The command/data is loaded into lcdDataPort.
I want to pass the data/command to LCD.
I enable EN, call delay function, and disable EN.
I don't know exactly what's happening here.
What do I want?
---------------
1. I would be grateful if you help me figure out the challenges.
2. Am I following best practices?
3. How should I structure a project for a embedded system?
Constructive criticism is welcomed.
------------
A C program for 8052 microcontroller to display Hello World message on a LCD.
LCD is a 2x16 character type.
Hello must be on the first line.
World on the second line.
Clear the screen after 10 seconds and repeat.
The microcontroller used is Nuvoton W78E052DDG.
It works at 11.0592 frequency.
1602A 2x16 LCD
The datasheets of microcontroller and LCD are included in the zip file.
Challenges:
-----------
During LCD initialization, I want to do the following:
1. Clear the display
2. Turn on the display
3. Turn on the cursor
4. Blink the cursor
5. Cursor position must be on the first line at the first character
6. Set the LCD in 8-bit mode.
I ran the code on Proteus.
The backlight turned on but nothing happened on the screen.
It's blank.
There is no cursor.
I have gone through the LCD datasheet but I'm having hard time converting the instructions into code.
Am I doing the initialization correct?
I want to observe and control the behavior the LCD using the instructions.
I believe that's essential.
The second challenge I'm facing is when writing commands and data.
Especially at lcdDataPort. The command/data is loaded into lcdDataPort.
I want to pass the data/command to LCD.
I enable EN, call delay function, and disable EN.
I don't know exactly what's happening here.
What do I want?
---------------
1. I would be grateful if you help me figure out the challenges.
2. Am I following best practices?
3. How should I structure a project for a embedded system?
Constructive criticism is welcomed.
Attachments
-
1.7 MB Views: 3