Tiva Lab 04: Interfacing Character LCD with Tiva LaunchPad
- Learn how to interface a character LCD module module with microcontroller in 4-bit mode
- Learn how to use ezTiva LIB to display a string onto the LCD
Required Reading Material
- Character LCD Display (HD44780-Based)
- Lesson 09: Add ezTiva Library into Your Project
- HD44780 Character LCD Module Datasheet
HD44780 based LCD modules are very popular among hobbyists because they are cheap and they can display characters. Besides they are very easy to interface with microcontrollers. In this lab, you will learn how to interface an HD44780 based character LCD to a TI Tiva LaunchPad. The interface requires 7 I/O lines of the TM4C microcontroller: 4 data lines and 3 control lines. You also will learn how to use ezTiva LIB in order to display information on the LCD module.
Required Components List
|Character LCD Module||x 1|
|10 KΩ Potentiometer||x 1|
Circuit / Schematic Diagram
In this lab, a 16x2 character LCD module will be used and connected to the Tiva LaunchPad, as shown in the following diagram. The LCD module will be configured in 4-bit interfacing mode, so the data pin D~D on the LCD module will not be used. All the pins used to connect to the LCD module must be configured with GPIO output direction.
Add EzTiva Library
- Launch Keil μVision, then create a new TI Tiva LaunchPad project.
- Follow this article to add the ezTiva LIB into your project.
Write down the following configuration information into your lab report.
Sample Firmware Code
Using your embedded board to solve the following problems, and display the result on the character LCD module.
Experiment 1: Calculate the Sum of Series
Do not directly calculate and show the answer. You have to use loop statements to get the answer.
Write a program in C to display the sum of series on the LCD module. The series is: 4 + 6 + 8 + … + 120