



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!




Semester II Examinations 2010/
Exam Code(s) 2BN121, 2BP121, 2BEI121, 2BEE Exam(s) Second Electronic Engineering Second Electronic & Computer Engineering Second Engineering Innovation - Electronic Second Sports & Exercise Engineering
Module Code(s) EE206.ii Module(s) Microprocessor Systems Engineering II
Paper No. 1 Repeat Paper
External Examiner(s) Prof. G.W. Irwin Internal Examiner(s) Prof. G. Ó Laighin Dr. J.G. Breslin
Instructions: Answer Question 1 and any two other questions. Question 1 is compulsory and carries 30 marks. Questions 2, 3 and 4 carry 20 marks each. Candidates should note that marks may be lost if answers are not presented in a neat and legible format. Include rough- work calculations. Provide adequate information in your answers to illustrate your understanding. All programs should be well structured and include clear comments to clarify the solution method and program structure. State any assumptions made in your answers.
Duration 2 hours No. of Pages^5 Discipline(s) Electrical & Electronic Engineering Course Co-ordinator(s)
Requirements : Handout 1. HD44780 instruction set (2 pages)
Compulsory Question [30 marks total]
(a) For each of the instructions RRC, DJNZ, JBC, MOVC and NOP, state the function of each instruction, and indicate the operational type of each instruction from the list below:
CLR A MOVC A, @A+DPTR PUSH A MOV A, #020H NOP NOP [5 marks] (d) An ADuC831 uses an external crystal oscillator with a periodic frequency of 11.059 MHz. How many counts of the internal ADuC831 timer (in 16-bit mode) are required to measure a time interval of 50 ms? How is this implemented in assembly? [5 marks] (e) Write a short ADuC831 assembly language program segment to implement the operation(s) listed below. (Make sure to incorporate the appropriate EQU statements in your code.)
[20 marks total]
(a) Explain the function of the Hitachi HD47780 LCD device busy flag and its behaviour during the transfer of a data byte from the ADuC831 to the LCD device. [3 marks] For parts (b) to (e), you should assume that: An LCD 8-bit interface is used and the LCD has been initialised for 8-bit operation. The default LCD control signal levels are RS=0, RW=0 and EN=1. (b) Write an ADuC831 assembly code subroutine (named checkLCDBusy) which, when executed, continues to poll the LCD busy flag until the busy flag is deasserted. Define and use suitable ADuC831 program variable names. [4 marks] (c) Write an ADuC831 assembly code subroutine (named writeByteToLCD) which, when executed, transfers a single data byte to the LCD and then calls the subroutine checkLCDBusy. Assume that the data value is stored in the accumulator. [4 marks] (d) Write an ADuC831 assembly code subroutine (named writeStringToLCD) which, when executed, transfers a string of message characters to the LCD. This program should call the subroutine writeByteToLCD. [4 marks] (e) Use the ADuC831 DB directive method to define the message string “Banksy was here”. Write a program segment which uses the writeStringToLCD subroutine to output this string to the LCD. Include handling of a string delimiter character. [5 marks]
[20 marks total]
(a) Draw the flow chart for a simple key press polling sequence on a 4×4 matrix keypad connected to an ADuC831. [7 marks] (b) Outline an approach for an advanced key press polling sequence that avoids having to hard code each of the sixteen key press scenarios. (You need not write the code, just outline how it would work as opposed to the simple approach in part (a).) [4 marks] (c) For the Arduino microcontroller, write a sketch that turns on and off the onboard LED (pin