L11: LCD displays. Multiple-file projects [P11] Interfacing an LCD |
[10/12] |
3.6. Peripherals: LCD
3.6.1. LCD technology and controllers
The LCD peripheral: controller chip, hardware interface.
3.6.2. LCD C libraries
In some way, let us repeat the idea of plan C2 in software: multiple component files (C functions) in the same top project.
3.6.3. Examples
3.6.3.1. 1-digit BCD adder with LCD: Adder_BCD_1digit_LCD
Enhance the 1-digit BCD adder project in P9 so that operation result is represented in the LCD display instead of the 7-segment digits. This is design phase #2.
These are Internet references (1) (2) with sets of high-level C functions to interface LCD displays.
Discussion:
How to add the LCD display hardware?
What functions in the main program has to be modified to interface the LCD?
What is the variable var_LCD_flag used for?
What RAM variables are required now that we like to write text and numbers as ASCII messages? When is necessary to use an array of char? What kind of functions are required to change data types in C?
What variables are required if instead of a simple BCD addition, the circuit has to subtract, multiply or perform divisions? Discuss what kind of numbers: char, int, double int, float, etc. are required to operate.
Can you infer how to adapt to a µC PIC18F4520 the ALU application developed in LAB4.2?
3.6.3.2. Serial transmitter with LCD: Serial_transmitter_LCD
Enhance the Serial_transmitter from P10 with an LCD so that ASCII messages can be represented to indicate how the system operates. This is design phase #2.
Exercise: Study the Serial_transmitter_LCD circuit and explain what new variables are required to write a message on the LCD screen.