Tiva Lab 04: Interfacing Character LCD with Tiva LaunchPad
- Learn how to interface a character LCD module with a microcontroller in 4-bit mode
- Learn how to use ezTiva LIB to display a string onto the LCD
Required Reading Material
- Lesson 02: Data Types and Variables
- Lesson 03: Basic I/O Function
- Lesson 06: Loops
- Lesson 08: 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||× 1|
|10 KΩ Potentiometer||× 1|
|Jumper Wires Ribbon Cable||× 1|
|Breadboard Power Supply Module||× 1|
|Power Adapter 9V/2A||× 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 the GPIO output direction.
- Create a new folder under the EE3450 folder and name it Lab04_CharLCD.
- Launch the Keil μVisio and create a new project. Save the project to the project folder you just created in the previous step and set the project name to Lab04_CharLCD.)
- Add the Common and ezTivaLIB folders to the setting.
- Add ezTiva LIB (ez123GLIB.lib or ez1294LIB.lib) into your project, increase the stack and heap size under the "startup_TM4cXXX.s (Startup)" setting. (Lesson 08: Add ezTiva Library into Your Project)
Write down the following configuration information into your lab report.
Example Source Code
Copy the following example code to your main.c file.
Note: The example code is not yet complete, you must implement all functions following the lab instructions.
Use your embedded board to solve the following problems, and display the result on the character LCD module.