=========================preview======================
(elec254)[2008](s)midterm~ee_ckwam^_10312.pdf
Back to ELEC254 Login to download
======================================================
HONG KONG UNIVERSITY OF SCIENCE OF TECHNOLOGY
DEPARTMENT OF ELECTRONIC & COMPUTER ENGINEERING
ELEC 254 Microprocessor Experiments
Midterm (09:15 C 10:45 11 April 2008)
Prof. Kam-Tim WOO
I declare that the answers submitted for this examination are my own work.
I understand that sanctions will be imposed, if I am found to have violated the Universitys regulations governing academic integrity.
Name : Answer
Student ID :
Student's Signature :
Remarks :
1.
This is an open book examination.
2.
Answer all questions in the space provided.
3.
Show all your procedures clearly. No marks will be given for unjustified answers.
Questions Maximum Marks Marks
1 20
2 30
3 30
4 20
Total 100
Question 1 (20 marks)
The following diagram shows the interface between the 8051 microcontroller and an audio signal. The audio signal is first to be scaled to the appropriate input operating ranges of the analogue-to-digital converter, ADC0804. The analogue signal is then converted into an 8-bit binary stream, and then sends out from Port 0 for further processing.
i. (3 marks) Write a single 8051 instruction to activate/enable the ADC0804.
CLR P1.7
ii. (6 marks) A polling technique is used to collecting the samples of the analogue signal. The following assembly codes are used to converting the analogue signal into binary stream. The binary stream is then sent out from the port P0 of the 8051 microcontroller for further processing.
AGAIN:
CLR P3.1 ; (1)
SETB P3.1 ; (2)
JB P3.2,$ ;
CLR P3.0 ;
MOV P0, P2 ; (3)
SETB P3.0 ;
SJMP AGAIN ; (4)
What are the execution times for the instructions labeled (1) (2) (3) (4), assuming a standard 8051 with 6MHz crystal and each machine cycle consists of 12 oscillator periods?
(1) ___2s ______, (2) ___2s ______, (3) ____4s _____, (4) ____4s_____, iii. (8 marks) Assuming
a.
the conversion time internal TC for the ADC is 100s,
b.
the units of all the timing in the above timing diagrams are in the range of nano-seconds.
c.
The internal clock frequency of the ADC0804 is 650kHz.
What is the execution time from line (1) to line (4) inclusively? Show your calculation.
CLR P3.1 ; 2s
SETB P3.1 ; 2s
JB P3.2, $ ; 100s
CLR P3.0 ; 2s
MOV P0, P2 ; 4s
SETB P3.0 ; 2s
SJMP AGAIN ; 4s Total = 116 s
iv. (3 marks) What is the maximum sampling frequency of the audio signal if the assembly codes in (ii) are employed? Show your calculation.
1
Sampling frequency = = 8620 Hz
116s
Question 2 (30 marks)
Below shows the internal DATA memory (RAM) for 8051
Bold faces are the addresses and the italics are content of the addresses.
Add Data Add Data Add Data Add Data Add Data Add Data Add Data Add Data
20H 60H 21H 07H 22H 64H 23H 25H 24H 0CH 25H 0DH 26H EEH 27H FFH
18H 34H 19H 08H 1AH 24H 1BH 28H 1CH 0BH 1DH 0EH 1EH 0DH 1F