

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!


Problem 1 (5 points)
Write an assembly language routine handling an illegal opcode fetch. For the illegal opcode $1A 10 the routine should a) Wait for 20 ms. b) Enable the output compare interrupt associated with the pin PA6. c) Resume the normal operation from the next instruction following this two-byte illegal opcode. For the remaining illegal opcodes the processor should enable the XIRQ\ interrupt and stop, waiting for this interrupt.
Problem 2 (5 points)
Two external interrupt sources SRC1 and SRC2 are connected to a 68HC11. SRC generates an interrupt request using a falling edge of the signal IRQ1. SRC2 generates an interrupt using a rising edge of the signal IRQ2. The corresponding interrupt service routines count the number of respective interrupts. When the number of interrupts generated by SRC1 exceeds the number of interrupts generated by SRC2 by 4 or more , the interrupts generated by SRC1 should be disabled. When the numbers of both interrupts become equal, the interrupts generated by SRC should be enabled. Draw a diagram of the circuit and write a code in C or assembly language, including interrupt service routines, which permit correct processing of both types of interrupts.
Problem 3 (5 points)
Draw the circuit diagram and write the procedure in C or assembly language that measures the frequency of a periodic square wave generated at the node WAVE. The frequency of the square wave is known to be greater than 40 Hz. The procedure should return the frequency in units of Hertz.
Problem 4 (5 points)
A keypad unit and an LCD are both connected to the port C of 68HC11 using an 8-bit data bus. When a key is pressed on the keypad, a short positive pulse is generated on the keypad unit control output KEYSTROBE, and the data is sent to the data bus. The LCD is written to by applying a short negative pulse to the LCD control input LCDSTROBE, when the data is present on the data bus. Draw a circuit and write a polling routine in C or assembly language that reads each character entered through the keypad, converts its code to ASCII, and sends the ASCII code to the LCD. Assume that the key codes generated by the keypad are binary numbers from 1 to 12, and that the corresponding ASCII codes accepted by LCD are '1' .. '9', '*', '0', and '#'.