Variations on a Theme

Size: px
Start display at page:

Download "Variations on a Theme"

Transcription

1 Variations on a Theme Shlomo Engelberg December 27, Chapter 6 of ADuC841 Microcontroller Design Manual: From Microcontroller Theory to Design Projects No variations in this chapter are planned for this year. Shlomo Engelberg is with the Electronics Department, Jerusalem College of Technology, P.O.B , Jerusalem, Israel 1

2 2 Chapter 8 There are no changes to Part I of the lab. In the second part, there are several additions and changes. 1. You must structure the delay as a subroutine. When you need a delay, CALL the subroutine, and when you get to the end of the delay subroutine, remember to RETurn from it. 2. Instead of using DJNZ Ri as was done in the first lab, use DJNZ direct in the main delay loop. Note that this changes the timing slightly. Reserve memory locations in the data memory by using the DSEG and DS directives. Make sure to give your variables meaningful names. 3. The clock frequency, 11,059,200 Hz, can be written as 11, 059, 200 = This means that in order to delay by 10 ms one needs to wait ticks. As performing DJNZ direct takes four ticks, if one performs this command times, that should take 10 ms. Write a procedure that delays 10 ms by having an inner loop that performs DJNZ direct 256 = 2 8 times and an outer loop that causes the inner loop to repeat = 108 times. Write a second procedure that calls the first one and causes a delay of N 10 ms for N = 1,..., 255. The second procedure is the one that you CALL from your main program, and initially, N = 20 and the delay is 200 ms. 4. After getting the program to work nicely with a delay of 200 ms, change the value of N and determine the smallest delay that consistently prevents bounce. (This may differ from board to board, so you and your neighbor may well arrive at different conclusions.) Include the minimum delay in a comment to your program. Additionally, please keep the interrupt subroutine short. 2

3 3 Chapter 9 Write a program that causes the LED to toogle each time a Timer 0 interrupt occurs. Using the EQU directive, define a constant, START FROM, that gives the initial value to be saved in TH0. Set the constant equal to 225. Each time the Timer 0 interrupt subroutine (ISR) is reached, check the value of TH0. (You may want to use the accumulator and the JZ command for this purpose.) If TH0 is zero, then reload TH0 with START FROM. Otherwise, DECrement the value of TH0. This program causes a Timer 0 interrupt to occur after START FROM ticks, then after START FROM + 1 ticks,..., 256 ticks, and then the time between calls to the ISR returns to START FROM ticks, and the pattern repeats. When you view the output on an oscilloscope, you will see an interesting looking wave form. What should the period of the waveform be when START FROM = 225? Keep the ISRs short, and use the EQU directive to give meaningful names to the constants you use. 3

4 4 Chapter 10 In this chapter, you explore the IDE. You write a program and use the IDE to analyze and debug it before downloading it to the development kit. Over the course of the semester, you ll see that the IDE is a wonderful tool and that proper use of the debugger can save you hours of work. Write a program that causes the LED to blink either once each second or once each half second. Have the LED blink once each half second initially, and have the period change each time the switch connected to P3.2 is pressed. (Make use of code from the program of Chapter 8 to debounce the switch.) The period of the square wave must be controlled by Timer 0, and the duty cycle of the squarewave output to the LED, to P3.4, must be 50%. Recall that 11, 059, 200 = and that this many ticks take our crystal one second. Half of this number or a quarter of this number can obviously be factored (in many ways) into three numbers between 0 and 256. This makes it simple to use the timer interrupt and two additional nested loops (in the interrupt subroutine) to delay (very nearly exactly) half a second or a quarter of a second between the times at which P3.4 is toggled. (When I performed this exercise, I used a reload value of 0 for Timer 0. This lead to the Timer 0 interrupt being asserted every 256 = 2 8 ticks. ) As with your previous program, make sure to keep the interrupt subroutines reasonably short and the names used meaningful. Before downloading the program to the ADuC841, use the IDE s debugger to examine the program. You must make use of breakpoints the logic analyzer window the I/O Ports tab in the Peripherals menu, and watchlists when performing this examination. (This is overkill in this case, but it is very important that you become familiar with the IDE and its capabilities.) After downloading the program to the ADuC841, use a scope to see how nearly the measured periods of the actual output agree with the values shown by the IDE. Include a comment in your program that compares what the IDE reported and what you measured. 4

5 5 Chapter 11 In this lab, you control the period of a square wave by using the UART. The program you write should be a modified version of the program you wrote for the previous lab. Write a program that outputs a square wave whose period is initially 1/8 s and whose period can then be chosen to be either 1/4 s or 1/8 s. Use Timer 0 as the square wave s clock, and use Timer 1 to set the baud rate of the UART to 19,200 b/s. (Consider using Excel or a similar program to calculate any reload values you need.) When the user sends an s to the ADuC841, have the processor respond by transmitting a S to the user and by starting to output the slow square wave. When the user sends an f, have the processor respond with an F and by starting to output the fast square wave. 1. You must test your program using the IDE s debugger before running your program on the ADuC You must use an oscilloscope to observe the signals output by the ADuC841 that correspond to F and the S. Use the scope in normal mode where it waits for a trigger event before displaying anything. Set the trigger to check when the signal drops below, say, 2.5 V. Connect the scope to P3.1 which is the pin the UART transmits from. Note that the ADuC841 transmits the least significant bit of the value in SBUF first. Thus, when the ADuC841 transmits an F = 46H = B in ASCII, it transmits a 0 the start bit. Then it transmits a second zero. Then two ones. Then three zeros. Then a single one. Then a single zero, and then it transmits a one the stop bit. As the UART is running at 19,200 cps, each bit is about 50 µs long. 5

6 6 Chapter 13 The instructions here replace those of the text. Write a program that causes Timer 3 to be the UART s clock, and set the baud rate to 115,200 bits/s. Use Excel (or MATLAB or a similar program) to calculate the necessary values of DIV and T3FD. Make sure that the spreadsheet or program you write is sufficienly general that you can use it to calculate values of DIV and T3FD for baud rates other than 115,200 bits/s. Have the ADuC841 send strings in two cases: 1. Whenerver a T is received by the UART, have the ADuC841 transmit a string. 2. When both external interrupt zero and external interrupt one have been triggered have the UART transmit a message indicating that this has happened. In order to perform the second task, you may want to proceed as follows. 1. Enable both external interrupt zero and external interrupt one and set them both to be edge triggered. (External interrupt one is very similar to external interrupt zero. It is associated with P3.3, its interrupt subroutine starts at 13H, its enable bit is EX1, and the bit that controls whether it is edge or level triggered is IT1.) 2. When either of the two interrupts is triggered, have it raise a userdefined flag. (You will need two flags, of course.) 3. Have the main program check to see if both flags have been raised. 4. When both flags have been raised, have the UART send out a message to that effect and have the ADuC841 lower the user-defined flags. After debugging your program using the IDE, download it and run it on the ADuC841. When your program is working properly, save it. Next, calculate values of DIV and T3FD that cause the baud rate to be 2%, 4%, and 6% too high. Run the program with each value without changing the values used by Hyper- Terminal. For which values does the computer still succeed in communicating with the ADuC841 via its UART? (Include the answer in a comment to your program.) 6

7 7 Chapter First Part This part of the experiment replaces the experiment in the course text. Using Timer 3, set the UART to operate at a baud rate of 57,600 bits/s. Each time a V is received by the UART, have the ADuC841 check the voltage on P3.2 and transmit a string to the user stating the current voltage. (Use the JB or JNB commands to check the voltage.) Each time an S is received by the UART, have the ADuC841 check the status of the internal switch associated with P3.2 and trasmit a string giving the position of the switch at the time the examination was performed. (Use the JBC command to examine the status of the switch. ) Each time an O is received, have the ADuC841 open the switch associated with P3.2 and transmit a message that states that the switch has been opened. 7.2 Second Part The goal of this additional lab is to let you see the internal structure of an I/O pin. Throughout this part of the lab, make sure that pins 0.0 and 3.1 are shorted to one another. Start by setting both P0.0 and P3.1. Cause Timer 0 to work in mode 1 (16-bit mode), and have it trigger an interrupt every 2 16 clock cycles. (How does this simplify the programming?) Each time an interrupt occurs, have the ADuC841 check to see if P3.2 is set. If it is, set P0.0 and toggle P3.1. If P3.2 is cleared, then set P3.1 and toggle P0.0. Each method produces a square wave whose period is 2 17 clock cycles. However, when you look at the 0 V to 5 V transitions using an osciloscope, you find that they are quite different. Describe the differences you see in a comment added to your program, and include screenshots of the transitions that demonstrate the differences with your carefully commented program. 7

8 8 Chapter The Experiment This experiment replaces the experiment described in the book. Build a simple PWM DAC whose output is controlled by the UART. Have your DAC output one full period every 1 ms. Have this period broken into one hundered slots of 10 µs each, and have the ADuC841 clear P3.4 for 0 to 99 of those slots (so that the LED will be on during those slots). (The DAC will never clear P3.4 for a whole period. It will always be set for at least 10 µs in each period.) Use Timer 0 to produce a tick every 10 µs and have one hundred ticks be one full cycle. Use Timer 1 to cause the UART to run at 19,200 bits/s. Have the user input a number from 00 to 99, and have the ADuC841 convert the received ASCII values into the appropriate number between 0 and 99. Have the ADuC841 clear P3.4 (and, in that way, turn on the LED) for that number of slots in each hundred slots. You now have a simple DAC. 8.2 Some Remarks about Inputting a Two-Digit Number In order to enter a two-digit number, you may want to define a flag that indicates whether you are currently expecting the tens digit or the ones digit to be input. Whenever the UART receives a digit, the first thing you ll probably want to do is update the flag. Then you ll want to subtract off the ASCII value of zero from the digit. (After the subtraction, the accumulator will hold the value of the digit you re are interested in.) You can use the SUBB command to perform the subtraction. Remember that SUBB uses the carry bit, so make sure to CLR the carry bit before subtracting. Also, if you use the carry bit elsewhere in the program, make sure to save the carry bit (by saving the processor status word (PSW) in which it is located). When the tens digit is entered, you will want to multiply the value of the digit by ten. The easiest way to do this is to use the 8051 s MUL AB command. 8.3 Some Additional Instructions Observe the output of P3.4 on a scope and notice how the brightness of the onboard LED changes as you enter different numbers. Make sure to keep all ISRs short and to use meaningful names where possible. 8

9 9 Chapter General Description In this experiment, you cause DAC 0 to output a cosine at a frequency of (approximately) 1 khz. You use the DAC in 8-bit mode. You will not calculate the values of the cosine in real time; you will read them from a table. (The table, in a format that can be included in your.asm file, can be found at The MATLAB code that generated the file can be found at Additionally, you use the UART (being clocked by Timer 1 to run at a rate of 19,200 bits/s) to control the number of bits of the cosine to be masked. The user transmits a number between 0 and 7 using the UART, and the value output to the DAC is the sample value anded with a mask that masks the number of bits transmitted by the user. (In this lab, masking zero bits means not changing anything. Masking four bits means anding the sample with B.) 9.2 Outputting the Cosine In the cosine table, the cosine is stored in 256 contiguous bytes. To read them, it is probably simplest to point DPTR at the address of the first element of the table and to keep track of the current element within the table. When using the MOVC command, A will initially hold the location of the current sample within the array. Thus, DPTR s value will not change, but the initial value of A will change each time. Note that if you store the current position in DSEG, then if you use the INC command to update the position, when you get to the last element in the table, element 255 (where the first element is, of course, element 0), performing one more INC will cause the value of current position to be zero which is just what you d like to have happen. 9.3 Masking the Sample Values One way to simplify the calculation of the eight possible masks is to create an array of masks in DSEG (for example, by writing XXXX: DS 8) in which you ll store the necessary masks (using the MOV command) and then to choose the element of the array to use as the mask by examining the number the ADuC841 received via the UART. 9

10 9.4 Additional Instructions When the program is working properly, use you scopes in MATH mode to look at the DFT, the spectrum, of the output of the DAC. Note that when you mask many bits, there is a lot of energy at harmonics of the frequency being output by the DAC. Add a comment to your program indicating what you saw when viewing the spectrum of the output of the DAC. (Describe the amount of energy in the higher harmonics as a function of the number of bits being masked.) 10

11 10 Chapter 21 When performing this experiment, let T = 0.1 ms and τ = 0.3 ms. Use the Timer 2 conversion mode to set the sampling rate, and run the DAC in 8-bit mode, and have the DAC s output be voltages between 0 V and V ref. While performing this lab, you will need to shift bits around. You may find the commands SWAP and RRC helpful. Note that you can divide a number by four by shifting it to the right twice, and you can calculate three quarters of a number by adding half the number to a quarter of the number. 11

Digital Blocks Semiconductor IP

Digital Blocks Semiconductor IP Digital Blocks Semiconductor IP 805 Microcontroller General Description The Digital Blocks Microcontroller Verilog IP Core is complaint with the MCS 5 Instruction Set and contains standard 805 MCU peripherals,

More information

UNIT 2 THE 8051 INSTRUCTION SET AND PROGRAMMING

UNIT 2 THE 8051 INSTRUCTION SET AND PROGRAMMING UNIT 2 THE 8051 INSTRUCTION SET AND PROGRAMMING Instructions Alphabetical List of Instructions ACALL: Absolute Call ADD, ADDC: Add Accumulator (With Carry) AJMP: Absolute Jump ANL: Bitwise AND CJNE: Compare

More information

Digital Blocks Semiconductor IP

Digital Blocks Semiconductor IP 805 SFR Bus Digital Blocks Semiconductor IP 805 Microcontroller Configurable Peripherals General Description The Digital Blocks (Configurable Peripherals) Microcontroller Verilog IP Core is complaint with

More information

Microcontroller and Embedded Systems:

Microcontroller and Embedded Systems: Microcontroller and Embedded Systems: Branches: 1. Electronics & Telecommunication Engineering 2. Electrical & Electronics Engineering Semester: 6 th Semester / 7 th Semester 1. Explain the differences

More information

UNIT THE 8051 INSTRUCTION SET AND PROGRAMMING

UNIT THE 8051 INSTRUCTION SET AND PROGRAMMING UNIT THE 8051 INSTRUCTION SET AND PROGRAMMING Instructions Alphabetical List of Instructions ACALL: Absolute Call ADD, ADDC: Add Accumulator (With Carry) AJMP: Absolute Jump ANL: Bitwise AND CJNE: Compare

More information

MCS-51 Serial Port A T 8 9 C 5 2 1

MCS-51 Serial Port A T 8 9 C 5 2 1 MCS-51 Serial Port AT89C52 1 Introduction to Serial Communications Serial vs. Parallel transfer of data Simplex, Duplex and half-duplex modes Synchronous, Asynchronous UART Universal Asynchronous Receiver/Transmitter.

More information

Digital Blocks Semiconductor IP

Digital Blocks Semiconductor IP Digital Blocks Semiconductor IP DB805C-FSM 805 Microcontroller FSM Finite State Machine General Description The Digital Blocks DB805C-FSM IP Core contains Digital Blocks compact DB805C CPU Core & GPIO

More information

Microprocessors 1. The 8051 Instruction Set. Microprocessors 1 1. Msc. Ivan A. Escobar Broitman

Microprocessors 1. The 8051 Instruction Set. Microprocessors 1 1. Msc. Ivan A. Escobar Broitman Microprocessors 1 The 8051 Instruction Set Microprocessors 1 1 Instruction Groups The 8051 has 255 instructions Every 8-bit opcode from 00 to FF is used except for A5. The instructions are grouped into

More information

Microcontroller Intel [Instruction Set]

Microcontroller Intel [Instruction Set] Microcontroller Intel 8051 [Instruction Set] Structure of Assembly Language [ label: ] mnemonic [operands] [ ;comment ] Example: MOV R1, #25H ; load data 25H into R1 2 8051 Assembly Language Registers

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

Contents 8051 Instruction Set BY D. BALAKRISHNA, Research Assistant, IIIT-H Chapter I : Control Transfer Instructions Lesson (a): Loop Lesson (b): Jump (i) Conditional Lesson (c): Lesson (d): Lesson (e):

More information

Interrupt Programming: Interrupts vs. Polling Method:

Interrupt Programming: Interrupts vs. Polling Method: UNIT 4: INTERRUPT PROGRAMMING & SERIAL COMMUNICATION WITH 8051: Definition of an interrupt, types of interrupts, Timers and Counter programming with interrupts in assembly. 8051 Serial Communication: Data

More information

MICROCONTROLLER AND PLC LAB-436 SEMESTER-5

MICROCONTROLLER AND PLC LAB-436 SEMESTER-5 MICROCONTROLLER AND PLC LAB-436 SEMESTER-5 Exp:1 STUDY OF MICROCONTROLLER 8051 To study the microcontroller and familiarize the 8051microcontroller kit Theory:- A Microcontroller consists of a powerful

More information

Department of Electronics and Instrumentation Engineering Question Bank

Department of Electronics and Instrumentation Engineering Question Bank www.examquestionpaper.in Department of Electronics and Instrumentation Engineering Question Bank SUBJECT CODE / NAME: ET7102 / MICROCONTROLLER BASED SYSTEM DESIGN BRANCH : M.E. (C&I) YEAR / SEM : I / I

More information

~: Simple Programs in 8051 assembly language :~

~: Simple Programs in 8051 assembly language :~ ~: Simple Programs in 8051 assembly language :~ Here some simple programs of 8051 are given to understand the operation of different instructions and to understand the logic behind particular program.

More information

Architecture & Instruction set of 8085 Microprocessor and 8051 Micro Controller

Architecture & Instruction set of 8085 Microprocessor and 8051 Micro Controller of 8085 microprocessor 8085 is pronounced as "eighty-eighty-five" microprocessor. It is an 8-bit microprocessor designed by Intel in 1977 using NMOS technology. It has the following configuration 8-bit

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

Microprocessors and Microcontrollers (EE-231)

Microprocessors and Microcontrollers (EE-231) Microprocessors and Microcontrollers (EE-231) Objective Interrupts Programming in C In Proteus On 8051 development board Interrupt An interrupt is an external or internal event that interrupts the microcontroller

More information

Q. Classify the instruction set of 8051 and list out the instructions in each type.

Q. Classify the instruction set of 8051 and list out the instructions in each type. INTRODUCTION Here is a list of the operands and their meanings: A - accumulator; Rn - is one of working registers (R0-R7) in the currently active RAM memory bank; Direct - is any 8-bit address register

More information

Highlights. FP51 (FPGA based 1T 8051 core)

Highlights. FP51 (FPGA based 1T 8051 core) Copyright 2017 PulseRain Technology, LLC. FP51 (FPGA based 1T 8051 core) 10555 Scripps Trl, San Diego, CA 92131 858-877-3485 858-408-9550 http://www.pulserain.com Highlights 1T 8051 Core Intel MCS-51 Compatible

More information

CoE3DJ4 Digital Systems Design. Chapter 5: Serial Port Operation

CoE3DJ4 Digital Systems Design. Chapter 5: Serial Port Operation CoE3DJ4 Digital Systems Design Chapter 5: Serial Port Operation Serial port 8051 includes an on-chip serial port Hardware access to the port is through TXD and RXD (Port 3 bits 1 and 0) Serial port is

More information

Vidyalankar T.E. Sem. V [ETRX] Microprocessors and Microcontrollers I Prelim Question Paper Solution

Vidyalankar T.E. Sem. V [ETRX] Microprocessors and Microcontrollers I Prelim Question Paper Solution 1. (a) 1. (b) T.E. Sem. V [ETRX] Microprocessors and Microcontrollers I Prelim Question Paper Solution Priority modes. 1) Fully Nested Mode : It is a general purpose mode. IR 0 highest priority IR 1 lowest

More information

Microcontroller & Interfacing

Microcontroller & Interfacing Course Title Course Code Microcontroller & Interfacing EC406 Lecture : 3 Course Credit Practical : 1 Tutorial : 0 Total : 4 Course Objective At the end of the course the students will be able to Understand

More information

Instruction Set Of 8051

Instruction Set Of 8051 Instruction Set Of 8051 By Darshan Patel M.Tech (Power Electronics & Drives) Assistant Professor, Electrical Department Sankalchand Patel college of Engineering-Visnagar Introduction The process of writing

More information

Programming Book Microcontroller Kit. Rev 3.0 January, Wichit Sirichote

Programming Book Microcontroller Kit. Rev 3.0 January, Wichit Sirichote Programming Book1 8051 Microcontroller Kit Rev 3.0 January, 016 016 Wichit Sirichote 1 Contents Overview...3 SAFTY INFORMATION...3 Tools...3 Experiment 1 Blinking LED...4 Experiment Binary number counting...9

More information

Contents. Join the Technical Community Today!

Contents. Join the Technical Community Today! Contents CHAPTER 1: INTRODUCTION... 5 1. WELCOME... 5 1.2 PS 8051 BOARD OVERVIEW... 6 1.3 PS 8051 SPECIFICATIONS... 7 CHAPTER 2: SYSTEM DESCRIPTION... 9 2.1 HARDWARE... 9 2.2 MAPPING OF DEVICES... 11 2.2.1

More information

Serial I-O for Dinesh K. Sharma Electrical Engineering Department I.I.T. Bombay Mumbai (version 14/10/07)

Serial I-O for Dinesh K. Sharma Electrical Engineering Department I.I.T. Bombay Mumbai (version 14/10/07) Serial I-O for 8051 Dinesh K. Sharma Electrical Engineering Department I.I.T. Bombay Mumbai 400 076 (version 14/10/07) 1 Motivation Serial communications means sending data a single bit at a time. But

More information

8051 Serial Communication

8051 Serial Communication 8051 Serial Communication Basics of serial communication Parallel: transfers eight bits of data simultaneously over eight data lines expensive - short distance fast Serial : one bit at a time is transferred

More information

SN8F5000 Family Instruction Set

SN8F5000 Family Instruction Set SONiX Technology Co., Ltd. 8051-based Microcontroller 1 Overview SN8F5000 is 8051 Flash Type microcontroller supports comprehensive assembly instructions and which are fully compatible with standard 8051.

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

8051 Microcontroller

8051 Microcontroller 8051 Microcontroller EE4380 Fall 2001 Pari vallal Kannan Center for Integrated Circuits and Systems University of Texas at Dallas 8051 Architecture Programmer s View Register Set Instruction Set Memory

More information

CPEG300 Embedded System Design. Lecture 8 Timer

CPEG300 Embedded System Design. Lecture 8 Timer CPEG300 Embedded System Design Lecture 8 Timer Hamad Bin Khalifa University, Spring 2018 Review 8051 port and port schematic Internal read/write data path Serial communication vs. parallel communication

More information

Embedded Controller Programming

Embedded Controller Programming Embedded Controller Programming Counters, Timers and I/O in Assembly Language Ken Arnold Copyright 2000-2004 Ken Arnold 1 Outline Timer/Counters Serial Port More 8051 Instructions Examples Copyright 2000-2004

More information

Application Brief D-005

Application Brief D-005 Interfacing the Avago HDSP-2xxx LED Alphanumeric Displays with the Intel 8751H Microcontroller Application Brief D-005 Introduction The HDSP-21xx/-25xx series of products is ideal for applications where

More information

EE6502- MICROPROCESSOR AND MICROCONTROLLER

EE6502- MICROPROCESSOR AND MICROCONTROLLER . EE6502- MICROPROCESSOR AND MICROCONTROLLER UNIT III - 8051 MICROCONTROLLER PART - A 1. What is Microcontroller? A device which contains the microprocessor with integrated peripherals like memory, serial

More information

CHAPTER 11 INTERRUPTS PROGRAMMING

CHAPTER 11 INTERRUPTS PROGRAMMING CHAPTER 11 INTERRUPTS PROGRAMMING Interrupts vs. Polling An interrupt is an external or internal event that interrupts the microcontroller To inform it that a device needs its service A single microcontroller

More information

FACULTY OF ENGINEERING LAB SHEET

FACULTY OF ENGINEERING LAB SHEET FACULTY OF ENGINEERING LAB SHEET MICROCONTROLLER AND MICROPROCESSOR SYSTEMS ECE2216 TRIMESTER 1 (2017/2018) MP2: Construction and programming of a basic electronic piano *Note: On-the-spot evaluation may

More information

80C451 operation of port 6

80C451 operation of port 6 INTRODUCTION The features of the are shared with the 80C5 or are conventional except for the operation of port 6. The flexibility of this port facilitates high-speed parallel data communications. This

More information

Timers and interrupts

Timers and interrupts Timers and interrupts CSCI 255: Introduction to Embedded Systems Keith Vertanen Copyright 2011 Timers Overview Creating fixed pauses Calculate length of events Counts events Generate baud rate for serial

More information

CoE3DJ4 Digital Systems Design. Chapter 6: Interrupts

CoE3DJ4 Digital Systems Design. Chapter 6: Interrupts CoE3DJ4 Digital Systems Design Chapter 6: Interrupts Interrupts An interrupt is the occurrence of an event that causes a temporary suspension of a program while the condition is serviced by another program.

More information

INTEGRATED CIRCUITS. AN408 80C451 operation of port 6

INTEGRATED CIRCUITS. AN408 80C451 operation of port 6 INTEGRATED CIRCUITS March 1988 INTRODUCTION The features of the are shared with the 80C51 or are conventional except for the operation of port 6. The flexibility of this port facilitates high-speed parallel

More information

MASSEY UNIVERSITY PALMERSTON NORTH CAMPUS

MASSEY UNIVERSITY PALMERSTON NORTH CAMPUS MASSEY UNIVERSITY PALMERSTON NORTH CAMPUS EXAMINATION FOR 159.233 COMPUTER SYSTEMS Semester One June 2008 Time allowed: THREE (3) hours This exam contains THREE (3) questions ANSWER ALL THREE (3) QUESTIONS

More information

MICROPROCESSOR LABORATORY MANUAL

MICROPROCESSOR LABORATORY MANUAL MICROPROCESSOR LABORATORY MANUAL T.C. AYDIN ADNAN MENDERES UNIVERSITY ENGINEERING FACULTY ELECTRICAL & ELECTRONICS ENGINEERING DEPARTMENT Prepared by: Res. Asst. Abdullah GÜLDEREN Aydın 2019 Contents 1.

More information

Assembly Language programming (2)

Assembly Language programming (2) EEE3410 Microcontroller Applications LABORATORY Experiment 2 Assembly Language programming (2) Name Class Date Class No. Marks Arithmetic, Logic and Jump instructions Objectives To learn and practice the

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

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

The Final Word on 8051 Microcontroller

The Final Word on 8051 Microcontroller The Final Word on 8051 Microcontroller This is a book about the Intel 8051 microcontroller and its large family of descendants. It is intended to give you, the reader, some new techniques for optimizing

More information

DR bit RISC Microcontroller. Instructions set details ver 3.10

DR bit RISC Microcontroller. Instructions set details ver 3.10 DR80390 8-bit RISC Microcontroller Instructions set details ver 3.10 DR80390 Instructions set details - 2 - Contents 1. Overview 7 1.1. Document structure. 7 2. Instructions set brief 7 2.1. Instruction

More information

VALLIAMMAI ENGINEERING COLLEGE

VALLIAMMAI ENGINEERING COLLEGE VALLIAMMAI ENGINEERING COLLEGE SRM Nagar, Kattankulathur 603 203 DEPARTMENT OF ELECTRICAL AND ELECTRONICS ENGINEERING QUESTION BANK V SEMESTER EE6502- MICROPROCESSORS AND MICROCONTROLLERS Regulation 2013

More information

Module Contents of the Module Hours COs

Module Contents of the Module Hours COs Microcontrollers (EE45): Syllabus: Module Contents of the Module Hours COs 1 8051 MICROCONTROLLER ARCHITECTURE: Introduction to Microprocessors and Microcontrollers, the 8051 Architecture, 08 1 and pin

More information

e-pg Pathshala Subject : Computer Science Paper: Embedded System Module: Serial Port Programming in Assembly Module No: CS/ES/12 Quadrant 1 e-text

e-pg Pathshala Subject : Computer Science Paper: Embedded System Module: Serial Port Programming in Assembly Module No: CS/ES/12 Quadrant 1 e-text e-pg Pathshala Subject : Computer Science Paper: Embedded System Module: Serial Port Programming in Assembly Module No: CS/ES/12 Quadrant 1 e-text In this lecture, serial communication control register

More information

Unit-I. 1. INTRODUCTION TO MICROCONTROLLERS. Micro controller, types, selection of a microcontroller and applications

Unit-I. 1. INTRODUCTION TO MICROCONTROLLERS. Micro controller, types, selection of a microcontroller and applications Department of Technical Education DIPLOMA COURSE IN ELECTRONICS AND COMMUNICATION ENGINEERING Fourth Semester MICROCONTROLLERS AND APPLICATION Contact Hours/Week : 04 Contact Hours/Semester : 64 CONTENTS

More information

Control Transfer Instructions Jump, Loop, and Call. ECE473/573 Microprocessor System Design, Dr. Shiue

Control Transfer Instructions Jump, Loop, and Call. ECE473/573 Microprocessor System Design, Dr. Shiue Control Transfer Instructions Jump, Loop, and Call 1 Jump Instructions JZ label ; Jump if A=0 JNZ label ; Jump if A!=0 DJNZ reg, label ; Decrement and Jump if A (or reg.)!=0 CJNE A, byte ; Compare and

More information

e-pg Pathshala Subject: Computer Science Paper: Embedded System Module: Interrupt Programming in Embedded C Module No: CS/ES/20 Quadrant 1 e-text

e-pg Pathshala Subject: Computer Science Paper: Embedded System Module: Interrupt Programming in Embedded C Module No: CS/ES/20 Quadrant 1 e-text e-pg Pathshala Subject: Computer Science Paper: Embedded System Module: Interrupt Programming in Embedded C Module No: CS/ES/20 Quadrant 1 e-text In this lecture embedded C program for interrupt handling

More information

LAB FILE of EE1531: MICROCONTROLLER & EMBEDDED SYSTEMS LAB

LAB FILE of EE1531: MICROCONTROLLER & EMBEDDED SYSTEMS LAB LAB FILE of EE1531: MICROCONTROLLER & EMBEDDED SYSTEMS LAB Name: Registration Number: Programme: B. Tech. (Electrical & Electronics Engineering) Section: Batch: Session: July-Nov, 2016 General Instructions

More information

ELEG3923 Microprocessor Ch.9 Timer Programming

ELEG3923 Microprocessor Ch.9 Timer Programming Department of Electrical Engineering University of Arkansas ELEG3923 Microprocessor Ch.9 Timer Programming Dr. Jingxian Wu wuj@uark.edu OUTLINE 2 Programming 8051 Timers Counter programming Timer programming

More information

8051 Core Specification

8051 Core Specification 8051 Core Specification Authors: Jaka Simsic Simon Teran jakas@opencores.org simont@opencores.org Rev. 0.1 August 14, 2001 First Draft www.opencores.org Rev 0.1 First Draft 1 of 26 Revision History Rev.

More information

Introduction To MCS-51

Introduction To MCS-51 Introduction To MCS-51 By Charoen Vongchumyen Department of Computer Engineering Faculty of Engineering KMITLadkrabang 8051 Hardware Basic Content Overview Architechture Memory map Register Interrupt Timer/Counter

More information

Dodatak. Skup instrukcija

Dodatak. Skup instrukcija Dodatak Skup instrukcija Arithmetic Operations [@Ri] implies contents of memory location pointed to by R0 or R1 Rn refers to registers R0-R7 of the currently selected register bank 2 ADD A,

More information

8051SERIAL PORT PROGRAMMING

8051SERIAL PORT PROGRAMMING 8051SERIAL PORT PROGRAMMING Basics of Serial Communication Computers transfer data in two ways: Parallel Often 8 or more lines (wire conductors) are used to transfer data to a device that is only a few

More information

Interrupts, timers and counters

Interrupts, timers and counters Interrupts, timers and counters Posted on May 10, 2008, by Ibrahim KAMAL, in Micro-controllers, tagged Most microcontrollers come with a set of ADD-ONs called peripherals, to enhance the functioning of

More information

Exercise 4-1. DSP Peripherals EXERCISE OBJECTIVES

Exercise 4-1. DSP Peripherals EXERCISE OBJECTIVES Exercise 4-1 DSP Peripherals EXERCISE OBJECTIVES Upon completion of this exercise, you will be familiar with the specialized peripherals used by DSPs. DISCUSSION The peripherals found on the TMS320C50

More information

MODEL ANSWER SUMMER 17 EXAMINATION Subject Title: Microcontroller and Applications Subject Code:

MODEL ANSWER SUMMER 17 EXAMINATION Subject Title: Microcontroller and Applications Subject Code: MODEL ANSWER SUMMER 17 EXAMINATION Subject Title: Microcontroller and Applications Subject Code: I m p o r t a n t I n s t r u c t i o n s t o e x a m i n e r s : 1) The answers should be examined by key

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

MICROPROCESSORS AND MICROCONTROLLERS MATERIAL. Features of 8051:

MICROPROCESSORS AND MICROCONTROLLERS MATERIAL. Features of 8051: DEPARTMENT OF ECE MICROPROCESSORS AND MICROCONTROLLERS MATERIAL UNIT V 8051 MICROCONTROLLERS To make a complete microcomputer system, only microprocessor is not sufficient. It is necessary to add other

More information

INSTRUCCIONES ARITMETICAS ERROR! MARCADOR NO DEFINIDO.

INSTRUCCIONES ARITMETICAS ERROR! MARCADOR NO DEFINIDO. INSTRUCCIONES ARITMETICAS ERROR! MARCADOR NO DEFINIDO. ADD A,Rn Add register to 28..2F 1 12 X X X accumulator ADD A,direct Add direct byte 25 2 12 X X X to accumulator ADD A,@Ri Add indirect RAM 26..27

More information

8051 Single Board Monitor Programming. Minmon - Yeralan & Ahluwalia. PaulMon1 & PaulMon2 - Paul Stoffregen

8051 Single Board Monitor Programming. Minmon - Yeralan & Ahluwalia. PaulMon1 & PaulMon2 - Paul Stoffregen 8051 Single Board Monitor Programming Monitor Program Available Monitor Program Minmon - Yeralan & Ahluwalia Programming and Interfacing the 8051 Microcontroller PaulMon1 & PaulMon2 - Paul Stoffregen http://www.pjrc.com/tech/8051

More information

Maxim > Design Support > Technical Documents > Application Notes > Microcontrollers > APP 4465

Maxim > Design Support > Technical Documents > Application Notes > Microcontrollers > APP 4465 Maxim > Design Support > Technical Documents > Application Notes > Microcontrollers > APP 4465 Keywords: MAXQ, MAXQ610, UART, USART, serial, serial port APPLICATION NOTE 4465 Using the Serial Port on the

More information

YOU WILL NOT BE ALLOWED INTO YOUR LAB SECTION WITHOUT THE REQUIRED PRE-LAB.

YOU WILL NOT BE ALLOWED INTO YOUR LAB SECTION WITHOUT THE REQUIRED PRE-LAB. Page 1/5 Revision 3 OBJECTIVES Explore and understand microprocessor interrupts. In part A of this lab, you will use XMEGA external interrupt system. Learn how to utilize asynchronous serial communication.

More information

CPEG300 Embedded System Design. Lecture 6 Interrupt System

CPEG300 Embedded System Design. Lecture 6 Interrupt System CPEG300 Embedded System Design Lecture 6 Interrupt System Hamad Bin Khalifa University, Spring 2018 Correction Lecture 3, page 18: Only direct addressing mode is allowed for pushing or popping the stack:

More information

Question Bank Microprocessor and Microcontroller

Question Bank Microprocessor and Microcontroller QUESTION BANK - 2 PART A 1. What is cycle stealing? (K1-CO3) During any given bus cycle, one of the system components connected to the system bus is given control of the bus. This component is said to

More information

WINTER 14 EXAMINATION

WINTER 14 EXAMINATION Subject Code: 17534 WINTER 14 EXAMINATION Model Answer Important Instructions to examiners: 1) The answers should be examined by key words and not as word-to-word as given in the model answer scheme. 2)

More information

Chapter Operation Pinout Operation 35

Chapter Operation Pinout Operation 35 68000 Operation 35 Chapter 6 68000 Operation 6-1. 68000 Pinout We will do no construction in this chapter; instead, we will take a detailed look at the individual pins of the 68000 and what they do. Fig.

More information

Getting Started with the HCS12 IDE

Getting Started with the HCS12 IDE Getting Started with the HCS12 IDE B. Ackland June 2015 This document provides basic instructions for installing and using the MiniIDE Integrated Development Environment and the Java based HCS12 simulator.

More information

8051 Serial Port. EE4380 Fall02 Class 10. Pari vallal Kannan. Center for Integrated Circuits and Systems University of Texas at Dallas

8051 Serial Port. EE4380 Fall02 Class 10. Pari vallal Kannan. Center for Integrated Circuits and Systems University of Texas at Dallas 8051 Serial Port EE4380 Fall02 Class 10 Pari vallal Kannan Center for Integrated Circuits and Systems University of Texas at Dallas Serial Comm. - Introduction Serial Vs Parallel Transfer of data Simplex,

More information

Assembly Language programming (3)

Assembly Language programming (3) EEE3410 Microcontroller Applications LABORATORY Experiment 3 Assembly Language programming (3) Name Class Date Class No. Marks Conditional Program Branching and Subroutine Call in 8051 Objectives To learn

More information

Serial communication

Serial communication Serial communication CSCI 255: Introduction to Embedded Systems Keith Vertanen Copyright 2011 Serial communication Terminology RS-232 protocol Baud rates Flow control Example Overview Develop functions

More information

The 8051 microcontroller has two 16-bit timers/counters called T0 and T1.

The 8051 microcontroller has two 16-bit timers/counters called T0 and T1. Counters and Timers: The 8051 microcontroller has two 16-bit timers/counters called T0 and T1. As their names suggest, timer counts internal clock pulse i.e. machine cycle to provide delay. Counter counts

More information

8051 Timers and Serial Port

8051 Timers and Serial Port 8051 Timers and Serial Port EE4380 Fall 2001 Class 10 Pari vallal Kannan Center for Integrated Circuits and Systems University of Texas at Dallas Timer: Mode 1 Operation (recap) 16 bit counter. Load the

More information

INTERRUPTS PROGRAMMING

INTERRUPTS PROGRAMMING INTERRUPTS PROGRAMMING The 8051 Microcontroller and Embedded Systems: Using Assembly and C Mazidi, Mazidi and McKinlay Chung-Ping Young 楊中平 Home Automation, Networking, and Entertainment Lab Dept. of Computer

More information

CPEG300 Embedded System Design. Lecture Interface with Peripheral Devices

CPEG300 Embedded System Design. Lecture Interface with Peripheral Devices CPEG300 Embedded System Design Lecture 0 805 Interface with Peripheral Devices Hamad Bin Khalifa University, Spring 208 Typical Devices for an Electronics System Power generation PWM control Input devices

More information

GUJARAT TECHNOLOGICAL UNIVERSITY

GUJARAT TECHNOLOGICAL UNIVERSITY GUJARAT TECHNOLOGICAL UNIVERSITY INSTRUMENTATION & CONTROL ENGINEERING (17) MICROCONTROLLER & INTERFACING (IC) SUBJECT CODE: 21517 B.E. 5 th SEMESTER Type of course: Core Engineering Prerequisite: 1. Fundamental

More information

Understanding the basic building blocks of a microcontroller device in general. Knows the terminologies like embedded and external memory devices,

Understanding the basic building blocks of a microcontroller device in general. Knows the terminologies like embedded and external memory devices, Understanding the basic building blocks of a microcontroller device in general. Knows the terminologies like embedded and external memory devices, CISC and RISC processors etc. Knows the architecture and

More information

System & Program Developments of 8051

System & Program Developments of 8051 System & Program Developments of 8051 Program Structure and Design Introduction Advantages and Disadvantages of Structured Programming The Three Structures: statements, loops, choice Pseudo Code Syntax

More information

CS 320. Computer Architecture Core Architecture

CS 320. Computer Architecture Core Architecture CS 320 Computer Architecture 8051 Core Architecture Evan Hallam 19 April 2006 Abstract The 8051 is an 8-bit microprocessor designed originally in the 1980 s by the Intel Corporation. This inexpensive and

More information

Chapter 2. Overview of Architecture and Microcontroller-Resources

Chapter 2. Overview of Architecture and Microcontroller-Resources Chapter 2 Overview of Architecture and Microcontroller-Resources Lesson 4 Timers, Real Time Clock Interrupts and Watchdog Timer 2 Microcontroller-resources Port P1 Port P0 Port P2 PWM Timers Internal Program

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

80C51 family programmer s guide and instruction set. 80C51 Family. PROGRAMMER S GUIDE AND INSTRUCTION SET Memory Organization. Philips Semiconductors

80C51 family programmer s guide and instruction set. 80C51 Family. PROGRAMMER S GUIDE AND INSTRUCTION SET Memory Organization. Philips Semiconductors PROGRAMMER S GUIDE AND INSTRUCTION SET Memory Organization Program Memory The 80C51 has separate address spaces for program and data memory. The Program memory can be up to 64k bytes long. The lower 4k

More information

8051 Microcontroller

8051 Microcontroller 8051 Microcontroller 1 Salient Features (1). 8 bit microcontroller originally developed by Intel in 1980. (2). High-performance CMOS Technology. (3). Contains Total 40 pins. (4). Address bus is of 16 bit

More information

C51 Family. Architectural Overview of the C51 Family. Summary

C51 Family. Architectural Overview of the C51 Family. Summary Architectural Overview of the C51 Family C51 Family Summary 1. Introduction............................................................ I.1. 1.1. TSC80C51/80C51/80C31.................................................................

More information

Experiment# 8: Photo-Interrupter Control

Experiment# 8: Photo-Interrupter Control Experiment# 8: Photo-Interrupter Control I. Objective 1. Study the schematic diagram of photo interrupter (PH1, and PH2) and the pulse generator circuit. 2. To demonstrate the control applications of photo-interrupter,

More information

3. (a) Explain the steps involved in the Interfacing of an I/O device (b) Explain various methods of interfacing of I/O devices.

3. (a) Explain the steps involved in the Interfacing of an I/O device (b) Explain various methods of interfacing of I/O devices. Code No: R05320202 Set No. 1 1. (a) Discuss the minimum mode memory control signals of 8086? (b) Explain the write cycle operation of the microprocessor with a neat timing diagram in maximum mode. [8+8]

More information

EXPERIMENT NO.1. A Microcontroller is a complete computer system built on a single chip.

EXPERIMENT NO.1. A Microcontroller is a complete computer system built on a single chip. EXPERIMENT NO.1 AIM: Study of 8051 Microcontroller TOOLS: 8051 kit THEORY: Salient Features of 8051 A Microcontroller is a complete computer system built on a single chip. It contains all components like

More information

Interrupts and Timers

Interrupts and Timers Indian Institute of Technology Bombay CS684/CS308 Embedded Systems Interrupts and Timers E.R.T.S. Lab 1 Lab Objective This lab will introduce you to the use of Timers and Interrupts on the TM4C123GH6PM.

More information

ENSC E-123: Final Exam: Digital Electronics. Spring 2014

ENSC E-123: Final Exam: Digital Electronics. Spring 2014 ENSC E-123: Final Exam Spring 2014 1 ENSC E-123: Final Exam: Digital Electronics. Spring 2014 YOUR NAME: This is a mostly-closed-book test. You may use the following materials: 1. a one-page, one-sided

More information

Memory organization Programming model - Program status word - register banks - Addressing modes - instruction set Programming examples.

Memory organization Programming model - Program status word - register banks - Addressing modes - instruction set Programming examples. MICROCONTROLLERS AND APPLICATIONS 1 Module 2 Module-2 Contents: Memory organization Programming model - Program status word - register banks - Addressing modes - instruction set Programming examples. MEMORY

More information

Assembly Language Programming Assignment 1

Assembly Language Programming Assignment 1 U08809 Microprocessors Assembly Language Programming Assignment 1 1. Write a short assembly program that illustrates the use of the direct addressing mode, and the use of the MUL function 2 number2 slot

More information

Dragonchip. Instruction Set Manual

Dragonchip. Instruction Set Manual Dragonchip Instruction Set Manual Version 3.1 July 2004 The Objective of this document is to provide the user a detail description to the each instruction set used in Dragonchip s MCU family. There are

More information

Government of Karnataka Department of Technical Education Board of Technical Examinations, Bengaluru

Government of Karnataka Department of Technical Education Board of Technical Examinations, Bengaluru Prerequisites Government of Karnataka Department of Technical Education Board of Technical Examinations, Bengaluru Course Title: Microcontroller & Applications Course Code : 15EC42T Credits : 4 Semester

More information

Programmable Interval Timer CEN433 King Saud University Dr. Mohammed Amer Arafah

Programmable Interval Timer CEN433 King Saud University Dr. Mohammed Amer Arafah Programmable Interval Timer - 8254 CEN433 King Saud University Dr. 1 Functional Diagram 2 8254: Pin Description 3 8254: Read/Write Operations Summary 4 8254 System Interface 5 Control Word Format 6 Possible

More information