SOLUTIONS!! DO NOT DISTRIBUTE PRIOR TO EXAM!!
|
|
- Georgina Jenkins
- 5 years ago
- Views:
Transcription
1 THE UNIVERSITY OF THE WEST INDIES EXAMINATIONS OF APRIL MID-TERM 2005 Code and Name of Course: EE25M Introduction to Microprocessors Paper: MidTerm Date and Time: Thursday April 14th AM Duration: One Hour INSTRUCTIONS TO CANDIDATES: This paper has 9 pages and 19 questions Answer ALL questions in Sections A and B. Marks for each question are given in the margin. Approved calculators may be used. SOLUTIONS!! DO NOT DISTRIBUTE PRIOR TO EXAM!! Section A (15 marks) contains 15 multiple-choice questions. Questions in Section A should be answered on this exam script. Choose the most appropriate answer for each question, and circle the letter for your choice. You should spend about 20 minutes on Section A. Section B (30 marks) contains 4 questions. Questions in Section B should be answered on this exam script. Any code written for Section B should be appropriately commented for clarity. You should spend about 40 minutes on Section B. The following datasheets/information are attached to/distributed with this exam paper. PIC16F87x instruction set summary Data sheet for Timer0 Please write your ID# on the front cover and on each page in the spaces provided. c The University of the West Indies
2 page 2. Section A Questions Q1, Q2, and Q3 refer to the following piece of code for the PIC16F877, to multiply two numbers M1 and M2. mul clrw loop addwf M2,W btfsc incf decfsz goto movwf STATUS,C R_hi,F M1,F loop R_lo Q1. The code will perform multiplication of the initial values in M1 and M2 using: (a) partial sums; result in R_hi and R_lo. (b) partial sums; result in M2, M1. (c) repeated addition; result in M2, M1. (d) repeated addition; result in R_hi and R_lo. (e) repeated addition; result in the working register. Q2. To use this code eectively, we MUST: Q2-I ensure that M1 is unsigned Q2-II ensure that M2 is unsigned Q2-III initialize R_hi to zero Q2-IV initialise R_lo to zero Choose the most appropriate combination: (a) Q2-I and Q2-II only (b) Q2-I and Q2-III only (c) Q2-I and Q2-IV only (d) Q2-II and Q2-III only (e) Q2-II and Q2-IV only Q3. How many machine cycles will this routine take to run (ignoring the cycles for the call)? (a) (M1 1) + 6 (b) (M1 1) + 7 (c) (M2 1) + 6 (d) (M1 1) + 8 (e) (M2 1) + 8
3 page 3. Q4. Three sets of C code have been written to perform the multiplication of 255 and 27 using repeated addition. Q4-I Q4-II Q4-III void main() int k,m1,m2; long int R; void main() int k,m1,m2; long int R; void main() int k,m1,m2; long int R; R=0; M2=27; M1=255; for (k=0;k<=m1;k++) R=R+M2; R=0; M2=27; M1=255; for (k=m1;k>0;k++) R=R+M2; R=M2=27; M1=254; for (k=0;k<=m1;k++) R=R+M2; For the compiler used, integers are represented using 8 bits, and long integers are represented using 16 bits. When run, Program Q4-I never stops. Programs Q4-II and Q4-III, however, run as expected. The MOST PLAUSIBLE explanation for the failure of Program Q4-I is that: (a) R is not big enough to hold the result of the operation. (b) R should also be declared as an integer. (c) the number 255 cannot be represented using 8 bits. (d) the termination test requires representing the number 256 in 8 bits. (e) there is a aw in the compiler it generates bad code sometimes. Q5. A normally-closed push button switch needs to be interfaced to the PIC16F877, so that we can determine if it is pressed or not by checking the state of the input pin. Which of the following connections are viable alternatives? Q5-I tie the switch between PORTB pin and ground with internal pull-ups enabled Q5-II tie the switch between PORTB pin and ground with an external pull-up resistor Q5-III tie the switch between PORTB pin and V DD with internal pull-ups enabled Q5-IV tie the switch between PORTB pin and V DD with an external pull-down resistor (a) none of these are viable alternatives (b) Q5-I and Q5-IV only (c) Q5-I, Q5-II, and Q5-III only (d) Q5-I, Q5-II, and Q5-IV only (e) Q5-I, Q5-II, Q5-III, and Q5-IV
4 page 4. Q6. Select the most appropriate combination of words to complete the sentence. A programmer used the Q6-I instruction instead of the Q6-II instruction at the end of an Interrupt Service Routine for the PIC16F877. The program failed to work because Q6-III. (a) Q6-I: retfie; Q6-II:; Q6-III: interrupts were not re-enabled. (b) Q6-I: retfie; Q6-II:; Q6-III: PCL was not restored. (c) Q6-I: retfie; Q6-II:; Q6-III: the stack overowed. (d) Q6-I: ; Q6-II:retfie; Q6-III: interrupts were not re-enabled. (e) Q6-I: ; Q6-II:retfie; Q6-III: the stack overowed. Q7. A 4 bit timer/counter module is connected so that one of its inputs is a 100Hz signal, and the other is a signal whose frequency is to be determined. The frequency ranges which can be measured in counter mode are: (a) min: 0Hz; max: 1.5kHz; resolution ±100Hz (b) min: 0Hz; max: 1.6kHz; resolution ±50Hz (c) min: 100Hz; max: 1.5kHz; resolution ±100Hz (d) min: 100Hz; max: 1.5kHz; resolution ±50Hz (e) min: 100Hz; max: 1.6kHz; resolution ±100Hz Q8. You have a circuit in which the timer/counter module inside the PIC16F877 is used to count each falling edge from an externally supplied signal. You notice that the module counts twice on each falling edge. In order to discover the cause of the problem, the MOST appropriate action is to: (a) check the supply voltage for noise using a multimeter. (b) replace the PIC16F877 and see if the problem disappears. (c) use a pull-down resistor on the input pin and see if the problem disappears. (d) increase the frequency of the external signal and see if the problem disappears. (e) visually inspect for loose wires. Q9. Timer0 (8-bit timer) of the PIC16F877 is congured to increment on the rising edge of the internal machine cycle clock (CLKOUT) with a pre-scaler value of 1:64. What is the interval between successive overows of Timer0 if the PIC16F877 is clocked using a 10M Hz oscillator? (a) 64µs (b) 102.4µs (c) 256µs (d) µs (e) 16384µs
5 page 5. The following information is to be used for questions Q10 to Q12. A rotary optical incremental encoder (rotary pulse generator) has two outputs, channel A and channel B. Channel A is used to generate external interrupts on a PIC16F877 at each rising edge. Channel B is connected to another pin on the PIC16F877. An Interrupt Service Routine (ISR) is used to determine the direction of rotation clockwise (rising edge of A coincides with a low on B) or anticlockwise (rising edge of A coincides with a high on B) and the distance turned (counting number of pulses on Channel A). Several "strange behaviours" may be observed with this system: P-I : counting less than the actual number pulses P-II : counting more than the actual number of pulses P-III : deducing the wrong direction of motion Q10. Which of the "strange behaviours" listed can occur if interrupts occur before the previous interrupt is handled? (a) P-III only (b) P-I and P-II only (c) P-I and P-III only (d) P-II and P-III only (e) P-I, P-II, and P-III Q11. Which of the "strange behaviours" listed can occur if the encoder output does not rise quickly enough? (a) P-III only (b) P-I and P-II only (c) P-I and P-III only (d) P-II and P-III only (e) P-I, P-II, and P-III Q12. Which of the "strange behaviours" listed can occur if the voltage supplying the PIC16F877 and the encoder uctuates? (a) P-III only (b) P-I and P-II only (c) P-I and P-III only (d) P-II and P-III only (e) P-I, P-II, and P-III
6 page 6. Q13. You are told that the 80C51 and PIC16F877 both have data transfer instructions. The 80C51 can move a literal to any register using one instruction: MOV Reg, #6. The PIC16F877 can move a literal to the working register, and subsequently to any register using two instructions: movlw 6 followed by movwf Reg. Based on this information ONLY, we can assume that an 80C51 program involving several literalto-register data transfers will probably: Q13-I have less lines of code Q13-II require less program storage space Q13-III run faster Which combination of stated assumptions is appropriate? (a) none of the above assumptions are appropriate. (b) Q13-I only (c) Q13-I and Q13-II only (d) Q13-I and Q13-III only (e) Q13-I, Q13-II and Q13-III Q14. Select the most appropriate combination of words to complete the sentence. The design of an embedded system starts with the Q14-I, which is followed by the Q14-II and then the Q14-III. (a) Q14-I: conceptual design; Q14-II: function statement; Q14-III: requirements list (b) Q14-I: conceptual design; Q14-II: requirements list; Q14-III: function statement (c) Q14-I: function statement; Q14-II: conceptual design; Q14-III: requirements list (d) Q14-I: function statement; Q14-II: requirements list; Q14-III: conceptual design (e) Q14-I: requirements list; Q14-II: function statement; Q14-III: conceptual design Q15. When writing routines for a microprocessor, you have been advised to always initialize your registers, even if the power-on-default value is the value you want. Which of the following statements is an INVALID reason for this guideline? (a) The microprocessor may be reset without re-powering up. (b) The microprocessor may power-up incorrectly. (c) The routine may run after the value was changed by another routine. (d) The routine may be interrupted while it is running. (e) The routine may work incorrectly if the register has a non-default value.
7 page 7. Section B The following information should be used for all questions in Section B. You are a member of a development team which is working on a new microprocessor-controlled refrigerator, using a PIC16F877 with a 700 Hz clock. The refrigerator consists of a cooling unit, a defrost unit, and a thermostat, which are connected to PORTD pins <2>, <1> and <0> respectively. loop: The cooling unit is switched on when PORTD<2> is high. The defrost unit is switched on when PORTD<1> is low. PORTD<0> has an external pull-up resistor. The thermostat pulls PORTD<0> low when the fridge temperature is above c + 2 degrees Celsius, and keeps the line low until the fridge temperature drops below c 2 degrees Celsius; where c is the temperature setting for the fridge. The defrost unit is activated for approximately 6 minutes each day. The main program algorithm is: configure pins if defrost unit is on else if defrost-time over turn off defrost unit start timing defrost-delay (239) if defrost-delay over else turn on defrost unit start timing defrost-time (1) if thermostat line active else turn on cooling unit turn off cooling unit Q1. Write a routine named Init which will congure PORTD<2>, PORTD<1> as outputs and PORTD<0> as an input. Your routine should NOT aect the conguration state of the other PORTD pins. You should at the end of your routine. label/; 3 marks correct conguration of TRISD register (lose each if wrong register/bank, if bad bits or if alters other bits). Sample answers: 4 marks Init BANKSEL TRISD bsf TRISD,0 bcf TRISD,1 bcf TRISD,2 BANKSEL PORTD Init BANKSEL TRISD movlw 0x01 iorwf TRISD,F movlw 0xF9 andwf TRISD,F BANKSEL PORTD
8 page 8. Q2. Write an interrupt handler for Timer0 named TmrHndler which clears the Timer0 ag, decrements the value in Cnt, and disables the Timer0 interrupt if Cnt is 0. You should at the end of your interrupt handler. label/; clear ag; disable timer interrupt only if Cnt is 0; decrement Cnt (with correct destination)) Sample answer: 4 marks TmrHndlr bcf decfsz bcf INTCON, T0IF Cnt,F INTCON, T0IE Q3. Write a routine named StrtTimer which takes the value in the working register, places it in a register called Cnt, clears the Timer0 register, congures Timer0 for 1:256 pre-scaler, and internal clock, (i.e. 700Hz clock signal; timer expires every 6.24 minutes) enables the Timer0 interrupt, and global interrupts You should at the end of your routine. move W into Cnt; appropriate banking for OPTION_REG and TMR0; 2 marks appropriate bits set in OPTION_REG (1:64 pre-scaler, CLKOUT) clear timer 0, 2 marks appropriate bits in INTCON (GIE, T0IF, and T0IE) Sample answer: 7 marks StrtTimer movwf Cnt BANKSEL OPTION_REG movlw B'xx0x0111' movwf OPTION_REG BANKSEL TMR0 clrf TMR0 movlw B'1x1xx0xx' movwf INTCON
9 page 9. Q4. Write an assembly language main program for the PIC16F877 which performs the algorithm provided. Your main program should indicate where the preceding routines Init and StrtTimer, the Interrupt Service Routine and handlers are to be placed, but you do NOT need to rewrite them. Your main program should use appropriate preprocessor directives. Max. 15 marks. use of directives LIST, INCLUDE. use of sleep or END directive. choice of data location for Cnt. 2 marks choice of program location & use of reset/interrupt vector. 2 marks place value (1 or 239) in W prior to call of delay routine. 2 marks use of call for routines, and goto for loops/vectors. 4 marks correct ow for each of the decision-statements. 2 marks turn on/o cooling and defrost units. 2 marks identify & correct aw in algorithm (cool/defrost simultaneously). 15 marks LIST p=16f877 INCLUDE <p16f877.inc> Cnt EQU 0x20 ORG 0x00 goto start ORG 0x04 goto ISR ORG 0x10 start call Init bcf PORTD,2 ; turn o cooling unit bsf PORTD,1 ; turn o defrost unit loop btfsc PORTD,1 ; if defrost unit is o goto dfsto dfston movf Cnt,F ; if defrost-time not over keep looping btfss STATUS,Z bsf PORTD,1 ; otherwise turn o defrost unit movlw D'239' ; and start timing defrost-delay call StrtTimer dfsto movf Cnt,F ; if defrost-delay not over check thermostat btfss STATUS,Z goto chkthm bcf PORTD,1 ; otherwise turn on defrost unit bcf PORTD,2 ; turn o cooling unit movlw D'1' ; and start timing defrost-time call StrtTimer chkthm btfss PORTD,0 ; if thermostat line is active bsf PORTD,2 ; turn on cooling unit btfsc PORTD,0 ; if thermostat line is not-active bcf PORTD,2 ; turn o cooling unit sleep ; put the two routines: Init and StrtTimer followed by the ISR and handlers here!! END
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 informationTHE 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 informationAssembly 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 informationPerformance & Applications
EE25M Introduction to microprocessors original author: Feisal Mohammed updated: 15th March 2002 CLR Part VI Performance & Applications It is possible to predict the execution time of code, on the basis
More informationDept. 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 informationEmbedded 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 informationSection 11. Timer0. Timer0 HIGHLIGHTS. This section of the manual contains the following major topics:
M 11 Section 11. HIGHLIGHTS This section of the manual contains the following major topics: 11.1 Introduction...11-2 11.2 Control Register...11-3 11.3 Operation...11-4 11.4 TMR0 Interrupt...11-5 11.5 Using
More information/* PROGRAM FOR BLINKING LEDs CONEECTED TO PORT-D */
/* PROGRAM FOR BLINKING LEDs CONEECTED TO PORT-D */ CONFIG _CP_OFF & _WDT_OFF & _BODEN_OFF & _PWRTE_ON & _HS_OSC & _WRT_OFF & _LVP_OFF & _CPD_OFF ;***** VARIABLE DEFINITIONS COUNT_L EQU 0x01 ;**********************************************************************
More informationUniversity of Jordan Faculty of Engineering and Technology Department of Computer Engineering Embedded Systems Laboratory
University of Jordan Faculty of Engineering and Technology Department of Computer Engineering Embedded Systems Laboratory 0907334 6 Experiment 6:Timers Objectives To become familiar with hardware timing
More informationFlow 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 informationCENG 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 informationPIC 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 informationHardware Interfacing. EE25M Introduction to microprocessors. Part V. 15 Interfacing methods. original author: Feisal Mohammed
EE25M Introduction to microprocessors original author: Feisal Mohammed updated: 18th February 2002 CLR Part V Hardware Interfacing There are several features of computers/microcontrollers which have not
More informationLecture (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 informationChapter 11: Interrupt On Change
Chapter 11: Interrupt On Change The last two chapters included examples that used the external interrupt on Port C, pin 1 to determine when a button had been pressed. This approach works very well on most
More informationECE Test #1: Name
ECE 376 - Test #1: Name Closed Book, Closed Notes. Calculators Permitted. September 23, 2016 20 15 10 5 0
More informationEEE111A/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 informationCENG-336 Introduction to Embedded Systems Development. Timers
CENG-336 Introduction to Embedded Systems Development Timers Definitions A counter counts (possibly asynchronous) input pulses from an external signal A timer counts pulses of a fixed, known frequency
More informationD:\PICstuff\PartCounter\PartCounter.asm
1 ;********************************************************************** 2 ; This file is a basic code template for assembly code generation * 3 ; on the PICmicro PIC16F84A. This file contains the basic
More informationOutlines. PIC Programming in C and Assembly. Krerk Piromsopa, Ph.D. Department of Computer Engineering Chulalongkorn University
PIC ming in C and Assembly Outlines Microprocessor vs. MicroController PIC in depth PIC ming Assembly ming Krerk Piromsopa, Ph.D. Department of Computer Engineering Chulalongkorn University Embedded C
More informationLesson 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 informationPIC16F87X 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 informationUNIVERSITY 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 information16.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 informationChapter 5 Sections 1 6 Dr. Iyad Jafar
Building Assembler Programs Chapter 5 Sections 1 6 Dr. Iyad Jafar Outline Building Structured Programs Conditional Branching Subroutines Generating Time Delays Dealing with Data Example Programs 2 Building
More informationInstuction 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 informationChapter 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 informationTOPIC 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 informationUNIVERSITY 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 informationHi Hsiao-Lung Chan Dept Electrical Engineering Chang Gung University, Taiwan
Interrupts and Resets Hi Hsiao-Lung Chan Dept Electrical Engineering Chang Gung University, Taiwan chanhl@mail.cgu.edu.twcgu Interrupts An event that will cause the CPU to stop the normal program execution
More informationAPPLICATION 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 informationSection 13. Timer0 HIGHLIGHTS. Timer0. This section of the manual contains the following major topics:
Section 13. Timer0 HIGHLIGHTS This section of the manual contains the following major topics: 13.1 Introduction... 13-2 13.2 Control Register... 13-3 13.3 Operation... 13-4 13.4 Timer0 Interrupt... 13-5
More informationLAB 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 informationWeek1. 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 informationTimer2 Interrupts. NDSU Timer2 Interrupts September 20, Background:
Background: Timer2 Interrupts The execution time for routines sometimes needs to be set. This chapter loops at several ways to set the sampling rate. Example: Write a routine which increments an 8-bit
More informationInterfacing PIC Microcontrollers. ADC8BIT2 Schematic. This application demonstrates analogue input sampling
Interfacing PIC Microcontrollers ADC8BIT2 Schematic This application demonstrates analogue input sampling A manually adjusted test voltage 0-5V is provided at AN0 input A reference voltage of 2.56V is
More informationBinary Outputs and Timing
Binary Outputs and Timing Each of the I/O pins on a PIC can be inputs or ourputs As an input, the pin is high impedance (meaning it is passive and draws very little current). If you apply 0V to that pin,
More informationEmbedded Systems Design (630470) Lecture 4. Memory Organization. Prof. Kasim M. Al-Aubidy Computer Eng. Dept.
Embedded Systems Design (630470) Lecture 4 Memory Organization Prof. Kasim M. Al-Aubidy Computer Eng. Dept. Memory Organization: PIC16F84 has two separate memory blocks, for data and for program. EEPROM
More informationmovwf prevcod ; a new button is pressed - rcnt=3 movwf (mtx_buffer+1) movlw 3 movwf rcnt
movlw 0x20 #endif call scan movlw 0xfd tris PORTB ; select colb (RB1) #ifdef MODE_CH8 movlw 0x04 #endif #ifdef MODE_CH4 movlw 0x30 #endif call scan movf cod, W bz loop2 ; if no buton is pressed, skip subwf
More informationEE6008-Microcontroller Based System Design Department Of EEE/ DCE
UNIT- II INTERRUPTS AND TIMERS PART A 1. What are the interrupts available in PIC? (Jan 14) Interrupt Source Enabled by Completion Status External interrupt from INT INTE = 1 INTF = 1 TMR0 interrupt T0IE
More informationECE 354 Introduction to Lab 2. February 23 rd, 2003
ECE 354 Introduction to Lab 2 February 23 rd, 2003 Fun Fact Press release from Microchip: Microchip Technology Inc. announced it provides PICmicro field-programmable microcontrollers and system supervisors
More informationThese 3 registers contain enable, priority,
8.3.2) Registers Related to Interrupts These registers enable/disable the interrupts, set the priority of the interrupts, and record the status of each interrupt source. RCON INTCON, INTCON2, and INTCON3
More informationDHANALAKSHMI 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 informationECE 354 Computer Systems Lab II. Interrupts, Strings, and Busses
ECE 354 Computer Systems Lab II Interrupts, Strings, and Busses Fun Fact Press release from Microchip: Microchip Technology Inc. announced it provides PICmicro field-programmable microcontrollers and system
More informationALU 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 information16.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 informationMicro 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 informationA Better Mouse Trap. Consumer Appliance, Widget, Gadget APPLICATION OPERATION: Ontario, Canada
A Better Mouse Trap Author: APPLICATION OPERATION: My application uses a PIC12C508 to produce realistic sounding mouse-like coos that all mice are sure to find seductive. The entire circuit should be imbedded
More informationEmbedded System Design
ĐẠI HỌC QUỐC GIA TP.HỒ CHÍ MINH TRƯỜNG ĐẠI HỌC BÁCH KHOA KHOA ĐIỆN-ĐIỆN TỬ BỘ MÔN KỸ THUẬT ĐIỆN TỬ Embedded System Design : Microcontroller 1. Introduction to PIC microcontroller 2. PIC16F84 3. PIC16F877
More informationIntroduction to PIC Programming
Introduction to PIC Programming Programming Baseline PICs in C by David Meiklejohn, Gooligum Electronics Lesson 3: Using Timer 0 As demonstrated in the previous lessons, C can be a viable choice for programming
More informationEECE.3170: Microprocessor Systems Design I Summer 2017
EECE.3170: Microprocessor Systems Design I Summer 2017 1. What is an interrupt? What is an exception? Lecture 13: Key Questions June 19, 2017 2. For what purposes are interrupts useful? 3. Describe the
More informationwhich means that writing to a port implies that the port pins are first read, then this value is modified and then written to the port data latch.
Introduction to microprocessors Feisal Mohammed 3rd January 2001 Additional features 1 Input/Output Ports One of the features that differentiates a microcontroller from a microprocessor is the presence
More information16.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 informationApplication Note - PIC Source Code v1.1.doc
Programmable, RGB-backlit LCD Keyswitches APPLICATION NOTE PIC SOURCE CODE 2004-2006 copyright [E³] Engstler Elektronik Entwicklung GmbH. All rights reserved. PIC Source Code The following Assembler source
More informationMore (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 informationFigure 1: Pushbutton without Pull-up.
Chapter 7: Using the I/O pins as Inputs. In addition to working as outputs and being able to turn the I/O pins on and off, these same pins can be used as inputs. In this mode the PIC is able to determine
More informationPIC PROGRAMMING START. The next stage is always the setting up of the PORTS, the symbol used to indicate this and all Processes is a Rectangle.
PIC PROGRAMMING You have been introduced to PIC chips and the assembly language used to program them in the past number of lectures. The following is a revision of the ideas and concepts covered to date.
More informationAN587. Interfacing to an LCD Module. Interfacing to an LCD Module INTRODUCTION OPERATION CONTROL SIGNAL FUNCTIONS TABLE 2: CONDITIONAL ASSEMBLY FLAGS
Interfacing to an LCD Module AN587 INTRODUCTION TABLE 1: CONTROL SIGNAL FUNCTIONS This application note interfaces a PIC16CXX device to the Hitachi LM02L LCD character display module. This module is a
More informationCONNECT 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/ 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 informationDERTS 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 informationOutline. Micriprocessor vs Microcontroller Introduction to PIC MCU PIC16F877 Hardware:
HCMIU - DEE Subject: ERTS RISC MCU Architecture PIC16F877 Hardware 1 Outline Micriprocessor vs Microcontroller Introduction to PIC MCU PIC16F877 Hardware: Program Memory Data memory organization: banks,
More informationAPPLICATION 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 informationME 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 informationLaboratory Exercise 5 - Analog to Digital Conversion
Laboratory Exercise 5 - Analog to Digital Conversion The purpose of this lab is to control the blinking speed of an LED through the Analog to Digital Conversion (ADC) module on PIC16 by varying the input
More informationEECE.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 informationQ1: 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 informationChapter 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 informationUNIVERSITY OF BOLTON SCHOOL OF ENGINEERING MSC SYSTEMS ENGINEERING AND ENGINEERING MANAGEMENT SEMESTER 2 EXAMINATION 2016/2017
TW30 UNIVERSITY OF BOLTON SCHOOL OF ENGINEERING MSC SYSTEMS ENGINEERING AND ENGINEERING MANAGEMENT SEMESTER 2 EXAMINATION 2016/2017 MICROPROCESSOR BASED SYSTEMS MODULE NO: EEM7016 Date: Wednesday 17 May
More informationDone 1 NVB THF TLF T/R POL 1SHOT. Figure 1: Status register
Introduction to Microprocessors Feisal Mohammed 12th January 2001 Mini-project This project is to implement a temperature monitor using the PicStic4, the DS1821 temperature sensor and a LCD display. The
More informationSection 14. Timer1 HIGHLIGHTS. Timer1. This section of the manual contains the following major topics:
Section 14. Timer1 HIGHLIGHTS This section of the manual contains the following major topics: 14.1 Introduction... 14-2 14.2 Control Register... 14-4 14.3 Timer1 Operation in Timer Mode... 14-5 14.4 Timer1
More informationECE 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 informationSOLAR 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 informationPIC 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 informationLearning Objectives:
Topic 5.2.1 PIC microcontrollers Learning Objectives: At the end of this topic you will be able to; Recall the architecture of a PIC microcontroller, consisting of CPU, clock, data memory, program memory
More informationIntroduction to PIC Programming
Introduction to PIC Programming Baseline Architecture and Assembly Language by David Meiklejohn, Gooligum Electronics Lesson 5: Using Timer0 The lessons until now have covered the essentials of baseline
More informationExperiment 7:The USART
University of Jordan Faculty of Engineering and Technology Department of Computer Engineering Embedded Systems Laboratory 0907334 7 Experiment 7:The USART Objectives Introduce the USART module of the PIC
More informationPIC Discussion By Eng. Tamar Jomaa
PIC Discussion By Eng. Tamar Jomaa Outlines 2.6 TMR0 2.7 EEPROM 2.8 Look up table 2.9 Macro 2.6 TMR0 Example#1 Write an assembly program to make a counter using TMR0, the count should increment it s value
More information16.317: Microprocessor Systems Design I Fall Exam 3 December 15, Name: ID #:
16.317: Microprocessor Systems Design I Fall 2014 Exam 3 December 15, 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
More informationHi Hsiao-Lung Chan Dept Electrical Engineering Chang Gung University, Taiwan
PIC18 Serial Port Hi Hsiao-Lung Chan Dept Electrical Engineering Chang Gung University, Taiwan chanhl@mail.cgu.edu.twcgu Serial vs. parallel data transfer 2 Simplex, half-, and full-duplex transfers 3
More informationUNIVERSITY OF BOLTON SCHOOL OF ENGINEERING. BEng(Hons) Electrical and Electronics Engineering SEMESTER 1 EXAMINATION 2016/2017
TW34 UNIVERSITY OF BOLTON SCHOOL OF ENGINEERING BEng(Hons) Electrical and Electronics Engineering SEMESTER 1 EXAMINATION 2016/2017 INTERMEDIATE EMBEDDED SYSTEMS MODULE NO: EEE5004 Date: Thursday 12 January
More informationPIC16F84A 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 informationApplication Note One Wire Digital Output. 1 Introduction. 2 Electrical Parameters for One Wire Interface. 3 Start and Data Transmission
Application Note One Wire Digital Output 1 Introduction The pressure transmitter automatically outputs pressure data, and when appropriate temperature data, in a fixed interval. The host simply waits for
More information16.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 informationEmbedded Systems Programming and Architectures
Embedded Systems Programming and Architectures Lecture No 10 : Data acquisition and data transfer Dr John Kalomiros Assis. Professor Department of Post Graduate studies in Communications and Informatics
More informationCHAPTER 6 CONCLUSION AND SCOPE FOR FUTURE WORK
134 CHAPTER 6 CONCLUSION AND SCOPE FOR FUTURE WORK 6.1 CONCLUSION Many industrial processes such as assembly lines have to operate at different speeds for different products. Process control may demand
More informationIntroduction to Embedded Systems
Stefan Kowalewski, 4. November 25 Introduction to Embedded Systems Part 2: Microcontrollers. Basics 2. Structure/elements 3. Digital I/O 4. Interrupts 5. Timers/Counters Introduction to Embedded Systems
More informationWhen JP1 is cut, baud rate is Otherwise, baud rate is Factory default is that JP1 is shorted. (JP1 is jumper type in some model)
ELCD SERIES INTRODUCTION ALCD is Serial LCD module which is controlled through Serial communication. Most of existing LCD adopts Parallel communication which needs lots of control lines and complicated
More informationNH-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 information16.317: Microprocessor Systems Design I Fall 2014
16.317: Microprocessor Systems Design I Fall 2014 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 circling
More informationChapter 3: Further Microcontrollers
Chapter 3: Further Microcontrollers Learning Objectives: At the end of this topic you will be able to: recall and describe the structure of microcontrollers as programmable assemblies of: memory; input
More informationInterrupts. ELEC 330 Digital Systems Engineering Dr. Ron Hayne. Images Courtesy of Ramesh Gaonkar and Delmar Learning
Interrupts ELEC 330 Digital Systems Engineering Dr. Ron Hayne Images Courtesy of Ramesh Gaonkar and Delmar Learning Basic Concepts of Interrupts An interrupt is a communication process A device Requests
More informationEECE.3170: Microprocessor Systems Design I Spring 2016
EECE.3170: Microprocessor Systems Design I Spring 2016 Lecture 31: Key Questions April 20, 2016 1. (Review) Explain how interrupts can be set up and managed in the PIC microcontrollers. 1 EECE.3170: Microprocessor
More informationInput/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 informationWeekly Report: Interactive Wheel of Fortune Week 4 02/014/07-02/22/07 Written by: Yadverinder Singh
Work Completed: Weekly Report: Interactive Wheel of Fortune Week 4 02/014/07-02/22/07 Written by: Yadverinder Singh Last week started with the goal to complete writing the overall program for the game.
More informationEXPERIMENT 4: Parallel Input/Output. Objectives Introduction to the Parallel Input/Output (I/O) Familiarization to Interfacing
EXPERIMENT 4: Parallel Input/Output Objectives Introduction to the Parallel Input/Output (I/O) Familiarization to Interfacing Components' List: 1. Protoboard 2. 4 x pushbutton 3. 4 x 330Ω resistor 4. 4
More informationFortune. 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 informationChapter 10 Sections 1,2,9,10 Dr. Iyad Jafar
Starting with Serial Chapter 10 Sections 1,2,9,10 Dr. Iyad Jafar Outline Introduction Synchronous Serial Communication Asynchronous Serial Communication Physical Limitations Overview of PIC 16 Series The
More informationMechatronics 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 informationEECS 373 Midterm 2 Fall 2018
EECS 373 Midterm 2 Fall 2018 Name: unique name: Sign the honor code: I have neither given nor received aid on this exam nor observed anyone else doing so. Nor did I discuss this exam with anyone after
More information