Docsity

Lab Exercise: Keypad & LCD I/O with HCS12 Microcontroller, Lab Reports of Electrical and Electronics Engineering

Toggle sidebar
bg1
I/O Interfacing of a Keypad and LCD Display
Embedded Microprocessor Design
Laboratory Exercise Two
1. Introduction
This laboratory exercise will give the student experience interfacing basic I/O devices
to the HCS12 microcontroller mounted on the CML12S-DP256 development board.
Refer to the Axiom CML12S-DP256 Development Board, the I/O Port Integration
and the SPI Serial Bus sections of the on-line documentation. You will need to obtain
information from the on-line documentation to complete this laboratory exercise. This
will give you experience reading and interpreting schematics, application notes, and data
sheets.
A block diagram of the subsections that will be configured in this exercise is shown
in Figures 1 and 2. Laboratory exercise one will be divided into two subsections:
• Week one interfacing the keypad (due at the end of week one)
• Week two interfacing the LCD display (due at the end of week two).
The keypad is a standard 4 X 4 matrix keypad with 4 rows and 4 columns. Port H bits 0
through 7 are connected to the keypad:
bits 3-0 (configured as outputs) are connected to the columns of the keypad and
bits 7-4 (configured as inputs) are connected to the rows of the keypad.
Figure 1 Block Diagram
HCS12
MCU
Keypad
Matrix
4 Rows
and
4 Columns
No External
Resistors
Serial to
Parallel
Conversion
Circuit
PTH
SPI-0
LCD Display 4 rows X 80 Characters
Parallel Interface
pf3
pf4
pf5

Partial preview of the text

Download Lab Exercise: Keypad & LCD I/O with HCS12 Microcontroller and more Lab Reports Electrical and Electronics Engineering in PDF only on Docsity!

I/O Interfacing of a Keypad and LCD Display Embedded Microprocessor Design Laboratory Exercise Two

  1. Introduction

This laboratory exercise will give the student experience interfacing basic I/O devices to the HCS12 microcontroller mounted on the CML12S-DP256 development board. Refer to the Axiom CML12S-DP256 Development Board , the I/O Port Integration and the SPI Serial Bus sections of the on- line documentation. You will need to obtain information from the on- line documentation to complete this laboratory exercise. This will give you experience reading and interpreting schematics, application notes, and data sheets. A block diagram of the subsections that will be configured in this exercise is shown in Figures 1 and 2. Laboratory exercise one will be divided into two subsections:

  • Week one interfacing the keypad (due at the end of week one)
  • Week two interfacing the LCD display (due at the end of week two). The keypad is a standard 4 X 4 matrix keypad with 4 rows and 4 columns. Port H bits 0 through 7 are connected to the keypad: bits 3-0 (configured as outputs) are connected to the columns of the keypad and bits 7-4 (configured as inputs) are connected to the rows of the keypad.

Figure 1 Block Diagram

HCS

MCU

Keypad Matrix 4 Rows and 4 Columns No External Resistors

Serial to Parallel Conversion Circuit PTH

SPI-

LCD Display 4 rows X 80 Characters Parallel Interface

Figure 2 Port Schematic

The DCM-20434 LCD display is interfaced to the MCU’s SPI-0 serial port through a serial to parallel converter as shown in Figure 3. Figure 3 shows the interface connections between the SPI-0 serial port, the 74HC595 (serial to parallel converter) device, and the LCD-PORT. The DCM-20434 LCD should be configured in four bit mode as the schematic shows DB3 through DB0 connected to ground.

Figure 3 Serial to Parallel Interface

To interface the LCD display to the HCS12 MCU you must understand how the physical layer interface circuit is constructed (shown in Schematics for Development Board ), how to configure and use the SPI serial port ( SPI Serial Bus Document), and how to configure and use the LCD display ( DMC-20434 LCD Specifications ).

Figure 4 Four Bit Initialization

Figure 5 LCD Commands