MECE336 Microprocessors I

Similar documents
Embedded Systems. Interfacing PIC with external devices 7-Segment display. Eng. Anis Nazer Second Semester

Embedded Systems. Interfacing PIC with external devices 7-Segment display. Eng. Anis Nazer Second Semester

VikiLABS. a g. c dp. Working with 7-segment displays. 1 Single digit displays. July 14, 2017

Experiment 3: Basic Embedded System Analysis and Design

Distance, Velocity and Acceleration Detection

Introduction to PIC Programming

DALHOUSIE UNIVERSITY Department of Electrical & Computer Engineering Digital Circuits - ECED Experiment 2 - Arithmetic Elements

SPI Serial Communication and Nokia 5110 LCD Screen

EXPERIMENT 2: Elementary Input Output Programming

PCI Decoders. Customizing PCI Decoder Drivers for Different Tuners. Application Note

DBt87xAN1. PCI Decoders Application Note Customizing PCI Decoder Drivers for Different Tuners

Model Solution and marking scheme for Examination Paper EEE305J1: Microcontroller Systems 2004/5 General Observations

Command line direct mode: This is relevant when a PC application is used to send and receive commands over the network port.

Experiment (6) 2- to 4 Decoder. Figure 8.1 Block Diagram of 2-to-4 Decoder 0 X X

7 Segment LED CB-035. ElectroSet. Module. Overview The CB-035 device is an, 8-digit 7-segment display. Features. Basic Parameters

Reaction Game Kit MitchElectronics 2019

Nuvoton Touch Key Series NT086D Datasheet

Part (A) Controlling 7-Segment Displays with Pushbuttons. Part (B) Controlling 7-Segment Displays with the PIC

Lab 4: Hex Calculator

Discrete Logic Replacement Melody Player

Find the equivalent decimal value for the given value Other number system to decimal ( Sample)

ECE Lab 5. MSI Circuits - Four-Bit Adder/Subtractor with Decimal Output

ELCT706 MicroLab Session #3 7-segment LEDs and Analog to Digital Conversion. Eng. Salma Hesham

Lab #6: Combinational Circuits Design

Using the Siemens S65 Display

Chapter 11 Sections 1 3 Dr. Iyad Jafar

AN202 LOW PIN-COUNT LCD INTERFACE. Relevant Devices This application note applies to the following devices: C8051F330, C8051F330D, C8051F331

Main Design Project. The Counter. Introduction. Macros. Procedure

Main Design Project. The Counter. Introduction. Macros. Procedure

2-Wire Interfaced, 7-, 14-, and 16-Segment Alphanumeric Vacuum-Fluorescent Display Controller

Keyboard Controlled Scoreboard

Seven Segment Board. User Manual. 1.0, Oct 2011

Using the Siemens S65 Display

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

Engineering College. Electrical Engineering Department. Digital Electronics Lab

Design Problem 4 Solutions

7 SEGMENT LED DISPLAY KIT

RS-232C External Serial Control Specifications

ET-REMOTE DISTANCE. Manual of ET-REMOTE DISTANCE

Lab #10: Building Output Ports with the 6811

TXZ Family. Reference Manual 12-bit Analog to Digital Converter (ADC-A) 32-bit RISC Microcontroller. Revision

InfoVue OLED Display

Digital Clock. Perry Andrews. A Project By. Based on the PIC16F84A Micro controller. Revision C

LCD Direct Drive Using HPC

CSCB58 - Lab 4. Prelab /3 Part I (in-lab) /1 Part II (in-lab) /1 Part III (in-lab) /2 TOTAL /8

Digital Electronic Circuits Design & Laboratory Guideline

ELEC 204 Digital System Design LABORATORY MANUAL

LCD Triplex Drive with COP820CJ

Spring 2011 Microprocessors B Course Project (30% of your course Grade)

The Wife DMX Tester. user manual

Combinational Logic Design

Combo Board.

Four Channel Digital Voltmeter with Display and Keyboard. Hardware RB0 RB1 RB2 RB3 RB4 RB5 RB6 RB7 RA0 RA1 RA2 RA3 PIC16C71

Radio Clock with DCF77

Introduction to Digital Logic Missouri S&T University CPE 2210 Exam 3 Logistics

CEDES. Functional description CEDES 7-Segment Double Digit Indicator (CAN) Functional description 7-Segment Double Digit Indicator (CAN)

MODULE 3. Combinational & Sequential logic

Chapter 4: Table of Contents. Decoders

PRACTICAL WORK BOOK For Academic Session Semester. DIGITAL LOGIC DESIGN (TC-203) For SE (TC)

CPE 200L LABORATORY 3: SEQUENTIAL LOGIC CIRCUITS UNIVERSITY OF NEVADA, LAS VEGAS GOALS: BACKGROUND: SR FLIP-FLOP/LATCH

Modbus for SKF IMx and Analyst

Experiment 7 Fall 2012

Laboratory 11. Required Components: Objectives. Introduction. Digital Displays and Logic (modified from lab text by Alciatore)

Digital Electronics II 2016 Imperial College London Page 1 of 8

Serially Interfaced, 8-Digit LED Display Drivers

CC-Series 7-Segment Configuration

Palestine Technical College. Engineering Professions Department. EEE Digital Logic Fundamentals. Experiment 2.

RS-232 Remote Control Command Reference

Solution to Digital Logic )What is the magnitude comparator? Design a logic circuit for 4 bit magnitude comparator and explain it,

Put Your Data Up in Lights Using an LED Display Chip

Semester 6 DIGITAL ELECTRONICS- core subject -10 Credit-4

Review of Sequential Logic Circuits

ECE 372 Microcontroller Design

PHYSICS 358 Advanced Electronics Laboratory Manual Fall 2014 Dr. Adam T. Whitten

Custom Installation Notes: Serial programming interface and IR remote commands for Arcam AVR400

DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING

EE 367 Lab Part 1: Sequential Logic

Analogue Versus Digital [5 M]

CCD Color Camera CS6910CL Specification. Contents

Q&A Watchdog Timer Configuration for DRV3205-Q1

STATIC RANDOM-ACCESS MEMORY

International Journal of scientific research and management (IJSRM) Volume 1 Issue 6 Pages Website: ISSN (e):

COMPUTER ENGINEERING PROGRAM

EZ-LIGHT K50 Modbus Series Multicolor Indicators

DM Segment Decoder/Driver/Latch with Constant Current Source Outputs

ECB DIGITAL ELECTRONICS PROJECT BASED LEARNING PROJECT REPORT ON 7 SEGMENT DIGITAL STOP WATCH USING DECODER

University of Illinois at Urbana-Champaign

LAB #6 State Machine, Decoder, Buffer/Driver and Seven Segment Display

Quad 7-segment display board

Design and Implementation of Timer, GPIO, and 7-segment Peripherals

Digital Circuits. Electrical & Computer Engineering Department (ECED) Course Notes ECED2200. ECED2200 Digital Circuits Notes 2012 Dalhousie University

Digilent Nexys-3 Cellular RAM Controller Reference Design Overview

Chapter 9 MSI Logic Circuits

Artistic Licence Engineering Ltd. Firmware Version V7.1 User Guide V7-11. Artistic Licence Engineering Ltd. Micro-Scope 3a user guide 1 / 72

Lab #11: Register Files

QuasarBrite Dot Matrix LED Display

ENGR 40M Project 3b: Programming the LED cube

NAND/NOR Implementation of Logic Functions

Today 3/8/11 Lecture 8 Sequential Logic, Clocks, and Displays

AN078. Getting Started. 1. Introduction

Transcription:

MECE336 Microprocessors I Lecture 9 Subtraction and Lookup Tables Associate Prof. Dr. Klaus Werner Schmidt of Mechatronics Engineering Çankaya University Compulsory Course in Mechatronics Engineering Credits (3/2/4) Course Webpage: http://mece336.cankaya.edu.tr Subtraction: 16 bit numbers Idea Use two 8bit file registers higher byte (HB) and lower byte (LB) Borrow from HB if necessary Example Computations

Subtraction: Program Outline Flowchart Explanation Subtraction: Implementation as Subroutine Assumptions Minuend HB is placed in file register 0x0C Minuend LB is placed in file register 0x0D Subtrahend HB is placed in file register 0x0E Subtrahend LB is placed in file register 0x0F Result HB is placed in file register 0x0C Result LB is placed in file register 0x0D Considerations

Subtraction: Implementation as Subroutine Subroutine Subtraction: Implementation as Subroutine

Subtraction: Implementation as Subroutine Example Program Call: Compute 4523 10 2380 10 Lookup Tables: Basics Idea Block of data in program memory that can be accessed by program Formulated as a subroutine on PIC16F84A Every data byte in lookup is accompanied by a instruction Selection of the correct instruction by using computed goto Use instruction addwf pcl Content of the working register W is added to the program counter pcl k instruction: return from subroutine with the value k in the W register Example Table addwf pcl 0x23 0x3F 0x47 0x7F 0xA2 0x1F 0x03 0x67

Lookup Tables: Example Example Program movlw call movwf clrw movlw call 0x03 PORTB 0x05 addwf pcl 0x23 0x3F 0x47 0x7F 0xA2 0x1F 0x03 0x67 end Program Counter and Working Register Lookup Tables: Example Example Program movlw call movwf clrw movlw call 0x03 PORTB 0x09 addwf pcl 0x23 0x3F 0x47 0x7F 0xA2 0x1F 0x03 0x67 end Program Counter and Working Register Content of W must not exceed size of!

Lookup Tables: Program Counter Example Program 7-Segment Display: Types Common Cathode (CC) All cathode connections are joined together to logic 0 (ground) All segments are off if logic 1 is applied to cathode Each segment is turned on by applying logic 1 to corresponding pin Segment is off if logic 0 is applied Current limiting resistors are used at the input pins Note: 7-segment display in the lab is CA Schematic

7-Segment Display: Types Common Anode (CA) All anode connections are joined together to logic 1 (supply) All segments are off if logic 0 is applied to anode Each segment is turned on by applying logic 0 to corresponding pin Segment is off if logic 1 is applied Current limiting resistors are used at the input pins Schematic 7-Segment Display: Truth Table (Common Cathode) Digits g f e d c b a Hex 0 0 0 1 1 1 1 1 1 0x3F 1 0 0 0 0 0 1 1 0 0x06 2 0 1 0 1 1 0 1 1 0x5B 3 0 1 0 0 1 1 1 1 0x4F 4 0 1 1 0 0 1 1 0 0x66 5 0 1 1 0 1 1 0 1 0x6D 6 0 1 1 1 1 1 0 1 0x7D 7 0 0 0 0 0 1 1 1 0x07 8 0 1 1 1 1 1 1 1 0x7F 9 0 1 1 0 1 1 1 1 0x6F Digit with decimal point: add 0x80 to Hex 0. 1 0 1 1 1 1 1 1 0xBF Display g f e d c b a f e a g d b c

7-Segment Display: Connection Connection to PORTB of PIC Obtain digit by writing one byte to PORTB 7-Segment Display: Lookup Table Lookup Table for Digits addlw pcl 0x3F 0x06 0x5B 0x4F 0x66 0x6D 0x7D 0x07 0x7F 0x6F Extend to including decimal point if desired Numbers Digit Hex Digit Hex 0 0x3F 0. 0xBF 1 0x06 1. 0x86 2 0x5B 2. 0xDB 3 0x4F 3. 0xCF 4 0x66 4. 0xE6 5 0x6D 5. 0xED 6 0x7D 6. 0xFD 7 0x07 7. 0x87 8 0x7F 8. 0xFF 9 0x6F 9. 0xEF

7-Segment Display: Example Program Counter with Delay Repeatedly count from 0 to 9 with a delay of 1 s between increments. Show the digit on a 7-segment display. 7-Segment Display: Example Program

7-Segment Display: Example Program 7-Segment Display: Two Displays in Parallel Multiplexing (Common Cathode) Circuit Turn on the two displays back to back with high speed (not simultaneously) appears as if both displays are turned on at the same time Enable one display by setting common cathode to 0 Disable other display by setting common cathode to 1 Write digit to display that is turned on

7-Segment Display: Two Displays in Parallel Example Program 7-Segment Display: Two Displays in Parallel