FACULTY OF ENGINEERING LAB SHEET
|
|
- Tracy Watson
- 5 years ago
- Views:
Transcription
1 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 be carried out during or at the end of the experiment. Students are advised to read through this lab sheet before doing experiment. Your performance, teamwork effort, and learning attitude will count towards the marks.
2 MP2: Construction and programming of a basic electronic piano Objectives: To demonstrate the GPIO operations of an 8051 based microcontroller. To analyse the timing operations of an 8051 based microcontroller. To develop an MCS-51 assembly program to generate different musical notes. Equipment: Atmel USB Programmer Desktop computer with USB interface USB cable 5V DC Power Supply Unit 2x breadboards Software: Notepad++ with MCS-51 assembler ProgISP (for Atmel USB Programmer) Electronic Components: No Component Quantity 1 Crystal 12MHz 1 2 Micro-tact switch 5 3 1K 9-way resistor network ohm resistor K resistor pF capacitor uF capacitor 1 8 AT89S51 or AT89S N2222 transistor W speaker 1 Introduction The 8051 based microcontroller can be programmed to play a musical note by generating a tone of specific frequency and duration. Table 1 shows the frequencies required to generate the tone to play three basic musical notes. These tones can be generated by using the built-in timers of the microcontroller. For example, to generate the musical note C6, Timer 0 can be set to overflow after every 478 s. Each time Timer 0 overflows, it will toggle a GPIO pin (e.g. P0.0). This would generate a tone with a frequency of 1046 Hz, as shown in Figure A1. Table 1. Basic musical notes and their frequency Musical Note Frequency (f) Half-period ( 1 /2f) C Hz 478 s D Hz 426 s E Hz 379 s Multimedia University Page 1 of 12
3 f = 1046 Hz T = 1 / f = 956 s T / 2 = 478 s Figure 1. Half-period calculation for musical note C6. Hardware Setup 1. Type the program below in Notepad++ and save it as test.asm and assemble it by pressing F6 key and click OK. ORG 0000H CLR P0.0 ; switch off buzzer MOV P1, #0FFH ; configure P1 as input LOOP: MOV A, P1 ; move buttons status to accumulator CPL A ; invert accumulator JZ LOOP ; jump if accumulator is zero CALL TONE ; play a tone SJMP LOOP ; repeat TONE: MOV R0, #250 RPT1: MOV R1, #5 RPT2: MOV R2, #100 DJNZ R2, $ DJNZ R1, RPT2 CPL P0.0 DJNZ R0, RPT1 END 2. Download test.hex into the microcontroller (refer to the Appendix A on how to download the file to the microcontroller). 3. Construct the microcontroller circuit as shown in Figure 2. Multimedia University Page 2 of 12
4 +5V F Micro-tact switches S1 S2 S3 P1.0 (1) P1.1 (2) P1.2 (3) P1.3 (4) P1.4 (5) P1.5 (6) P1.6 (7) P1.7 (8) RST (9) AT89S52 Vcc (40) P0.0 (39) P0.1 (38) P0.2 (37) P0.3 (36) P0.4 (35) P0.5 (34) P0.6 (33) P0.7 (32) 8x1k +5V +5V Pin 1 ( ) + B Gang resistor C E 2N2222 Flat surface E BC Speaker 8.2k +5V 22pF XTAL2 (18) EA (31) 22pF XTAL1(19) Vss (20) Figure 2. Microcontroller circuit connection; the pin numbers are shown in brackets. 4. Switch on the DC power supply unit (PSU) and verify that the microcontroller circuit is working correctly (the buzzer will beep each time any of the buttons connected to P1 is pressed). 5. If the circuit is not functioning as expected, check all connections according to Figure 2. Exercise A Objective: To play basic musical notes by generating tones of different frequencies using the built-in timer. Procedure: 1. Execute Notepad++ from Windows Desktop 2. Click on Language on the pull-down menu and select Assembly_ Type the assembly program (case insensitive) in Table A1 below. Table A1. Assembly program for Exercise A ; This program plays 3 musical notes (C6 D6 E6) continuously. DO6 EQU 478 ; half-period for C6 RE6 EQU 426 ; half-period for D6 MI6 EQU 379 ; half-period for E6 LB EQU 30H ; address of RAM to store low byte HB EQU 31H ; address of RAM to store high byte ORG 0000H MOV TMOD, #01H ; configure Timer 0 CLR P0.0 ; switch off buzzer LOOP: MOV LB, #LOW(-DO6) ; load low byte of DO6 Multimedia University Page 3 of 12
5 MOV HB, #HIGH(-DO6) ; load high byte of DO6 CALL PLAY_NOTE ; call subroutine to play music note MOV A, #1 CALL DELAYS ; call subroutine to generate pause MOV LB, #LOW(-RE6) ; load low byte of RE6 MOV HB, #HIGH(-RE6) ; load high byte of RE6 CALL PLAY_NOTE ; call subroutine to play music note MOV A, #1 CALL DELAYS ; call subroutine to generate pause MOV LB, #LOW(-MI6) ; load low byte of MI6 MOV HB, #HIGH(-MI6) ; load high byte of -MI6 CALL PLAY_NOTE ; call subroutine to play music note MOV A, #1 CALL DELAYS ; call subroutine to generate pause SJMP LOOP ; repeat PLAY_NOTE: MOV R2, #50 ; load the no. of time L1 loop is repeated L1: MOV R1, #25 ; load the no. of time L2 loop is repeated L2: MOV TH0, HB ; load TH0 register from high byte address MOV TL0, LB ; load TL0 register from low byte address SETB TR0 ; start Timer 0 JNB TF0, $ ; wait until Timer 0 overflows CLR TR0 ; stop Timer 0 CLR TF0 ; clear Timer 0 overflow flag CPL P0.0 ; complement P0.0 for tone generation DJNZ R1, L2 ; jump to L2 until R1 is decreased to 0 DJNZ R2, L1 ; jump to L1 until R2 is decreased to 0 CLR P0.0 ; switch off buzzer ; exit subroutine DELAYS: MOV R3, A ; load the no. of time RPT loop is repeated RPT: MOV R2, #250 ; load the no. of time AGN loop is repeated AGN: MOV R1, #250 ; load the no.of time HERE loop is repeated HERE: NOP NOP DJNZ R1, HERE ; jump to HERE until R1 is decreased to 0 DJNZ R2, AGN ; jump is AGN until R2 is decreased to 0 DJNZ R3, RPT ; jump to RPT until R3 is decreased to 0 ; exit subroutine END 4. Save the program as EXA1.asm. 5. Assemble and link the program by pressing F6 key and click OK, or simply press CTRL+F6. 6. If no error is reported, exit Notepad++ (optional). 7. Switch off the DC PSU and carefully unplug the microcontroller from the breadboard and insert it into the programmer. 8. Download the file EXA1.hex from the PC to the microcontroller (refer to Appendix A on how to download the file). 9. Plug the microcontroller back onto the breadboard and switch on the PSU. 10. Observe and verify that the microcontroller circuit is working as expected (playing C6 D6 E6 repeatedly). 11. Complete Table A2 in the Answer Sheet by calculating the half-period for the remaining musical notes. 12. Modify the assembly program in Table A1 above so that it will play 8 musical notes (C6 D6 E6 F6 G6 A6 B6 C7) continuously. Multimedia University Page 4 of 12
6 Exercise B Objective: To develop an assembly program to playback preset musical notes using lookup table. Procedure: 1. Type the program listed in Table B1 below into Notepad++, save it as EXB1.asm and assemble it by pressing CTRL-F6. Table B1. Assembly program for Exercise B ; Playback preset musical notes using lookup table DO6 EQU 478 ; half-period of C6 RE6 EQU 426 ; half-period of D6 MI6 EQU 379 ; half-period of E6 LB EQU 30H ; address of RAM to store low byte UB EQU 31H ; address of RAM to store high byte ORG 0000H MOV TMOD, #01H ; configure Timer 0 CLR P0.0 ; switch off buzzer MOV DPTR, #MUSIC_TABLE ; load address of lookup table into DPTR LOOP: MOV R0, #0 ; initialize R0 to 1st element in lookup table NEXT: MOV A, R0 ; load R0 to accumulator MOVC ; load current byte pointed by (A+DPTR) to Acc MOV UB, A ; store accumulator to high byte address INC R0 ; increase R0 to point to next byte MOV A, R0 ; load R0 to accumulator MOVC ; load current byte pointed by (A+DPTR) to Acc MOV LB, A ; store accumulator to low byte address CALL PLAY_NOTE ; call subroutine to play music note MOV A, #1 CALL DELAYS ; call subroutine to generate a short pause INC R0 ; increase R0 to point to the next byte CJNE R0, #12, NEXT ; jump to NEXT if R0 is still within range MOV A, #4 CALL DELAYS ; call subroutine to generate a longer pause SJMP LOOP ; repeat PLAY_NOTE: MOV R2, #25 ; load the no. of time L1 loop is repeated L1: MOV R1, #50 ; load the no. of time L2 loop is repeated L2: MOV TH0, UB ; load TH0 register from high byte address MOV TL0, LB ; load TL0 register from low byte address SETB TR0 ; start Timer 0 JNB TF0, $ ; wait until Timer 0 overflows CLR TR0 ; stop Timer 0 CLR TF0 ; clear Timer 0 overflow flag CPL P0.0 ; complement P0.0 for tone generation DJNZ R1, L2 ; jump to L2 until R1 is decreased to 0 DJNZ R2, L1 ; jump to L1 until R2 is decreased to 0 CLR P0.0 ; switch off buzzer ; exit subroutine DELAYS: MOV R3, A ; load the no. of time RPT loop is repeated RPT: MOV R2, #250 ; load the no. of time AGN loop is repeated AGN: MOV R1, #250 ; load the no. of time HERE loop is repeated HERE: NOP Multimedia University Page 5 of 12
7 NOP DJNZ R1, HERE ; jump to HERE until R1 is decreased to 0 DJNZ R2, AGN ; jump to AGN until R2 is decreased to 0 DJNZ R3, RPT ; jump to RPT until R3 is decreased to 0 ; exit subroutine MUSIC_TABLE: DW -DO6, -RE6, -MI6, -MI6, -RE6, -DO6 ; lookup table with preset music END 2. Switch off the PSU and carefully unplug the microcontroller from the breadboard. 3. Download EXB1.hex from the computer into the microcontroller following the steps performed in previous part. 4. Plug the microcontroller back onto the breadboard and switch on the PSU. 5. Observe and verify that the microcontroller circuit is working as expected (playing C6 D6 E6 and E6 D6 C6 repeatedly). 6. Modify the assembly program in Table B1 so that it will play the musical notes for Happy Birthday as shown in Table B2 below Table B2. Musical notes for Happy Birthday C6, C6, D6, C6, F6, E6, C6, C6, D6, C6, G6, F6, C6, C6, C7, A6, F6, E6, D6, B6, B6, A6, F6, G6, F6 7. Write the new and modified assembly instructions in the space provided in the Answer Sheet. Exercise C Objective: To develop an assembly program to generate different musical notes depending on the key pressed. Procedure 1. Enter the program listed in Table C1 below into Notepad++, save it as EXC1.asm and assemble it by pressing CTRL-F6. Table C1. Assembly program for Exercise C DO6 EQU 478 ; half-period for C6 RE6 EQU 426 ; half-period for D6 MI6 EQU 379 ; half-period for E6 S1: S2: S3: ORG 0000H MOV TMOD, #01H ; configure Timer 0 CLR P0.0 ; switch off buzzer MOV P1, #0FFH ; configure P1 as input JB P1.0, S2 ; jump to check S2 if S1 is not pressed JNB P1.0, $ ; wait until S1 is released CALL PLAY_DO ; call subroutine to play DO6 (C6) JB P1.1, S3 ; jump to check S3 if S1 is not pressed JNB P1.1, $ ; wait until S2 is released CALL PLAY_RE ; call subroutine to play RE6 (D6) JB P1.2, S1 ; jump to check S1 if S3 is not pressed JNB P1.2, $ ; wait until S3 is released CALL PLAY_MI ; call subroutine to play MI6 (E6) SJMP S1 ; jump back to check S1 Multimedia University Page 6 of 12
8 PLAY_DO: ; subroutine to play DO6 (C6) MOV R1, #50 D1_L1: MOV R0, #21 D1_L2: MOV TH0, #HIGH(-DO6) MOV TL0, #LOW(-DO6) SETB TR0 JNB TF0, $ CLR TR0 CLR TF0 CPL P0.0 DJNZ R0, D1_L2 DJNZ R1, D1_L1 CLR P0.0 PLAY_RE: ; subroutine to play RE6 (D6) MOV R1, #50 RE_L1: MOV R0, #21 RE_L2: MOV TH0, #HIGH(-RE6) MOV TL0, #LOW(-RE6) SETB TR0 JNB TF0, $ CLR TR0 CLR TF0 CPL P0.0 DJNZ R0, RE_L2 DJNZ R1, RE_L1 CLR P0.0 PLAY_MI: ; subroutine to play MI6 (E6) MOV R1, #50 MI_L1: MOV R0, #21 MI_L2: MOV TH0, #HIGH(-MI6) MOV TL0, #LOW(-MI6) SETB TR0 JNB TF0, $ CLR TR0 CLR TF0 CPL P0.0 DJNZ R0, MI_L2 DJNZ R1, MI_L1 CLR P0.0 END 2. Switch off the PSU and carefully unplug the microcontroller from the breadboard. 3. Download EXC1.hex from the computer into the microcontroller following the steps performed in previous part. 4. Plug the microcontroller back onto the breadboard and switch on the PSU. 5. Observe and verify that the microcontroller circuit is working as expected (a musical note is played when one of three buttons connected to P1.0 - P1.2 is pressed). 6. Switch off the DC PSU and connect one more micro-tact switch (S4) to P1.3 (refer to Figure 2 on page 3). 7. Modify the program in Table C1 so that the new switch (connected to P1.3) will play the musical notes F6 when it is pressed. Multimedia University Page 7 of 12
9 8. Write the new and modified assembly instructions in the space provided in the Answer Sheet. Important Note: Lab Assessment will be carried out during the lab session. It is the student's responsibility to complete the given tasks and report to the lab supervisor for assessment. Appendix A Using Atmel USB Programmer 1. Place the microcontroller into the socket. (End of experiment) 2. Launch the programmer software ProgISP. 3. Click the Select Chip drop-down list to select the correct chip. Multimedia University Page 8 of 12
10 4. Click RD to read the chip ID. 5. Make sure that only 4 items are checked (circled in red). 6. Click File and select Load Flash. Multimedia University Page 9 of 12
11 7. Select the Hex file to download. 8. Click Auto to erase, black check, program and verify the Hex file. 9. A text should be printed to confirm that the Hex file has been successfully downloaded. Multimedia University Page 10 of 12
12 Appendix B Breadboard connection for the microcontroller, resistor network and micro-tact switches. Appendix C The 8051 has two on-chip 16-bit up timers/ counters: Timer 0 & Timer 1. Initial value can be programmed F F F 6 F F F 7 F F F 8 1 F F F F F F F E Timer overlfow flag 10000H - FFF6H = AH = If the timer is incremented every 1 s, it will overflow in every 10 s TH0 F F F D TL0 D15 D14 D13 D12 D11 D10 D9 D8 D7 D6 D5 D4 D3 D2 D1 D0 TH1 TL1 D15 D14 D13 D12 D11 D10 D9 D8 D7 D6 D5 D4 D3 D2 D1 D0 Multimedia University Page 11 of 12
13 TMOD GATE C/T M1 M0 GATE C/T M1 M0 GATE C/T Timer 1 Timer 0 Gating control; when set, timer/counter is enabled only while the INTx pin is high and the TRx control bit is set; when cleared, the timer is enabled whenever the TRx control bit is set Timer or counter selection; cleared for timer operation; set for counter operation M1 Mode select bit 1 M0 Mode select bit 0 M1 M0 Mode Operating Mode bit timer mode 8-bit timer/counter; THx with TLx as 5-bit prescaler bit timer mode 16-bit timer/counter; THx and TLx are cascaded; no prescaler bit auto reload 8-bit auto reload timer/counter; THx holds a value to be reloaded into TLx each time it overflows Split timer mode TF1 TR1 TF0 TR0 IE1 IT1 IE0 IT0 TCON TF1 TR1 TF0 TR0 IE1 IT1 IE0 IT0 bit addressable Timer 1 overflow flag; set by hardware when the timer/counter 1 overflow; cleared by software or hardware as processor vectors to interrupt service subroutine Timer 1 run control bit; set/cleared by software to turn timer/counter 1 ON/OFF Timer 0 overflow flag Timer 0 run control bit External interrupt 1 edge flag; set by hardware when external interrupt edge is detected; cleared by hardware when interrupt is processed Interrupt 1 type control bit; set/cleared by software to specify falling-edge/lowlevel triggered external interrupt External interrupt 0 edge flag Interrupt 0 type control bit (End) Multimedia University Page 12 of 12
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 informationThe 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 informationCPEG300 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 information8051 Timers. Class 7 EE4380 Fall Pari vallal Kannan. Center for Integrated Circuits and Systems University of Texas at Dallas
8051 Timers Class 7 EE4380 Fall 2002 Pari vallal Kannan Center for Integrated Circuits and Systems University of Texas at Dallas Introduction Timers Timing devices - Generate specific time delay Event
More informationInterrupts. EE4380 Fall 2001 Class 9. Pari vallal Kannan. Center for Integrated Circuits and Systems University of Texas at Dallas
8051 - Interrupts EE4380 Fall 2001 Class 9 Pari vallal Kannan Center for Integrated Circuits and Systems University of Texas at Dallas Polling Vs Interrupts Polling: MCU monitors all served devices continuously,
More informationMODEL ANSWER SUBJECT- MICROCONTROLLER(12187) CLASS-EJ5E CLASS TEST-02 Q1.)Attempt any THREE of the following.
MODEL ANSWER SUBJECT- MICROCONTROLLER(12187) CLASS-EJ5E CLASS TEST-02 Q1.)Attempt any THREE of the following. (9M) 1) Describe the instructions SWAP A and MOVX@DPTR,A with one example. (3Marks) SWAP A
More informationELEG3923 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 informationCHAPTER TIMER PROGRAMMING
CHAPTER 9 8051 TIMER PROGRAMMING 8051 Timers The 8051 has two timers/counters, they can be used as Timers to generate a time delay Event counters to count events happening outside the microcontroller Both
More informationIntroduction 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 informationDepartment of EIE / Pondicherry Engineering College. Timer/Counters. Department of EIE / Pondicherry Engineering College 1
Timer/Counters Department of EIE / Pondicherry Engineering College 1 The 8051 has two internal sixteen bit hardware Timer/Counters. Each Timer/Counter can be configured in various modes, typically based
More information2. Write an 8051 program to generate a square wave of 25 khz at pin P2.3 using XTAL = 12 MHz. Solution:
Assignment 2 1. Assume that 5 binary data items are stored in RAM locations starting at 50h, as shown below. Write a program to find the sum of all the numbers. The calculation is in 16-bit format and
More informationاصول ميکروکامپيوترها استاد درس: دکتر http://ee.iust.ac.ir/rahmati/index.htm rahmati@iust.ac.ir ا درس Email و Website برای تکاليف و... : http://eel.iust.ac.ir/rahmati/ ١ هجدهم فصل ا شنايی با تايمرهای 8051
More informationEmbedded 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 informationChapter 09. Programming in Assembly
Chapter 09 Programming in Assembly Lesson 05 Programming Examples for Timers Programming TMOD Register 3 Write instructions to run T0 in Mode 0, external count inputs, internal start/stop control ANL TMOD,
More information8051 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 informationInterrupt 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 informationMicrocontroller 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 informationChapter 3. Bit Addressable Area. By DeccanRobots
Chapter 3 Bit Addressable Area By DeccanRobots What is Bit Addressable Area? FFh 2Fh 20h 00h Data Memory General purpose Memory Area Bit Addressable Memory Registers Memory Area from 20H to 2FH is Bit
More informationC H A P T E R 1 INTRODUCTION
C H A P T E R 1 INTRODUCTION The mentioned project is based on the worlds most powerful intel controller 8051. Most of the services provided in todays world are voice interactive, you call up your bank
More informationPrinciple 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 杭州 浙江大学 2014 Chapter
More information8051 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 informationUNIT 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 information8051 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 informationINTERRUPTS 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 informationMod-3: Interrupts,Timer operation,serial communication 1
Mod-3: Interrupts,Timer operation,serial communication 1 Module-3 Contents: Interrupts - interrupt sources - interrupt handling programming examples. Timers operation different modes waveform generation-
More informationEE6502- 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 informationEEE3410 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 information1. Pin diagram of 8051 and ports
e-pg Pathshala Subject : Computer Science Paper: Embedded System Module: Programming parallel ports Module No: CS/ES/9 Quadrant 1 e-text In this lecture pin diagram of 8051 controller will be shown and
More informationAssembly 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 informationVRS550-8kB Flash, 256B RAM, 25~40MHz, 8-Bit MCU VRS560-16kB Flash, 256B RAM, 40MHz, 8-Bit MCU
VRS550-8kB Flash, 256B RAM, 25~40MHz, 8-Bit MCU VRS560-6kB Flash, 256B RAM, 40MHz, 8-Bit MCU 34 Ste Catherine Street West, Suite 900, Montreal, Quebec, Canada H3B H4 Tel: (54) 87-2447 http://www.goalsemi.com
More informationMicrocontroller 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 informationMASSEY 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 informationSANKALCHAND PATEL COLLEGE OF ENGINEERING, VISNAGAR. ELECTRONICS & COMMUNICATION DEPARTMENT Question Bank- 1
SANKALCHAND PATEL COLLEGE OF ENGINEERING, VISNAGAR ELECTRONICS & COMMUNICATION DEPARTMENT Question Bank- 1 Subject: Microcontroller and Interfacing (151001) Class: B.E.Sem V (EC-I & II) Q-1 Explain RISC
More informationFACULTY OF ENGINEERING LAB SHEET
FACULTY OF ENGINEERING LAB SHEET EMBEDDED SYSTEM DESIGN ECE3196 TRIMESTER 2 (2015/2016) : Development of a simple embedded system scheduler *Note: On-the-spot evaluation may be carried out during or at
More informationVRS540-4kB Flash, 128B RAM, 25~40MHz, 8-Bit MCU
VRS540-4kB Flash, 28B RAM, 25~40MHz, 8-Bit MCU 34 Ste Catherine Street West, Suite 900, Montreal, Quebec, Canada H3B H4 Tel: (54) 87-2447 http://www.goalsemi.com P.3 P.2 XTAL NC P0./AD VRS540 Overview
More information8051 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~: 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 informationVRS570 32K Flash, 1kB RAM, 25~40MHz, 8-Bit MCU VRS580 64K Flash, 1kB RAM, 25~40MHz, 8-Bit MCU
VRS570 32K Flash, 1kB RAM, 25~40MHz, 8-Bit MCU VRS580 64K Flash, 1kB RAM, 25~40MHz, 8-Bit MCU 1134 Ste Catherine Street West, Suite 900, Montreal, Quebec, Canada H3B 1H4 Tel: (514) 871-2447 http://www.goalsemi.com
More information8-bit Microcontroller with 2/4-Kbyte Flash AT89LP2052 AT89LP4052
Features Compatible with MCS 51 Products 20 MIPS Throughput at 20 MHz Clock Frequency and 2.4V, 85 C Operating Conditions Single Clock Cycle per Byte Fetch 2/4K Bytes of In-System Programmable (ISP) Flash
More information8-bit Microcontroller with 8K Bytes In-System Programmable Flash AT89S52
Features Compatible with MCS -51 Products 8K Bytes of In-System Programmable (ISP) Flash Memory Endurance: 10,000 Write/Erase Cycles 4.0V to 5.5V Operating Range Fully Static Operation: 0 Hz to 33 MHz
More informationET2640 Microprocessors
ET2640 Microprocessors Unit -2 Processor Programming Concepts Basic Control Instructor : Stan Kong Email : skong@itt-tech.edu Figure 2 4 Bits of the PSW Register 8051 REGISTER BANKS AND STACK 80 BYTES
More informationModule I. Microcontroller can be classified on the basis of their bits processed like 8bit MC, 16bit MC.
MICROCONTROLLERS AND APPLICATIONS 1 Module 1 Module I Introduction to Microcontrollers: Comparison with Microprocessors Harvard and Von Neumann Architectures - 80C51 microcontroller features - internal
More informationUNIT 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 informationArchitecture & 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 informationControl 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 informationMicrocontroller and Applications
S.Y. Diploma : Sem. IV [DE/EJ/ET/EN/EX/EQ/IS/IC/IE] Microcontroller and Applications Time: 3 Hrs.] Prelim Question Paper Solution [Marks : 70 Q.1 Attempt any FIVE of the following : [10] Q.1(a) Define
More informationQ.1. A) Attempt any THREE of the following:
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) The model answer and the answer written by candidate
More informationDigital 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 information8051 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 informationT.Y. Diploma : Sem. V [EJ/EN/ET/EX/DE/IS/IC/IE/EV/MU] Micro-controller
T.Y. Diploma : Sem. V [EJ/EN/ET/EX/DE/IS/IC/IE/EV/MU] Microcontroller Time : 3 Hrs.] Prelim Question Paper Solution [Marks : 100 Q.1(a) Attempt any THREE of the following: [12] Q.1(a) (i) Distinguish between
More information8051 Microcontroller Assembly Programming
8051 Microcontroller Assembly Programming EE4380 Fall 2002 Class 3 Pari vallal Kannan Center for Integrated Circuits and Systems University of Texas at Dallas Topics Machine code 8051 Addressing Modes
More informationSUMMER 13 EXAMINATION
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION (Autonomous) (ISO/IEC - 27001-2005 Certified) Subject Code: 12187 SUMMER 13 EXAMINATION Model Answer Important Instructions to examiners: 1) The answers should
More informationMICROPROCESSORS 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 informationMicroprocessors 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 informationMAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION (Autonomous) (ISO/IEC Certified)
WINTER 17 EXAMINATION Subject Name: Microcontroller Model Answer Subject Code: 17534 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 words and
More informationMICROCONTROLLER BASED WATER LEVEL CONTROL SYSTEM
MICROCONTROLLER BASED WATER LEVEL CONTROL SYSTEM The present concept implements controlling of pump which pumps water from the sump (underground tank) to the overhead tank, using 8951 microcontroller.
More informationEEE3410 Microcontroller Applications Department of Electrical Engineering Lecture 9 Simple I/O Interfacing
Department of Electrical Engineering Lecture 9 Simple I/O Interfacing Week 10 1 In this Lecture. Interface 8051 with the following Input/Output Devices Switches Solenoid and relays LEDs Seven Segment Display
More informationAssembly 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 informationELEG3923 Microprocessor Ch.4 I/O Ports
Department of Electrical Engineering University of Arkansas ELEG3923 Microprocessor Ch.4 I/O Ports Dr. Jingxian Wu wuj@uark.edu OUTLINE 2 8051 I/O programming I/O bit manipulation programming I/O PORT
More information8051 Peripherals. On-Chip Memory Timers Serial Port Interrupts. Computer Engineering Timers
8051 Peripherals On-Chip Memory Timers Serial Port Interrupts Computer Engineering 2 2-1 8051 Timers 8051 Timers The 8051 has 2 internal 16-bit timers named Timer 0 and Timer 1 Each timer is a 16-bit counter
More informationApplication 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 informationMODEL ANSWER SUMMER 17 EXAMINATION Subject Title: Microcontroller Subject Code:
MODEL ANSWER SUMMER 17 EXAMINATION Subject Title: Microcontroller Subject Code: 17534 Important Instructions to examiners: 1) The answers should be examined by key words and not as word-to-word as given
More informationThe Timers/Counters The Serial Interface The Interrupt System Reset P0.0-P0.7 P2.0-P2.7. Port 2 Drivers. Port 2 Latch
HARDWARE DESCRIPTION This chapter provides a detailed description of the 80C51 microcontroller (see Figure 1). Included in this description are: The port drivers and how they function both as ports and,
More informationA Facilitated Learning Environment for Mentally Disabled Children
A Facilitated Learning Environment for Mentally Disabled Children Jeanette Chan Massachusetts Institute of Technology 6.115 Microprocessor Lab May 14, 2002 Contents 1 Introduction 2 1.1 Overview... 2 1.2
More informationDigital 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 information80C51 Block Diagram. CSE Overview 1
80C51 Block Diagram CSE 477 8051 Overview 1 80C51 Memory CSE 477 8051 Overview 3 8051 Memory The data width is 8 bits Registers are 8 bits Addresses are 8 bits i.e. addresses for only 256 bytes! PC is
More informationThree criteria in Choosing a Microcontroller
The 8051 Microcontroller architecture Contents: Introduction Block Diagram and Pin Description of the 8051 Registers Some Simple Instructions Structure of Assembly language and Running an 8051 program
More information8051 Microcontroller. Ali Ziya Alkar 1
8051 Microcontroller Ali Ziya Alkar 1 8051 Introduction 8051 is one of the most popular microcontrollers in use today. Many derivative microcontrollers have since been developed that are based on--and
More informationDigital 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 informationEmbedded World Television, Radio, CD player, Washing Machine Microwave Oven Card readers, Palm devices
A presentation on INTRODUCTION We are living in the Embedded World. We are surrounded with many embedded products and our daily life largely depends on the proper functioning of these gadgets. Television,
More informationDistributed by: www.jameco.com 1-800-831-4242 The content and copyrights of the attached material are the property of its owner. 8051 8052 and 80C51 Hardware Description December 1992 Order Number 270252-006
More informationCoE3DJ4 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 informationMODEL ANSWER SUMMER 17 EXAMINATION
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) The model answer and the answer written by candidate
More informationUNIT MICROCONTROLLER AND ITS PROGRAMMING
M i c r o p r o c e s s o r s a n d M i c r o c o n t r o l l e r s P a g e 1 UNIT-7 8051 MICROCONTROLLER AND ITS PROGRAMMING INTRODUCTION The microcontroller incorporates all the features that are found
More information8051 Microcontroller
8051 Microcontroller The 8051, Motorola and PIC families are the 3 leading sellers in the microcontroller market. The 8051 microcontroller was originally developed by Intel in the late 1970 s. Today many
More information8051 microcontrollers
8051 microcontrollers Presented by: Deepak Kumar Rout Synergy Institute of Engineering and Technology, Dhenkanal Chapter 2 Introduction Intel MCS-51 family of microcontrollers consists of various devices
More informationQ 1 a) Attempt any THREE of the following: 12 TMOD.7 TMOD.6 TMOD.5 TMOD.4 TMOD.3 TMOD.2 TMOD.1 TMOD.0 GATE C/T M1 M0 GATE C/T M1 M0
Page 1 of 33 Q 1 a) Attempt any THREE of the following: 12 Q 1 a i) Describe Timer modes of 8051. Ans: Timer 0 and Timer 1 can both be used as either Counters or Timers. There are 4 different operating
More informationMODULE-1. Short Answer Questions
MODULE-1 Short Answer Questions 1. Give the comparison between microprocessor and microcontroller. It is very clear from figure that in microprocessor we have to interface additional circuitry for providing
More informationTimer Counter and Interrupt. Equation (16 bits counter, Mode 1, 16MHz):
Equation (16 bits counter, Mode 1, 16MHz): THxTLx = 65536 - (Tt * 16.777216 e6) where: Tt: Target time x: Timer/Counter (0, 1 and 2) THx: Timer high byte TLx: Timer low byte Used Interrupts: 1 (Address,
More information80C51 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 informationCPEG300 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 information80C451 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 informationChapter 6 Interrupts. (I. Scott Mackenzie) By: Masud-ul-Hasan
Chapter 6 Interrupts (I. Scott Mackenzie) 1 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. It
More information8051 Microcontroller memory Organization and its Applications
8051 Microcontroller memory Organization and its Applications Memory mapping in 8051 ROM memory map in 8051 family 0000H 4k 0000H 8k 0000H 32k 0FFFH DS5000-32 8051 1FFFH 8752 7FFFH from Atmel Corporation
More informationMCS-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 information8051 I/O and 8051 Interrupts
8051 I/O and 8051 Interrupts Class 7 EE4380 Fall 2002 Pari vallal Kannan Center for Integrated Circuits and Systems University of Texas at Dallas Agenda 8051 I/O Interfacing Scanned LED displays LCD displays
More informationCS 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 informationInterfacing ahantronix 128x64 Graphic Module to an 8-bitMicrocontroller
Interfacing ahantronix 128x64 Graphic Module to an 8-bitMicrocontroller Introduction: Due to its thin profile, light weight, low power consumption and easy handling, liquid crystal graphic display modules
More informationSN8F5000 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 informationTimer-1 can be run using the internal clock, fosc/12 (timer mode) or from any external source via pin T1 (P3.5) (Counter mode).
EC 6504 MICROPROCESSOR AND MICROCONTROLLER Electronics and Communication Engineering Fifth Semester UNIT-V Part A 1. List the modes of Timer in 8051. [N/D16] The timers available in 8051 are Timer 0 (T0)
More informatione-pg Pathshala Subject : Computer Science Paper: Embedded System Module: Interrupt Handling Module No: CS/ES/13 Quadrant 1 e-text
e-pg Pathshala Subject : Computer Science Paper: Embedded System Module: Interrupt Handling Module No: CS/ES/13 Quadrant 1 e-text 1. Interrupt An interrupt is the occurrence of a condition--an event --
More informationFlashFlex51 Microcontroller Control of CompactFlash Card in TrueIDE Mode
FlashFlex51 MCU: June 2003 1.0 INTRODUCTION The CompactFlash (CF) card SST48CFxxx supports three operational modes: (1) PC card ATA using I/O mode, (2) PC card ATA using Memory mode, and (3) TrueIDE mode.
More informationModule 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 informationProgramming 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 informationTimer programming
5.8051 Timer programming In this tutorial, we are going to discuss the Timer module of 8051. First, we will see what are timers, their working and later we will configure the 8051 timers to generate the
More informationMICROPROCESSOR 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 informationQuestion 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 information8051 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 informationProgramming 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 informationLab-Report Microprocessors
Lab-Report Microprocessors Digital Voltage Meter (DVM) NO YES Name: Dirk Becker Course: BEng 2 Group: A Student No.: 9801351 Date: 05/May/1999 1. Contents 1. CONTENTS... 2 2. INTRODUCTION... 3 3. THE PROJECT...
More information