Labsheet 1 Embedded System Application

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 7

FAKULTI TEKNOLOGI KEJURUTERAAN

ELEKTRIK DAN ELEKTRONIK


UNIVERSITI TEKNIKAL MALAYSIA MELAKA

EMBEDDED SYSTEM APPLICATION

BEEE 3424 SEMESTER 2 SESI 2022/2023

LAB 1: SEVEN SEGMENT DISPLAY AND KEYPAD INTERFACING

NO. STUDENTS' NAME MATRIC. NO.

1.

2.

3.

PROGRAMME

SECTION /
GROUP

DATE

1.
NAME OF
INSTRUCTOR(S)
2.

EXAMINER’S COMMENT(S) TOTAL MARKS

Rev. Date Author(s) Description


No.
1.0 30 JAN 1. Izadora binti 1. Update to new UTeM logo
2019 Mustaffa 2. Update faculty's name
3. Change "course" to
"programme"
4. Remove verification stamp

1.1 22 FEB Suhaila binti Mohd 1. Update new topic for Lab 1.
2019 Najib

1.2 16 OCT Suhaila binti Mohd 1. Change objectives.


2020 Najib 2.Change equipment
3. Update procedures

1.3 16 OCT Suhaila binti Mohd 1.Change objectives.


2022 Najib 2.Change equipment
3.Update procedures
1.0 OBJECTIVES

(a) To familiarize with PIC18F4550, PTK40A Training Kit Module and PCWHD
IDE compiler.
(b) To understand input/output operation.
(c) Construct a basic embedded hardware based on seven segment and keypad
application.

2.0 EQUIPMENT/COMPONENTS

(a) Personal Computer


(b) PCWHD IDE compiler
(c) PTK40A Training Kit Module

3.0 SYNOPSIS & THEORY

A 7-Segment display is a useful electronic component use to produce numeric,


alphabetic and some non-alphabetic symbols using a specific arrangement of LEDs as
shown in Figure 1.

Figure 1: Seven Segment display


A seven-segment display consists of seven LEDs arranged in the form of a squarish 8
slightly inclined to the right and a single LED as the dot character. Different
characters can be displayed by selectively glowing the required LED segments. Seven
segment displays are of two types, common cathode and common anode. In common
cathode type, the cathode of all LEDs are tied together to a single terminal which is
usually labeled as com and the anode of all LEDs are left alone as individual pins
labeled as a, b, c, d, e, f, g & dot. In common anode type, the anode of all LEDs are
tied together as a single terminal and cathodes are left alone as individual pins. Both
the configurations are shown in Figure 2. In this experiment, a GPIO port on the
LM4F120H5QR MCU transmits 8 bits of data. These bits are applied to the 7segment
display to cause it to illuminate the appropriate segments to display the proper number
or character. The seven-segment used in this experiment is of common-cathode type.
Segment intensity is dependent on the current flow and should not exceed the limit of
the segment.
Figure 2: Common Anode and Common Cathode Configurations
Keypad is an array of switch. There will be 2 terminal pins connected each time a
button is pressed. For example; when button ‘1’ is pressed, pin COL1 and ROW1
is connected. Initially, there is no connection between rows and columns. The
button connects it. The keypad’s pins need to be pulled up or pulled down to
avoid floating case. Pull up normally connect to 5V and pull down is connect to
ground. 4x4 Keypad pin can directly connect to microcontroller or keypad
decoder IC.

In this section, we are trying to scan the button (character) being pressed on
keypad. The 4x4 keypad is a 16-way XY-Matrix hexadecimal keypad. It has eight
connections where four pins for row (ROW1-ROW4) and four pins for column
(COL1-COL4). The connection for the keypad is shown in Figure 3.

Figure 3: Keypad

4 row pins are set as an output (Output from PIC) while column pins are being
pulled high (via resistor) to 5V and being configured as readable pins (Input to
PIC). To check which button is being pressed, users need to scan a column at a
time and row by row. Make rows as output and columns as input as explained
earlier. For example; set (5V, high logic) all the rows by default. 1st scan, clear
(logic low) row 1 and scan column 1 until column 4 (‘1’, ‘2’, ‘3’ and ‘A’) for low
logic, this will determine which button is pressed in row 1. If one of those buttons
is pressed, record it and jump out from the scanning loop and continue with the
action required. If no button is being pressed in row 1, set it back to default (logic
high) and clear (logic low) row 2. Scan column 1 to column 4 again and this will
scan button press of ‘4’, ‘5’, ‘6’ and ‘B’. And this process should be repeated until
all four rows are being scanned.

4.0 PROCEDURE

PART 1: SEVEN SEGMENT DISPLAY

a) Identify the connection of seven-segment to the PIC18F4550 microcontroller


as connected in PTK40A PIC Training kit.

b) Identify the function of CD4511 chip and the advantage(s) of using it in our
circuit.

c) Identify the type of seven-segment being used in this lab? Map the truth table
of the seven- Segment display code for all possible display output.

d) By using a high-level language programming (C Language), develop a


program to display numbers from 00 to 99.

PART 2: KEYPAD

a) Identify the connection of keypad to the PIC18F4550 microcontroller as


connected in PTK40A PIC Training kit.

b) Explain each statement of the program based on the connection between


keypad and PTK40A trainer.
c) By using a high-level language programming (C Language), develop a
program to display numbers 0 to 9 based on keypad pressed.
5.0 DISCUSSION

Kindly critically discuss on the results and findings from this lab activity.
_____________________________________________________________________
_____________________________________________________________________
_____________________________________________________________________
_____________________________________________________________________
_____________________________________________________________________
_____________________________________________________________________
_____________________________________________________________________

6.0 CONCLUSION

Conclude what you have learned in this lab session.


_____________________________________________________________________
_____________________________________________________________________
_____________________________________________________________________
_____________________________________________________________________
_____________________________________________________________________
_____________________________________________________________________
_____________________________________________________________________
_____________________________________________________________________
_____________________________________________________________________
_____________________________________________________________________
_____________________________________________________________________

You might also like