LABORATORY 10: DISPLAYING A 7-SEGMENT LED AND FLASHING AN LED ARRAY

Similar documents
Controlling a Dot Matrix LED Display with a Microcontroller

CHAPTER 11: Flip Flops

Lab 17: Building a 4-Digit 7-Segment LED Decoder

STEPPER MOTOR SPEED AND POSITION CONTROL

How-To Set Custom Scale Format for FedEx Ship Manager

The stack and the stack pointer

POINTS POSITION INDICATOR PPI4

MIDECO 64-outputs MIDI note decoder USER MANUAL. Roman Sowa 2012

Advanced LED Controller (LED Chaser)

Data Acquisition Module with I2C interface «I2C-FLEXEL» User s Guide

Decimal Number (base 10) Binary Number (base 2)

4 Character 5x7 LED Matrix Display

3-Digit Counter and Display

The components. E3: Digital electronics. Goals:

Switch board datasheet EB

ETEC Digital Controls PIC Lab 10 Pulse Width Modulation

GLOLAB Universal Telephone Hold

Objectives: Part 1: Build a simple power supply. CS99S Laboratory 1

PHYS 2P32 Project: MIDI for Arduino/ 8 Note Keyboard

Seven-Segment LED Displays

Measuring Electric Phenomena: the Ammeter and Voltmeter

8051 MICROCONTROLLER COURSE

C8051F020 Utilization in an Embedded Digital Design Project Course. Daren R. Wilcox Southern Polytechnic State University Marietta, Georgia

Lab 7: Operational Amplifiers Part I

Lab #5: Design Example: Keypad Scanner and Encoder - Part 1 (120 pts)

8 by 8 dot matrix LED displays with Cascadable Serial driver B32CDM8 B48CDM8 B64CDM8 General Description

EINTE LAB EXERCISES LAB EXERCISE #5 - SIP PROTOCOL

Figure 8-1 Four Possible Results of Adding Two Bits

Designing VM2 Application Boards

Microcontroller Based Low Cost Portable PC Mouse and Keyboard Tester

Digital Fundamentals. Lab 8 Asynchronous Counter Applications

Small Hardware Development and Prototyping Board for the SX28

PART B QUESTIONS AND ANSWERS UNIT I

Special Lecture. Basic Stamp 2 Programming. (Presented on popular demand)

User Manual. AS-Interface Programmer

Experiment # 9. Clock generator circuits & Counters. Eng. Waleed Y. Mousa

Hardware and Software Requirements

USER GUIDE Programming Adapter Cable for Fujitsu Flash Microcontroller- F²MC-16LX/FR Family Fujitsu Microelectronics America, Inc.

The 104 Duke_ACC Machine

PLL frequency synthesizer

c0003 A Simple PIC Application CHAPTER 3

FORDHAM UNIVERSITY CISC Dept. of Computer and Info. Science Spring, Lab 2. The Full-Adder

Lab 11 Digital Dice. Figure Digital Dice Circuit on NI ELVIS II Workstation

Points Position Indicator (PPI1) for Points Motors with Common Ground

8-Bit Flash Microcontroller for Smart Cards. AT89SCXXXXA Summary. Features. Description. Complete datasheet available under NDA

- 35mA Standby, mA Speaking pre-defined phrases with up to 1925 total characters.

HP StorageWorks MSL2024, MSL4048, and MSL8096 Tape Libraries firmware release notes. Firmware version 4.60 (MSL2024), 6.90 (MSL4048), 9.

LED board datasheet EB

Interfacing Analog to Digital Data Converters

Designing a Schematic and Layout in PCB Artist

Programming PIC Microcontrollers in PicBasic Pro Lesson 1 Cornerstone Electronics Technology and Robotics II

Comp 255Q - 1M: Computer Organization Lab #3 - Machine Language Programs for the PDP-8

8-Bit Microcontroller with Flash. Application Note. Using a Personal Computer to Program the AT89C51/C52/LV51/LV52/C1051/C2051

MN1010 Evaluation Kit v3 User Guide

The Programming Interface

In-System Programming Design TM. Guidelines for ispjtag Devices. Introduction. Device-specific Connections. isplsi 1000EA Family.

ADDING and/or DELETING PIN NUMBERS (Plus other simple programming commands) in My DK-16 or DK-26 DIGITAL KEYPAD

TIL311 HEXADECIMAL DISPLAY WITH LOGIC

Develop a Dallas 1-Wire Master Using the Z8F1680 Series of MCUs

AP-1 Application Note on Remote Control of UltraVolt HVPS

Jianjian Song LogicWorks 4 Tutorials (5/15/03) Page 1 of 14

Information Board User s Guide

Measuring Resistance Using Digital I/O

Appendix C: Keyboard Scan Codes

Designing an Induction Cooker Using the S08PT Family

Digital Systems Based on Principles and Applications of Electrical Engineering/Rizzoni (McGraw Hill


How To Program A Microcontroller Board (Eb064) With A Psp Microcontroller (B064-74) With An Ios 2.5V (Power) And A Ppt (Power Control) (Power Supply) (

IR Communication a learn.sparkfun.com tutorial

XC83x AP Application Note. Microcontrollers. intouch Application Kit - LED Matrix Display V1.0,

MN3310 Evaluation Kit v1 User Guide

Lab 1 Course Guideline and Review

How to test and debug an ASP.NET application

ECEN 1400, Introduction to Analog and Digital Electronics

Cornerstone Electronics Technology and Robotics I Week 15 Voltage Comparators Tutorial

CSE 141L Computer Architecture Lab Fall Lecture 2

Digital I/O: OUTPUT: Basic, Count, Count+, Smart+

School of Engineering Department of Electrical and Computer Engineering

Programming A PLC. Standard Instructions

ENGI E1112 Departmental Project Report: Computer Science/Computer Engineering

Electronic WorkBench tutorial

IC Opens/Shorts Testing

BCD (ASCII) Arithmetic. Where and Why is BCD used? Packed BCD, ASCII, Unpacked BCD. BCD Adjustment Instructions AAA. Example

RGB for ZX Spectrum 128, +2, +2A, +3

Conversion Between Analog and Digital Signals

RDF1. RF Receiver Decoder. Features. Applications. Description. Ordering Information. Part Number Description Packages available

LAB #4 Sequential Logic, Latches, Flip-Flops, Shift Registers, and Counters

To design digital counter circuits using JK-Flip-Flop. To implement counter using 74LS193 IC.

AUTOMATIC NIGHT LAMP WITH MORNING ALARM USING MICROPROCESSOR

CM HOST CM CardTransporter Fuel Communication and Management Software Software version up to 3.1

Microcontroller Code Example Explanation and Words of Wisdom For Senior Design

Counters and Decoders

Table 1 Comparison of DC, Uni-Polar and Bi-polar Stepper Motors

POCKET SCOPE 2. The idea 2. Design criteria 3

Lab 1: Introduction to PSpice

TRILOGI 5.3 PLC Ladder Diagram Programmer and Simulator. A tutorial prepared for IE 575 by Dr. T.C. Chang. Use On-Line Help

Instructions on How to Use HyperTerminal to Test Serial Ports ...

Supertex inc. HV Channel High Voltage Amplifier Array HV256. Features. General Description. Applications. Typical Application Circuit

Physics 120 Lab 6: Field Effect Transistors - Ohmic region

Transcription:

LABORATORY 10: DISPLAYING A 7-SEGMENT LED AND FLASHING AN LED ARRAY NAME: STUDENT ID#: Objectives Learn how to: Program the 8255 to show digits on a 7-segment LED. Program both the 8255 and 8279 in order to accept keypad inputs from 0 to F and display it on a 7-segment LED. Program the 8255 to flash an LED array. Part 1: Displaying a 7-Semgent LED from keypad inputs The 7-segment LED display can be found in many displays such as microwave or fancy toaster ovens and occasionally in non-cooking devices. It is composed of 7 LEDs that are fabricated in one case to make a convenient device for displaying numbers and some letters. Figure L10.1 shows a typical 7-segment LED display with its pin layout. The 7-segment LED shown in Figure L10.1 is a common anode LED display. This means that the positive leg of each LED is connected to a common point which is pin 3 in this case. Each LED has a negative leg that is connected to one of the pins of the device. To make it work, you need to connect pin 3 to +5 volts. Then to make each segment light up, connect the ground pin to ground. A resistor is required to limit the current. Rather than using a resistor from each LED to ground, you can just use one resistor from Vcc to pin 3 to limit the current. Figure L10.1 A 7-segment LED display and its pin layout. LAB10-1

Table L10.1 provides the information that is needed to display digits from 0 to 9 and the letters A, b, C, d, E, and F. '0' means that pin is connected to ground and '1' means that pin is connected to Vcc. Table L10.1 Logic states of 7-segment LED to display different digits or letters. a (Pin 1) b (Pin 10) c (Pin 8) d (Pin 6) e (Pin 5) f (Pin 2) g (Pin 9) 0 0 0 0 0 0 0 1 1 1 0 0 1 1 1 1 2 0 0 1 0 0 1 0 3 0 0 0 0 1 1 0 4 1 0 0 1 1 0 0 5 0 1 0 0 1 0 0 6 0 1 0 0 0 0 0 7 0 0 0 1 1 1 1 8 0 0 0 0 0 0 0 9 0 0 0 1 1 0 0 A 0 0 0 1 0 0 0 b 1 1 0 0 0 0 0 C 0 1 1 0 0 0 1 d 1 0 0 0 0 1 0 E 0 1 1 0 0 0 0 F 0 1 1 1 0 0 0 Figure L10.2 shows the 7-segment LED decoder circuit. With this information we can design assembly instructions to display different digits or letters on the 7-segment LED. For example, the instruction to display 1 on the 7-segment LED is: OUT 3FF0, F9 To avoid showing the consecutive digits from 0 to F too quickly, we need to insert time delay before outputting the next digit on the 7-segment LED. This can be accomplished by writing a time delay loop as follows: MOV CX, 0A000H LOOP $ LAB10-2

Figure L10.2 The 7-segment LED decoder circuit Here we will begin our practice of displaying digits or letters on a 7-segment LED with a simple program. We will analyze, run, and modify the program. Check off each step as it is completed. Check Step Procedure 1. Examine the data segment and constant definitions in the program L10P1.ASM. a. How many digits does the program generate? b. What is the name of the repeat count that is used to set the duration between digits? Find the value assigned to this constant in the program. 2. Examine the part of the program in L10P1.ASM. What is the address of FND? a. What does the instruction sequence that follows do? J2: MOV AL, [SI] MOV CX, 0A000H LOOP $ INC SI DEC BL JNZ J2 b. Is this FND a common cathode or anode LED? 3. List the 16-bit words corresponding to the display of each digit from 0 to F. LAB10-3

4. Do the following steps to generate a downloadable hex format file and download it through RS-232. C:\> MASM ( ) Enter L10P1 C:\> LINK ( ) Enter L10P1 C:\> EXE2BIN L10P1 ( ) C:\> BIN2HEX ( ) Enter L10P1.BIN 5. Use debug program to trace L10P1.EXE and describe what you see. 6. Modify the program to show only even digits. Reassemble, relink, and generate L10P1A.EXE. Download the new program to MTS-86C and verify the program that it works correctly. Describe the difference between what was seen in step 4 and what you now see. Hand in your program listing with this lab report. Part 2: Scan a key from the keypad and display it on a 7-segment LED In this part of the lab, we will learn to read inputs from a keypad and display the corresponding key that is pressed on a 7-segment LED display. You will need to write an assembly program that will determine which key has been pressed on the key pad. The program will then display the corresponding character by configuring the output port correctly (the 7-segment displays). A schematic diagram is provided below to show connections needed to implement this lab. To do this, we will briefly introduce the fundamentals of a keypad and we will also show how an 8279 is used to interface a keypad. The circuit of 8279 is shown in Figure L10.3. In order to scan the keypad, the 8279 outputs a nibble to force one (only one) of the columns low and then reads the rows to see if any key in that column have been pressed. The rows are pulled up by the internal weak pull-ups in the 8279 ports. Consequently, as long as no key is pressed, the 8279 detects a logic high on each of the pins attached to the keypad rows. The nibble driven onto the columns always contains only a single 0. The only way that the 8279 can find a 0 on any row pin is when the keypad button to be pressed. In that case, a logic 0 will be read on the corresponding column LAB10-4

line. The 8279 identifies which column is at a 0-level and which row reads 0, allowing it to determine which key is pressed. For the keypad, the pins from left to right are: R1, R2, R3, R4, C1, C2, C3, C4. Figure L10.3 Keypad interface with 8279 Check Step Procedure 1. View the file L10P2.ASM with an editor. What are the contents of the data table in the program? 2. What is the address of 8279? 3. What does the instruction sequence that follows do? _ CNTR79 EQU 0FFEAH MOV DX, CNTR79 MOV AL, 0 MOV AL, 39H 4. What happens if skipping the below instructions in LP10P2.ASM? _ LOOP1: IN AL, DX TEST AL, 7 JZ LOOP1 5. Write a new program, L10P2A.ASM, modified from the program L10P2.ASM, to scan the keypad and display digits only from 0 to F on the 7-segment LED. Hand in your program listing with this lab report. LAB10-5

Part 3: A Simple Program to flash an LED array The objective of this part of the lab is to know how to flash an LED array through 8255 interface. Figure L10.4 shows the interface circuit for the LED array. Figure L10.4 Interface circuit for an LED array Check Step Procedure 1. View the file L10P3.ASM with an editor. What are the addresses of the control register, port A and port B? 2. What is the operation mode of 8255? 3. What does the instruction sequence that follows do? CNT3 EQU 3FD6H APORT3 EQU 3FD0H BPORT3 EQU 3FD2H MOV AL, 90H MOV DX, CNT3 J1: MOV DX, APORT3 IN AL, DX NOT AL MOV DX, BPORT3 JMP J1 4. Why is the purpose of the instruction 'NOT AL? 5. Write a new program, L10P3A.ASM, to light the LED array with different flashing pattern. The assembly program will flash the LED array continuously at approximately 1Hz. You need to implement a simple loop in the program that delays for 500 ms (half a second) with the LED on, and then delays for another 500 ms with the LED off. Thus, the LED flashes at 1 Hz! Hand in your program listing with this lab report. LAB10-6