The University of Texas at Arlington Lecture 7

Size: px
Start display at page:

Download "The University of Texas at Arlington Lecture 7"

Transcription

1 The University of Texas at Arlington Lecture 7 CSE 3442/5442

2 Agenda HW 2 due today Begin Chapter 5 In class assignment. Reading Assignment for Tuesday, Continue Reading Chapter 6. Assignment 3 and 4 due Tuesday (September17) 2

3 Example of Interfacing PIC to LED/Switches on QwikFlash Potentiometer 1 k pull up resistor on OPEN DRAIN Push Button Switch 3

4 Use of RA4 on QuickFlash- (Open Drain pin) see An open drain terminal is connected to ground in the low voltage (logic 0) state, but has high impedance in the logic 1 state. This prohibits current flow, but as a result, such a device requires an external pull-up resistor which is also connected to the positive voltage 4

5 Open-Drain Discussion- Cont. When a device is in the high-impedance state, the pull-up resistor keeps the line at logic 1. The line stays there until the device goes into the logic 0 state, and begins to sink current. This current flow creates a voltage drop across the pull-up resistor, and the line drops to the logic 0 voltage. 5

6 Open-Drain Discussion- Cont. Open-drain devices are commonly used to connect multiple devices to a bus.this enables one device to drive the bus without interference from the other inactive devices - if open-drain devices are not used, then the outputs of the inactive devices would attempt to hold the bus voltage high, resulting in unpredictable output. 6

7 Consider the One-Transistor Inverter Figure C-2 in the Appendix illustrates the simple transistor inverter. 7

8 Some Logic Family Specifications 8

9 Drive and Fan Out Capabilities of Different Semiconductor Families 9

10 Computing The Fan-Out 10

11 STD TTL Low I OL /I IL = 16/1.6 = 10 High I OH /I Ih = 0.4/.04 = 10 11

12 Computing Pull Up Value for Open Collector 12

13 Consider Pull up for the One- Transistor Inverter Assume R C in figure below, is an external pull up resistor V OL = V CC - V IL v OH ~ V IH(max) I PU I PU IOH(Leakage) I OL I IL I PU = I OL + I IL I IH I PU = I OH - I IH 13

14 Driving Multiple Devices For driving multiple (N) similar modules, use R Max = ()V CC - V O )/(I PU ) where: V O set to 0 I PU = I OL - N*I IL R Min = (V CC - V IH )/(I PU ) where: V IH I PU = I OH + N*I IH Also See: _pins.html 14

15 Computing Pull-Up Resistor TPS62067 into TPS62067 From Referenced TI Application Note: SLVA485-Oct 2011 See Link 15

16 Open Drain Example - TI Application SLVA485) 16

17 TI Application SLVA485 pp. 2 SVS Supply Voltage Supervisor PG - power good and LBI - Low battery 17

18 Open Drain High 18

19 Computing R pull-up Max And I pullup 19

20 I OL 20

21 Open Drain Low V PG = 0 for Lower R 21

22 Computing R pull-up Min And I pullup V PG = 0 for Lower R, or use Vout 22

23 R pull-up 1.8 kω R Pull-up k Ω 23

24 Chapter 5 ARITHMETIC, LOGIC INSTRUCTIONS, AND PROGRAMS 24

25 Chapter 5 Instructions ADDWF filereg d add contents of working register to filereg result in filereg or WREG ADDWFC same as first instruction but adds previous carry bit to result (multibyte instructions) C = 1 3C E7 + 3B 8D =

26 ADDWFC ; Loc 6 = (8D) ; Loc 7 = (3B) MOVLW 0xE7 ;Load WREG with E7H ADDWF 0x6,F ;F = W + F C=1 MOVLW 0x3C ; WREG 3CH ADDWFC 0x7,F ; F = W + F + carry 26

27 BCD/DAW Unpacked BCD lower bits number in BCD upper 4 bits zero Packed BCD both lower 4 and upper 4 bits BCD number DAW, decimal adjust MOVLW 0X47 ADDLW 0X25 DAW ; ADJUST FOR BCD (WREG = 72H) 27

28 Multiplication of unsigned numbers MULLW K ;PRODH = high byte, SFR and PRODL = low byte Byte x Byte WREG K SFR One byte must be in WREG and second - Literal 28

29 Division of Unsigned Numbers No single instruction for division of byte/byte numbers in PIC18. Must use repeated subtraction see Example 5-8 pp164 29

30 Signed Numbers Positive numbers +127 to -128 Overflows indicated by flag in Status Register (See examples pp ) If result of an operation on signed numbers too large for the register 30

31 OV flag The Overflow flag is set when 1. carry from D6 to D7 but no carry out (C=0) 2. carry from D7 our (C=1) but no carry from D6 to D7 31

32 Example 5-14 Example: N=0, C=1 No carry from D6 to D7 32

33 Logic Instructions AND OR XORLW K (exclusive of two operands) COMF (complement filereg) (1 s Complement) NEG (negate filereg) (2 s Complement) 33

34 Compare Instructions CPFSGT Skip if FileREG > WREG CPFSEQ Skip if FileREG = WREG CPFSLT Skip if FileREG < WREG 34

35 Rotate and Swap Nibbles RRNCF(RLNCF) filereg,d ; rotate right/left RRCF(RLCF) filereg,d ; rotate right/left through carry SWAPF filereg,d ; swaps upper and lower nibbles (4bits) 35

36 36

37 Embedded Design with the PIC18F452 Microcontroller Prentice Hall, 2003 Peatman 37

38 Work the following Examples in Class 1a. Find the C,Z, and DC flags for: MOVLW 0x3F ADDLW 0X45 1b. MOVLW 0xEF MOVWF MYREG BSF STATUS,C MOVLW 0 ADDWFC MYREG,F 38

39 In Class Example - CONT 2. True or False The DAW instruction only works with the WREG register 3. Which register holds the OV flag 4. True or False In using the CPFSEQ instruction, we must use WREG as one of the registers. 39

40 Parity and Check Sum Parity and Check Sum: Parity and checksum are used to help insure data is transmitted from one module to another without loss of bits or data. Your text discusses check sum in Chapter 5. Neither method will guarantee signal integrity, but are simple methods often used for aiding loss of information in communications. 40

41 Parity and Check Sum Check Sum: 1. Add the bytes and ignore the carries 2. The 2 s complement of the result in 1. forms the check sum. Parity: For odd carry, count the number of ones in each column. Make the carry bit for that column one if there is an even number of ones. If an odd number the carry bit should be zero. 41

42 Parity and Check Sum cont. Parity Example Check Sum Example = Or 2 s Comp

43 43

44 44

45 45

46 Parity and Checksum Additional Examples: The (vertical) parity and checksum bytes for the following four hex bytes are 35 ( ) and E8 respectively. 23 ( ) 23 + A2 + 8F + C4 = 218h A2 ( ) = = 8F ( ) E7 + 1 = E8 C4 ( ) Parity (odd) 46

47 In Class Assignment #2 cont. The Hex files generated by Microchip s assembler uses a check sum with each load file. Additional information can be found on the web at the following two links:

48 Parity and Checksum cont. Compute first the odd (vertical) parity byte and then checksum for the following bytes: D A C9 48

49 In Class Assignment - Answers 1. a. Find the C,Z, and DC flags for: MOVLW 0x3F ADDLW 0X45 3 F = 8 4 C = 0, Z=0, DC = 1 49

50 Answers - Continued b. MOVLW 0xEF MOVWF MYREG BSF STATUS,C MOVLW 0 ADDWFC MYREG,F 1 + E F = (0) F 0 C = 0, Z=0, DC = 1 50

51 Answers - Continued 2. True or False The DAW instruction only works with the WREG register - TRUE 3. Which register holds the OV flag - STATUS 4. True or False In using the CPFSEQ instruction, we must use WREG as one of the registers. - TRUE 51

52 Parity and Checksum cont. Compute first the odd (vertical) parity byte and then checksum for the following bytes: D A C ODD Parity AD Check Sum 52

53 Chapter 6 Addressing 53

54 Addressing Methods Immediate Addressing Operand part of the instruction Direct Addressing Instruction has the operand address and thus can be directly addressed Register Indirect Addressing Instructions specifies a register that has the address of the operand (pointer to the operand). 54

55 Addressing Methods - cont Immediate Addressing operand is part of the instruction, thus immediately available when instruction is fetched. MOVLW 0X25 ; 25H WREG ANDLW B ;AND WREG with 40H Using EQU COUNT EQU 0x30 MOVLW COUNT ; 30H WREG ; Assembler insures 30H placed in the second byte of the instruction 55

56 Addressing Methods- cont. Direct Addressing operand is obtained from file register. MOVLW 0X25 ; 25H WREG MOVFW 0x45 ; MOVE CONTENTS OF FILE ; REGISTER 45H TO WREG, ; (0x45) WREG MOVFF 0x40, 0x50 ; (40H) (50H) Note the MOVWF only access the current bank while the MOVFF instruction can access all of the 4K RAM address space File register (RAM) arranged into 16 Banks of 256 bytes. 56

57 Data RAM Registers 16 Banks of 256 Bytes 57

58 Bank Addressing Direct Addressing Instructions take 2 bytes, one for the operation and the other for an 8 bit 256 byte Access Bank address. Thus need way to access the other Banks. 58

59 Direct Addressing cont. When using direct addressing recall the result of the operation can be saved in either the file register ( F ) or WREG ( W ) Example: INCF 0x20,W ;(0x20) + 1 (WREG) INCF 0X20,F ;(0x20) + 1 (0x20) or INCF 0X20 ;(0x20) + 1 (0x20) (Default ; File Register 59

60 SFR Note: The Special Function Registers or SFR can be directly accessed by their names. (For C, see header file, e.g.. MPLAB-Cxx PIC18F452 processor header) MOVWF PORTB BSF register STATUS,C ; set c bit of status 60

Arithmetic,logic Instruction and Programs

Arithmetic,logic Instruction and Programs Arithmetic,logic Instruction and Programs 1 Define the range of numbers possible in PIC unsigned data Code addition and subtraction instructions for unsigned data Perform addition of BCD Code PIC unsigned

More information

Arithmetic and Logic Instructions. Hsiao-Lung Chan Dept Electrical Engineering Chang Gung University, Taiwan

Arithmetic and Logic Instructions. Hsiao-Lung Chan Dept Electrical Engineering Chang Gung University, Taiwan Arithmetic and Logic Instructions Hsiao-Lung Chan Dept Electrical Engineering Chang Gung University, Taiwan chanhl@mail.cgu.edu.tw Find the sum of the values from 40H to 43H. Put the sum in filereg locations

More information

The University of Texas at Arlington Lecture 5

The University of Texas at Arlington Lecture 5 The University of Texas at Arlington Lecture 5 CSE 3442/5442 LCD Discussed in Chapter 12 RS, R/W, E Signals Are Used to Send/Receive Data on D0-D7 2 PIC PROGRAMMING IN C CHAPTER 7 Chapter 7 discusses the

More information

The University of Texas at Arlington Lecture 3

The University of Texas at Arlington Lecture 3 The University of Texas at Arlington Lecture 3 CSE 3442/5442 Tuesday, We Began Chapter 2, Architecture & Assembly Language Programming, Introduced the PIC WREG (Working Register) 8 bit register in PIC

More information

PIC Architecture & Assembly Language Programming. Hsiao-Lung Chan Dept Electrical Engineering Chang Gung University, Taiwan

PIC Architecture & Assembly Language Programming. Hsiao-Lung Chan Dept Electrical Engineering Chang Gung University, Taiwan PIC Architecture & Assembly Language Programming Hsiao-Lung Chan Dept Electrical Engineering Chang Gung University, Taiwan chanhl@mail.cgu.edu.tw ALU with working register (WREG) and literal value 2 MOVLW

More information

Chapter 4 Sections 1 4, 10 Dr. Iyad Jafar

Chapter 4 Sections 1 4, 10 Dr. Iyad Jafar Starting to Program Chapter 4 Sections 1 4, 10 Dr. Iyad Jafar Outline Introduction Program Development Process The PIC 16F84A Instruction Set Examples The PIC 16F84A Instruction Encoding Assembler Details

More information

ECE Test #1: Name

ECE Test #1: Name ECE 376 - Test #1: Name Closed Book, Closed Notes. Calculators Permitted. September 23, 2016 20 15 10 5 0

More information

Section 31. Instruction Set

Section 31. Instruction Set 31 HIGHLIGHTS Section 31. Instruction Set Instruction Set This section of the manual contains the following major topics: 31.1 Introduction... 31-2 31.2 Data Memory Map... 31-3 31.3 Instruction Formats...

More information

Assembly Language Instructions

Assembly Language Instructions Assembly Language Instructions Content: Assembly language instructions of PIC16F887. Programming by assembly language. Prepared By- Mohammed Abdul kader Assistant Professor, EEE, IIUC Assembly Language

More information

PIC 16F84A programming (II)

PIC 16F84A programming (II) Lecture (05) PIC 16F84A programming (II) Dr. Ahmed M. ElShafee ١ Introduction to 16F84 ٣ PIC16F84 belongs to a class of 8-bit microcontrollers of RISC architecture. Program memory (FLASH) EEPROM RAM PORTA

More information

CENG 336 INT. TO EMBEDDED SYSTEMS DEVELOPMENT. Spring 2006

CENG 336 INT. TO EMBEDDED SYSTEMS DEVELOPMENT. Spring 2006 CENG 336 INT. TO EMBEDDED SYSTEMS DEVELOPMENT Spring 2006 Recitation 01 21.02.2006 CEng336 1 OUTLINE LAB & Recitation Program PIC Architecture Overview PIC Instruction Set PIC Assembly Code Structure 21.02.2006

More information

Lecture (04) PIC16F84A (3)

Lecture (04) PIC16F84A (3) Lecture (04) PIC16F84A (3) By: Dr. Ahmed ElShafee ١ Central Processing Unit Central processing unit (CPU) is the brain of a microcontroller responsible for finding and fetching the right instruction which

More information

16.317: Microprocessor-Based Systems I Summer 2012

16.317: Microprocessor-Based Systems I Summer 2012 16.317: Microprocessor-Based Systems I Summer 2012 Exam 3 Solution 1. (20 points, 5 points per part) Multiple choice For each of the multiple choice questions below, clearly indicate your response by circling

More information

Chapter 5. Problems All programming problems should include design pseudo code either as a separate design document on embedded comments in the code.

Chapter 5. Problems All programming problems should include design pseudo code either as a separate design document on embedded comments in the code. Chapter 5. Problems All programming problems should include design pseudo code either as a separate design document on embedded comments in the code. 1S. Prior to execution of the following code segment,

More information

SOLUTIONS!! DO NOT DISTRIBUTE!!

SOLUTIONS!! DO NOT DISTRIBUTE!! THE UNIVERSITY OF THE WEST INDIES EXAMINATIONS OF FEBRUARY MID-TERM 2005 Code and Name of Course: EE25M Introduction to Microprocessors Paper: Date and Time: Duration: One Hour INSTRUCTIONS TO CANDIDATES:

More information

TOPIC 3 INTRODUCTION TO PIC ASSEMBLY LANGUAGE. E4160 Microprocessor & Microcontroller System. Prepared by : Puziah Yahaya JKE, POLISAS / DEC 2010

TOPIC 3 INTRODUCTION TO PIC ASSEMBLY LANGUAGE. E4160 Microprocessor & Microcontroller System. Prepared by : Puziah Yahaya JKE, POLISAS / DEC 2010 TOPIC 3 INTRODUCTION TO PIC ASSEMBLY LANGUAGE Prepared by : Puziah Yahaya JKE, POLISAS / DEC 2010 E4160 Microprocessor & Microcontroller System Learning Outcomes 2 At the end of this topic, students should

More information

DERTS Design Requirements (1): Microcontroller Architecture & Programming

DERTS Design Requirements (1): Microcontroller Architecture & Programming Lecture (5) DERTS Design Requirements (1): Microcontroller Architecture & Programming Prof. Kasim M. Al-Aubidy Philadelphia University 1 Lecture Outline: Features of microcomputers and microcontrollers.

More information

16.317: Microprocessor-Based Systems I Spring 2012

16.317: Microprocessor-Based Systems I Spring 2012 16.317: Microprocessor-Based Systems I Spring 2012 Exam 3 Solution 1. (20 points, 5 points per part) Multiple choice For each of the multiple choice questions below, clearly indicate your response by circling

More information

Lesson 14. Title of the Experiment: Introduction to Microcontroller (Activity number of the GCE Advanced Level practical Guide 27)

Lesson 14. Title of the Experiment: Introduction to Microcontroller (Activity number of the GCE Advanced Level practical Guide 27) Lesson 14 Title of the Experiment: Introduction to Microcontroller (Activity number of the GCE Advanced Level practical Guide 27) Name and affiliation of the author: N W K Jayatissa Department of Physics,

More information

LAB WORK 2. 1) Debugger-Select Tool-MPLAB SIM View-Program Memory Trace the program by F7 button. Lab Work

LAB WORK 2. 1) Debugger-Select Tool-MPLAB SIM View-Program Memory Trace the program by F7 button. Lab Work LAB WORK 1 We are studying with PIC16F84A Microcontroller. We are responsible for writing assembly codes for the microcontroller. For the code, we are using MPLAB IDE software. After opening the software,

More information

EEE111A/B Microprocessors

EEE111A/B Microprocessors EEE111A/B Microprocessors Revision Notes Lecture 1: What s it all About? Covers the basic principles of digital signals. The intelligence of virtually all communications, control and electronic devices

More information

CHAPTER 6 ARITHMETIC, LOGIC INSTRUCTIONS, AND PROGRAMS

CHAPTER 6 ARITHMETIC, LOGIC INSTRUCTIONS, AND PROGRAMS CHAPTER 6 ARITHMETIC, LOGIC INSTRUCTIONS, AND PROGRAMS Addition of Unsigned Numbers The instruction ADD is used to add two operands Destination operand is always in register A Source operand can be a register,

More information

4.5.1) The Label Field ) The Mnemonic Field. 4.5) Assembly Language Program Structure A PIC18 ALP consists of 3 type of statements:

4.5.1) The Label Field ) The Mnemonic Field. 4.5) Assembly Language Program Structure A PIC18 ALP consists of 3 type of statements: 4.5) Assembly Language Program Structure A PIC18 ALP consists of 3 type of statements: 1) Assembler Directives To control the assembler: its input, output, and data allocation. Must be terminated with

More information

/ 40 Q3: Writing PIC / 40 assembly language TOTAL SCORE / 100 EXTRA CREDIT / 10

/ 40 Q3: Writing PIC / 40 assembly language TOTAL SCORE / 100 EXTRA CREDIT / 10 16.317: Microprocessor-Based Systems I Summer 2012 Exam 3 August 13, 2012 Name: ID #: Section: For this exam, you may use a calculator and one 8.5 x 11 double-sided page of notes. All other electronic

More information

Input/Output Ports and Interfacing

Input/Output Ports and Interfacing Input/Output Ports and Interfacing ELEC 330 Digital Systems Engineering Dr. Ron Hayne Images Courtesy of Ramesh Gaonkar and Delmar Learning Basic I/O Concepts Peripherals such as LEDs and keypads are essential

More information

ENE 334 Microprocessors

ENE 334 Microprocessors Page 1 ENE 334 Microprocessors Lecture 10: MCS-51: Logical and Arithmetic : Dejwoot KHAWPARISUTH http://webstaff.kmutt.ac.th/~dejwoot.kha/ ENE 334 MCS-51 Logical & Arithmetic Page 2 Logical: Objectives

More information

16.317: Microprocessor-Based Systems I Fall 2012

16.317: Microprocessor-Based Systems I Fall 2012 16.317: Microprocessor-Based Systems I Fall 2012 Exam 2 Solution 1. (20 points, 5 points per part) Multiple choice For each of the multiple choice questions below, clearly indicate your response by circling

More information

PIC16F87X 13.0 INSTRUCTION SET SUMMARY INSTRUCTIONS DESCRIPTIONS

PIC16F87X 13.0 INSTRUCTION SET SUMMARY INSTRUCTIONS DESCRIPTIONS PIC6F87X 3.0 INSTRUCTION SET SUMMARY Each PIC6F87X instruction is a 4bit word, divided into an OPCODE which specifies the instruction type and one or more operands which further specify the operation of

More information

16.317: Microprocessor Systems Design I Fall 2013 Exam 3 Solution

16.317: Microprocessor Systems Design I Fall 2013 Exam 3 Solution 16.317: Microprocessor Systems Design I Fall 2013 Exam 3 Solution 1. (20 points, 5 points per part) Multiple choice For each of the multiple choice questions below, clearly indicate your response by circling

More information

Instuction set

Instuction set Instuction set http://www.piclist.com/images/www/hobby_elec/e_pic3_1.htm#1 In PIC16 series, RISC(Reduced Instruction Set Computer) is adopted and the number of the instructions to use is 35 kinds. When

More information

ALU and Arithmetic Operations

ALU and Arithmetic Operations EE25M Introduction to microprocessors original author: Feisal Mohammed updated: 6th February 2002 CLR Part IV ALU and Arithmetic Operations There are several issues connected with the use of arithmetic

More information

CHAPTER 0: INTRODUCTION TO COMPUTING SECTION 0.1: NUMBERING AND CODING SYSTEMS 1. (a) 1210 = 11002 (b) 12310 = 0111 10112 (c) 6310 = 0011 11112 (d) 12810 = 1000 00002 (e) 100010 = 0011 1110 10002 2. (a)

More information

EEE3410 Microcontroller Applications Department of Electrical Engineering Lecture 4 The 8051 Architecture

EEE3410 Microcontroller Applications Department of Electrical Engineering Lecture 4 The 8051 Architecture Department of Electrical Engineering Lecture 4 The 8051 Architecture 1 In this Lecture Overview General physical & operational features Block diagram Pin assignments Logic symbol Hardware description Pin

More information

DHANALAKSHMI COLLEGE OF ENGINEERING, CHENNAI DEPARTMENT OF ELECTRICAL AND ELECTRONICS ENGINEERING. EE6008 Microcontroller based system design

DHANALAKSHMI COLLEGE OF ENGINEERING, CHENNAI DEPARTMENT OF ELECTRICAL AND ELECTRONICS ENGINEERING. EE6008 Microcontroller based system design Year: IV DHANALAKSHMI COLLEGE OF ENGINEERING, CHENNAI DEPARTMENT OF ELECTRICAL AND ELECTRONICS ENGINEERING EE6008 Microcontroller based system design Semester : VII UNIT I Introduction to PIC Microcontroller

More information

Chapter 6. Problems All programming problems should include design pseudo code either as a separate design document on embedded comments in the code.

Chapter 6. Problems All programming problems should include design pseudo code either as a separate design document on embedded comments in the code. Chapter 6. Problems All programming problems should include design pseudo code either as a separate design document on embedded comments in the code. 1S. Write an assembly code equivalent for the following

More information

Embedded Systems. PIC16F84A Sample Programs. Eng. Anis Nazer First Semester

Embedded Systems. PIC16F84A Sample Programs. Eng. Anis Nazer First Semester Embedded Systems PIC16F84A Sample Programs Eng. Anis Nazer First Semester 2017-2018 Development cycle (1) Write code (2) Assemble / compile (3) Simulate (4) Download to MCU (5) Test Inputs / Outputs PIC16F84A

More information

EECE.3170: Microprocessor Systems Design I Summer 2017 Homework 5 Solution

EECE.3170: Microprocessor Systems Design I Summer 2017 Homework 5 Solution For each of the following complex operations, write a sequence of PIC 16F1829 instructions that performs an equivalent operation. Assume that X, Y, and Z are 16-bit values split into individual bytes as

More information

ET355 Microprocessors Thursday 6:00 pm 10:20 pm

ET355 Microprocessors Thursday 6:00 pm 10:20 pm ITT Technical Institute ET355 Microprocessors Thursday 6:00 pm 10:20 pm Unit 4 Chapter 6, pp. 139-174 Chapter 7, pp. 181-188 Unit 4 Objectives Lecture: BCD Programming Examples of the 805x Microprocessor

More information

PIC Discussion. By Eng. Tamar Jomaa

PIC Discussion. By Eng. Tamar Jomaa PIC Discussion By Eng. Tamar Jomaa Chapter#2 Programming Microcontroller Using Assembly Language Quiz#1 : Time: 10 minutes Marks: 10 Fill in spaces: 1) PIC is abbreviation for 2) Microcontroller with..architecture

More information

Hi Hsiao-Lung Chan Dept Electrical Engineering Chang Gung University, Taiwan

Hi Hsiao-Lung Chan Dept Electrical Engineering Chang Gung University, Taiwan Bank Switching, Table, Macros & Modules Hi Hsiao-Lung Chan Dept Electrical Engineering Chang Gung University, Taiwan chanhl@mail.cgu.edu.twcgu PIC18 memory access up to 2 MB of program memory Inside the

More information

16.317: Microprocessor Systems Design I Spring 2015

16.317: Microprocessor Systems Design I Spring 2015 16.317: Microprocessor Systems Design I Spring 2015 Exam 2 Solution 1. (16 points, 4 points per part) Multiple choice For each of the multiple choice questions below, clearly indicate your response by

More information

Mod-5: PIC 18 Introduction 1. Module 5

Mod-5: PIC 18 Introduction 1. Module 5 Mod-5: PIC 18 Introduction 1 Module 5 Contents: Overview of PIC 18, memory organisation, CPU, registers, pipelining, instruction format, addressing modes, instruction set, interrupts, interrupt operation,

More information

ME 515 Mechatronics. A microprocessor

ME 515 Mechatronics. A microprocessor ME 515 Mechatronics Microcontroller Based Control of Mechanical Systems Asanga Ratnaweera Department of Faculty of Engineering University of Peradeniya Tel: 081239 (3627) Email: asangar@pdn.ac.lk A microprocessor

More information

APPLICATION NOTE 2361 Interfacing an SPI-Interface RTC with a PIC Microcontroller

APPLICATION NOTE 2361 Interfacing an SPI-Interface RTC with a PIC Microcontroller Maxim/Dallas > App Notes > REAL-TIME CLOCKS Keywords: DS1305, SPI, PIC, real time clock, RTC, spi interface, pic microcontroller Aug 20, 2003 APPLICATION NOTE 2361 Interfacing an SPI-Interface RTC with

More information

Week1. EEE305 Microcontroller Key Points

Week1. EEE305 Microcontroller Key Points Week1 Harvard Architecture Fig. 3.2 Separate Program store and Data (File) stores with separate Data and Address buses. Program store Has a 14-bit Data bus and 13-bit Address bus. Thus up to 2 13 (8K)

More information

Flow Charts and Assembler Programs

Flow Charts and Assembler Programs Flow Charts and Assembler Programs Flow Charts: A flow chart is a graphical way to display how a program works (i.e. the algorithm). The purpose of a flow chart is to make the program easier to understand.

More information

UNIVERSITY OF ULSTER UNIVERSITY EXAMINATIONS : 2001/2002. Semester 2. Year 2 MICROCONTROLLER SYSTEMS. Module Code: EEE305J2. Time allowed: 3 Hours

UNIVERSITY OF ULSTER UNIVERSITY EXAMINATIONS : 2001/2002. Semester 2. Year 2 MICROCONTROLLER SYSTEMS. Module Code: EEE305J2. Time allowed: 3 Hours UNIVERSITY OF ULSTER UNIVERSITY EXAMINATIONS : 2001/2002 Semester 2 Year 2 MICROCONTROLLER SYSTEMS Module Code: EEE305J2 Time allowed: 3 Hours Answer as many questions as you can. Not more than TWO questions

More information

APPLICATION NOTE Wire Communication with a Microchip PICmicro Microcontroller

APPLICATION NOTE Wire Communication with a Microchip PICmicro Microcontroller Maxim > App Notes > 1-Wire DEVICES BATTERY MANAGEMENT Keywords: 1-wire, PICmicro, Microchip PIC, 1-Wire communication, PIC microcontroller, PICmicro microcontroller, 1 wire communication, PICs, micros,

More information

ELEG3923 Microprocessor Ch.6 Arithmetic and Logics

ELEG3923 Microprocessor Ch.6 Arithmetic and Logics Department of Electrical Engineering University of Arkansas ELEG3923 Microprocessor Ch.6 Arithmetic and Logics Dr. Jingxian Wu wuj@uark.edu OUTLINE 2 Arithmetic instructions Signed number operations Logic

More information

DS2401 Silicon Serial Number

DS2401 Silicon Serial Number Silicon Serial Number www.maxim-ic.com FEATURES Upgrade and drop-in replacement for DS2400 Extended 2.8 to 6.0 voltage range Multiple s can reside on a common 1-Wire Net Unique, factory-lasered and tested

More information

UNIVERSITY OF ULSTER UNIVERSITY EXAMINATIONS : 2001/2002 RESIT. Year 2 MICROCONTROLLER SYSTEMS. Module Code: EEE305J1. Time allowed: 3 Hours

UNIVERSITY OF ULSTER UNIVERSITY EXAMINATIONS : 2001/2002 RESIT. Year 2 MICROCONTROLLER SYSTEMS. Module Code: EEE305J1. Time allowed: 3 Hours UNIVERSITY OF ULSTER UNIVERSITY EXAMINATIONS : 2001/2002 RESIT Year 2 MICROCONTROLLER SYSTEMS Module Code: EEE305J1 Time allowed: 3 Hours Answer as many questions as you can. Not more than TWO questions

More information

THE UNIVERSITY OF THE WEST INDIES

THE UNIVERSITY OF THE WEST INDIES THE UNIVERSITY OF THE WEST INDIES EXAMINATIONS OF MOCK 2004 Code and Name of Course: EE25M Introduction to Microprocessors Paper: Date and Time: Duration: Three Hours INSTRUCTIONS TO CANDIDATES: This paper

More information

NH-67, TRICHY MAIN ROAD, PULIYUR, C.F , KARUR DT. DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING COURSE MATERIAL

NH-67, TRICHY MAIN ROAD, PULIYUR, C.F , KARUR DT. DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING COURSE MATERIAL NH-67, TRICHY MAIN ROAD, PULIYUR, C.F. 639 114, KARUR DT. DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING COURSE MATERIAL Subject Name : Embedded System Class/Sem : BE (ECE) / VII Subject Code

More information

Mechatronics and Measurement. Lecturer:Dung-An Wang Lecture 6

Mechatronics and Measurement. Lecturer:Dung-An Wang Lecture 6 Mechatronics and Measurement Lecturer:Dung-An Wang Lecture 6 Lecture outline Reading:Ch7 of text Today s lecture: Microcontroller 2 7.1 MICROPROCESSORS Hardware solution: consists of a selection of specific

More information

DS1306. Serial Alarm Real Time Clock (RTC)

DS1306. Serial Alarm Real Time Clock (RTC) www.dalsemi.com FEATURES Real time clock counts seconds, minutes, hours, date of the month, month, day of the week, and year with leap year compensation valid up to 2100 96-byte nonvolatile RAM for data

More information

More (up a level)... Connecting the Nokia 3510i LCD to a Microchip PIC16F84 microcontroller

More (up a level)... Connecting the Nokia 3510i LCD to a Microchip PIC16F84 microcontroller 1 von 8 24.02.2010 21:53 More (up a level)... Connecting the Nokia 3510i LCD to a Microchip PIC16F84 microcontroller As with the FPGA board previously, the connections are made by soldering standard IDC

More information

PTK8756B 8 Bit Micro-controller Data Sheet

PTK8756B 8 Bit Micro-controller Data Sheet PTK8756B 8 Bit Micro-controller DEC 15, 2008 Ver1.1 普泰半導體股份有限公司 PORTEK Technology Corporation 公司地址 : 臺北縣新店市寶橋路 235 巷 120 號 4 樓 聯絡電話 : 886-2-89121055 傳真號碼 : 886-2-89121473 公司網址 : www.portek.com.tw Page1

More information

ECE Homework #3

ECE Homework #3 ECE 376 - Homework #3 Flow Charts, Binary Inputs, Binary Outputs (LEDs). Due Monday, January 29th The temperature sensor in your lab kits has the temperature-resistance relationship of R = 1000 exp 3965

More information

DS1302. Trickle Charge Timekeeping Chip FEATURES PIN ASSIGNMENT PIN DESCRIPTION

DS1302. Trickle Charge Timekeeping Chip FEATURES PIN ASSIGNMENT PIN DESCRIPTION DS132 Trickle Charge Timekeeping Chip FEATURES Real time clock counts seconds, minutes, hours, date of the month, month, day of the week, and year with leap year compensation valid up to 21 31 x 8 RAM

More information

ELEG3923 Microprocessor Ch.2 Assembly Language Programming

ELEG3923 Microprocessor Ch.2 Assembly Language Programming Department of Electrical Engineering University of Arkansas ELEG3923 Microprocessor Ch.2 Assembly Language Programming Dr. Jingxian Wu wuj@uark.edu OUTLINE 2 Inside 8051 Introduction to assembly programming

More information

8051 Overview and Instruction Set

8051 Overview and Instruction Set 8051 Overview and Instruction Set Curtis A. Nelson Engr 355 1 Microprocessors vs. Microcontrollers Microprocessors are single-chip CPUs used in microcomputers Microcontrollers and microprocessors are different

More information

EE 367 Introduction to Microprocessors Homework 6

EE 367 Introduction to Microprocessors Homework 6 EE 367 Introduction to Microprocessors Homework 6 Due Wednesday, March 13, 2019 Announcements: Midterm on March 27 th The exam will cover through Lecture notes, Part 6; Lab 3, Homework 6, and readings

More information

DS2401 Silicon Serial Number

DS2401 Silicon Serial Number Silicon Serial Number www.maxim-ic.com FEATURES Upgrade and drop-in replacement for DS2400 Extended 2.8 to 6.0 voltage range Multiple s can reside on a common 1-Wire Net Unique, factory-lasered and tested

More information

Chapter 13. PIC Family Microcontroller

Chapter 13. PIC Family Microcontroller Chapter 13 PIC Family Microcontroller Lesson 15 Instruction Set Most instructions execution Time One instruction cycle If XTAL frequency = 20 MHz, then instruction cycle time is 0.2 s or 200 ns (= 4/20

More information

CONNECT TO THE PIC. A Simple Development Board

CONNECT TO THE PIC. A Simple Development Board CONNECT TO THE PIC A Simple Development Board Ok, so you have now got your programmer, and you have a PIC or two. It is all very well knowing how to program the PIC in theory, but the real learning comes

More information

Fortune. Semiconductor Corporation 富晶半導體股份有限公司. 8-bit MCU with 1k program ROM, 64-byte RAM, 1 R2F module and 3 13 LCD driver. TD Rev. 1.

Fortune. Semiconductor Corporation 富晶半導體股份有限公司. 8-bit MCU with 1k program ROM, 64-byte RAM, 1 R2F module and 3 13 LCD driver. TD Rev. 1. Fortune 1 R2F module and 3 13 LCD driver. Data Sheet TD-0410001 Rev. 1.2 This manual contains new product information. Fortune reserves the rights to modify the product specification without further notice.

More information

Microcontroller. Instruction set of 8051

Microcontroller. Instruction set of 8051 UNIT 2: Addressing Modes and Operations: Introduction, Addressing modes, External data Moves, Code Memory, Read Only Data Moves / Indexed Addressing mode, PUSH and POP Opcodes, Data exchanges, Example

More information

Q1: Multiple choice / 20 Q2: Protected mode memory accesses. / 40 Q3: Reading PIC. / 40 assembly language TOTAL SCORE / 100

Q1: Multiple choice / 20 Q2: Protected mode memory accesses. / 40 Q3: Reading PIC. / 40 assembly language TOTAL SCORE / 100 16.317: Microprocessor-Based Systems I Fall 2012 Exam 2 November 7, 2012 Name: ID #: For this exam, you may use a calculator and one 8.5 x 11 double-sided page of notes. All other electronic devices (e.g.,

More information

FIFTH SEMESTER DIPLOMA EXAMINATION IN ENGINEERING/ TECHNOLOGY-MARCH 2014 EMBEDDED SYSTEMS (Common for CT,CM) [Time: 3 hours] (Maximum marks : 100)

FIFTH SEMESTER DIPLOMA EXAMINATION IN ENGINEERING/ TECHNOLOGY-MARCH 2014 EMBEDDED SYSTEMS (Common for CT,CM) [Time: 3 hours] (Maximum marks : 100) (Revision-10) FIFTH SEMESTER DIPLOMA EXAMINATION IN ENGINEERING/ TECHNOLOGY-MARCH 2014 EMBEDDED SYSTEMS (Common for CT,CM) [Time: 3 hours] (Maximum marks : 100) PART-A (Maximum marks : 10) I. Answer all

More information

ELEG3924 Microprocessor

ELEG3924 Microprocessor Department of Electrical Engineering University of Arkansas ELEG3924 Microprocessor Ch.2 Assembly Language Programming Dr. Jing Yang jingyang@uark.edu 1 OUTLINE Inside 8051 Introduction to assembly programming

More information

DS2405. Addressable Switch PIN ASSIGNMENT

DS2405. Addressable Switch PIN ASSIGNMENT www.maxim-ic.com FEATURES Open-drain PIO pin is controlled by matching 64-bit, laser-engraved registration number associated with each device Logic level of open drain output can be determined over 1-Wire

More information

e-pg Pathshala Subject : Computer Science Paper: Embedded System Module: 8051 Architecture Module No: CS/ES/5 Quadrant 1 e-text

e-pg Pathshala Subject : Computer Science Paper: Embedded System Module: 8051 Architecture Module No: CS/ES/5 Quadrant 1 e-text e-pg Pathshala Subject : Computer Science Paper: Embedded System Module: 8051 Architecture Module No: CS/ES/5 Quadrant 1 e-text In this lecture the detailed architecture of 8051 controller, register bank,

More information

ME 6405 Introduction to Mechatronics

ME 6405 Introduction to Mechatronics ME 6405 Introduction to Mechatronics Fall 2006 Instructor: Professor Charles Ume Microchip PIC Manufacturer Information: Company: Website: http://www.microchip.com Reasons for success: Became the hobbyist's

More information

Digital Arithmetic. Digital Arithmetic: Operations and Circuits Dr. Farahmand

Digital Arithmetic. Digital Arithmetic: Operations and Circuits Dr. Farahmand Digital Arithmetic Digital Arithmetic: Operations and Circuits Dr. Farahmand Binary Arithmetic Digital circuits are frequently used for arithmetic operations Fundamental arithmetic operations on binary

More information

PIC18F452 Timer adjustment

PIC18F452 Timer adjustment PIC18F452 Wilfrid Laurier University January 23, 2018 PIC18F452 Here s a code fragment for the timer: PIC18F452 Here s a code fragment for the timer: t i m e a d j equ d 65536 d 25000 +d 12 +2 movff TMR0L,

More information

TUTORIAL Assembly Language programming (2)

TUTORIAL Assembly Language programming (2) 8051 Assembly Language programming (2) TUTORIAL 4 EEE3410 Microcontroller Applications 1. Write the instructions to move value 34h into register A and value 3Fh into register B, then add them together.

More information

DS2401. Silicon Serial Number FEATURES PIN ASSIGNMENT

DS2401. Silicon Serial Number FEATURES PIN ASSIGNMENT Silicon Serial umber FEATURES Upgrade and drop in replacement for DS2400 Extended 2.8 to 6.0 voltage range Multiple s can reside on a common 1 Wire TM bus Unique, factory lasered and tested 64 bit registration

More information

Principle and Interface Techniques of Microcontroller

Principle and Interface Techniques of Microcontroller Principle and Interface Techniques of Microcontroller --8051 Microcontroller and Embedded Systems Using Assembly and C LI, Guang ( 李光 ) Prof. PhD, DIC, MIET WANG, You ( 王酉 ) PhD, MIET 杭州 浙江大学 2011 Chapter

More information

PIC16F84A 7.0 INSTRUCTION SET SUMMARY INSTRUCTIONS DESCRIPTIONS

PIC16F84A 7.0 INSTRUCTION SET SUMMARY INSTRUCTIONS DESCRIPTIONS PI6F84A 7.0 INSTRUTION SET SUMMARY Each PI6XX instruction is a 4bit word, divided into an OPODE which specifies the instruction type and one or more operands which further specify the operation of the

More information

DS1305. Serial Alarm Real Time Clock (RTC) FEATURES PIN ASSIGNMENT ORDERING INFORMATION

DS1305. Serial Alarm Real Time Clock (RTC) FEATURES PIN ASSIGNMENT ORDERING INFORMATION DS135 Serial Alarm Real Time Clock (RTC) FEATURES Real time clock counts seconds, minutes, hours, date of the month, month, day of the week, and year with leap year compensation valid up to 21 96 byte

More information

Microcontroller systems Lec 2 PIC18LF8722 Microcontroller s s core

Microcontroller systems Lec 2 PIC18LF8722 Microcontroller s s core TKT-3500 Microcontroller systems Lec 2 PIC18LF8722 Microcontroller s s core Erno Salminen Copyright notice Some figures by Robert Reese, from supplementary CD of the course book from PIC18F8722 Family

More information

C and Embedded Systems. So Why Learn Assembly Language? C Compilation. PICC Lite C Compiler. PICC Lite C Optimization Results (Lab #13)

C and Embedded Systems. So Why Learn Assembly Language? C Compilation. PICC Lite C Compiler. PICC Lite C Optimization Results (Lab #13) C and Embedded Systems A µp-based system used in a device (i.e, a car engine) performing control and monitoring functions is referred to as an embedded system. The embedded system is invisible to the user

More information

/ 28 HLL assembly Q4: Conditional instructions / 40 TOTAL SCORE / 100 EXTRA CREDIT / 10

/ 28 HLL assembly Q4: Conditional instructions / 40 TOTAL SCORE / 100 EXTRA CREDIT / 10 16.317: Microprocessor Systems Design I Fall 2014 Exam 2 November 5, 2014 Name: ID #: For this exam, you may use a calculator and one 8.5 x 11 double-sided page of notes. All other electronic devices (e.g.,

More information

SOLAR TRACKING SYSTEM USING PIC16F84A STEPPER MOTOR AND 555TIMER

SOLAR TRACKING SYSTEM USING PIC16F84A STEPPER MOTOR AND 555TIMER SOLAR TRACKING SYSTEM USING PIC16F84A STEPPER MOTOR AND 555TIMER Amey Arvind Madgaonkar 1, Sumit Dhere 2 & Rupesh Ratnakar Kadam 3 1. Block diagram International Journal of Latest Trends in Engineering

More information

DS2430A 256-Bit 1-Wire EEPROM

DS2430A 256-Bit 1-Wire EEPROM 256-Bit 1-Wire EEPROM www.maxim-ic.com FEATURES 256-bit Electrically Erasable Programmable Read Only Memory (EEPROM) plus 64-bit one-time programmable application register Unique, factory-lasered and tested

More information

BINARY SYSTEM. Binary system is used in digital systems because it is:

BINARY SYSTEM. Binary system is used in digital systems because it is: CHAPTER 2 CHAPTER CONTENTS 2.1 Binary System 2.2 Binary Arithmetic Operation 2.3 Signed & Unsigned Numbers 2.4 Arithmetic Operations of Signed Numbers 2.5 Hexadecimal Number System 2.6 Octal Number System

More information

Lecture Topics. Announcements. Today: Integer Arithmetic (P&H ) Next: continued. Consulting hours. Introduction to Sim. Milestone #1 (due 1/26)

Lecture Topics. Announcements. Today: Integer Arithmetic (P&H ) Next: continued. Consulting hours. Introduction to Sim. Milestone #1 (due 1/26) Lecture Topics Today: Integer Arithmetic (P&H 3.1-3.4) Next: continued 1 Announcements Consulting hours Introduction to Sim Milestone #1 (due 1/26) 2 1 Overview: Integer Operations Internal representation

More information

DS1305 Serial Alarm Real Time Clock (RTC)

DS1305 Serial Alarm Real Time Clock (RTC) Serial Alarm Real Time Clock (RTC) www.dalsemi.com FEATURES Real time clock counts seconds, minutes, hours, date of the month, month, day of the week, and year with leap year compensation valid up to 2100

More information

ME 475 Lab2 Introduction of PIC and Programming. Instructor: Zhen Wang

ME 475 Lab2 Introduction of PIC and Programming. Instructor: Zhen Wang ME 475 Lab2 Introduction of PIC and Programming Instructor: Zhen Wang 2013.1.25 Outline Lecture Introduction of PIC microcontroller Programming cycle Read CH5 Programming guidelines Read CH6 Sample program

More information

Controller Provides Display of Monitored Process Deviation

Controller Provides Display of Monitored Process Deviation Controller Provides Display of Monitored Process Deviation The gadget, shown in Figure 1.0, is implemented with a controller based process which continuously monitors two, discrete, momentary switch inputs

More information

8051 Programming: Arithmetic and Logic

8051 Programming: Arithmetic and Logic 8051 Programming: Arithmetic and Logic EE4380 Fall 2002 Class 4 Pari vallal Kannan Center for Integrated Circuits and Systems University of Texas at Dallas Topics Signed and Unsigned arithmetic Binary

More information

8051 Microcontrollers

8051 Microcontrollers 8051 Microcontrollers Richa Upadhyay Prabhu NMIMS s MPSTME richa.upadhyay@nmims.edu March 8, 2016 Controller vs Processor Controller vs Processor Introduction to 8051 Micro-controller In 1981,Intel corporation

More information

Chapter 2 Number System

Chapter 2 Number System Chapter 2 Number System Embedded Systems with ARM Cortext-M Updated: Tuesday, January 16, 2018 What you should know.. Before coming to this class Decimal Binary Octal Hex 0 0000 00 0x0 1 0001 01 0x1 2

More information

Assembly Language Design

Assembly Language Design Assembly Language Design Instruction Set 1. Data Movement 2. Arithmetic 3. Logical 4. Conversion 5. Program Control 6. System Control Syntax & System Characteristics 1. Assembly Directives 2. Constants

More information

DS1306 Serial Alarm Real-Time Clock

DS1306 Serial Alarm Real-Time Clock Serial Alarm Real-Time Clock www.maxim-ic.com FEATURES Real-Time Clock (RTC) Counts Seconds, Minutes, Hours, Date of the Month, Month, Day of the Week, and Year with Leap-Year Compensation Valid Up to

More information

Programming of 8085 microprocessor and 8051 micro controller Study material

Programming of 8085 microprocessor and 8051 micro controller Study material 8085 Demo Programs Now, let us take a look at some program demonstrations using the above instructions Adding Two 8-bit Numbers Write a program to add data at 3005H & 3006H memory location and store the

More information

DS2223/DS2224. EconoRAM FEATURES PACKAGE OUTLINE. PIN CONNECTIONS Pin 1 GND Ground Pin 2 DQ Data In/Out Pin 3 V CC Supply Pin 4 GND Ground

DS2223/DS2224. EconoRAM FEATURES PACKAGE OUTLINE. PIN CONNECTIONS Pin 1 GND Ground Pin 2 DQ Data In/Out Pin 3 V CC Supply Pin 4 GND Ground DS2223/DS2224 EconoRAM FEATURES Low cost, general purpose, 256 bit memory DS2223 has 256 bit SRAM DS2224 has 32 bit ROM, 224 bit SRAM Reduces control, address and data interface to a single pin PACKAGE

More information

Micro II and Embedded Systems

Micro II and Embedded Systems 16.480/552 Micro II and Embedded Systems Introduction to PIC Microcontroller Revised based on slides from WPI ECE2801 Moving Towards Embedded Hardware Typical components of a PC: x86 family microprocessor

More information

8051 Microcontrollers

8051 Microcontrollers 8051 Microcontrollers Richa Upadhyay Prabhu NMIMS s MPSTME richa.upadhyay@nmims.edu March 15, 2016 8051 INSTRUCTIONS JUMP, LOOP AND CALL INSTRUCTIONS 8051 INSTRUCTIONS Repeating a sequence of instructions

More information

Dept. of Computer Engineering Final Exam, First Semester: 2016/2017

Dept. of Computer Engineering Final Exam, First Semester: 2016/2017 Philadelphia University Faculty of Engineering Course Title: Embedded Systems (630414) Instructor: Eng. Anis Nazer Dept. of Computer Engineering Final Exam, First Semester: 2016/2017 Student Name: Student

More information