11.2 PROJECT 11.2 – Moving Text on LCD

This project will show how we can move text on the LCD. Here, we will display a text on both rows of a 2 × 16 LCD and then move the text left and right. Initially, text ‘Shift’ will be displayed starting from row 1, column 1 of the LCD. Similarly, text ‘LCD’ will be displayed starting on row 2, column 5. The program will then shift the displayed texts 6 positions to the right, wait for 5 seconds, and then shift them left by 6 positions back to their original places. A 1 second delay will be introduced between each shift operation. The text positions on the LCD are shown below:

img

The delay between each shift operation can be adjusted, as required in the program.

11.2.1 Block Diagram

The block diagram of the project is as in Figure 11.1.

11.2.2 Circuit Diagram

The circuit diagram of the project is as in Figure 11.2.

11.2.3 Project PDL

The PDL of this project is very simple and is given in Figure 11.6.

Figure 11.6 PDL of the project

img

11.2.4 Project Program

The program is named LCD2.C and the program listing of the project is shown in Figure 11.7. At the beginning of the project, the connection between the microcontroller and the LCD are defined using sbit statements. In the main program, PORT B is configured as a digital output port. The LCD library ...

Get Using LEDs, LCDs and GLCDs in Microcontroller Projects now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.