You are on page 1of 16
suut \ UNIVERSITI TEKNIKAL MALAYSIA MELAKA UNIVERSITI TEKNIKAL MALAYSIA MELAKA PEPERIKSAAN AKHIR SEMESTER I FINAL EXAMINATION SEMESTER I SESI 2018/2019 SESSION 2018/2019 FAKULTI TEKNOLOGI KEJURUTERAAN ELEKTRIK DAN ELEKTRONIK KOD KURSUS > BEEC 3444 COURSE CODE BEEC 3444 KURSUS : TEKNOLOGI MIKROPEMPROSES & MIKROPENGAWAL COURSE MICROPROCESSOR & MICROCONTROLLER TECHNOLOGY PENYELARAS : IMRAN BIN HINDUSTAN COORDINATOR PROGRAM : 3BEEE & 3 BEEC PROGRAMME 3 BEEE & 3 BEEC MASA > 9,00 am - 12.00 pm TIME 9.00 am 12.00 pm TEMPOH : 3JAM DURATION 3 HOURS TARIKH : 31 DISEMBER 2018 DATE (31 DECEMBER 2018 TEMPAT : BILIK KULIAH 41-42 & 43 K. TEKNOLOGI VENUE LECTURE ROOM 41-42 & 43 K. TEKNOLOGI ARAHAN KEPADA CALON INSTRUCTIONS TO CANDIDATES 1, Jawab TIGA (3) soalan pada BAHAGIAN A dan SATU (1) soalan sahaja pada BAHAGIAN B. Answer THREE (3) questions in PART A and ONE (I) question only in PART B. 2. Tuliskan semua jawapan anda di atas kertas jawapan yang disediakan. Write your answer on the answer sheet provided. 3. Setiap jawapan kepada soalan hendaklah dimulakan di muka surat yang baru. All answers to the questions should be written in a new page. KERTAS SOALAN INI TERDIRI DARIPADA (15) MUKA SURAT SAHAJA (TERMASUK MUKA SURAT HADAPAN) THIS QUESTION PAPER CONTAINS (15 ) PAGES INCLUSIVE OF FRONT PAGE SULIT (BEEC 3444) SULIT BAHAGIAN A SOALAN I a) b) d) Senaraikan dan terangkan sekurang-kurangnya TIGA (3) elemen piawai di dalam ‘mana-mana sistem mikropemproses asas, {6 markah) Terangkan secara ringkas TIGA (3) Komponen utama mikropemproses beserta fungsinya sekali bagi setiap satu. [6 markah} Binakan peta memori bagi mikropemproses MC68000 dan tentukan julat alamat memori yang boleh dicapai, [4 markah] Anda diminta untuk menghasilkan sistem berasaskan_mikropemproses Motorola 68000 yang mempunyai ingatan sebanyak 16K word EPROM dengan alamat permulaan pada $600000 dan 16K. word RAM dengan alamat permulan pada $700000. Hasilkan penyahkod alamat penuh untuk sistem ini dengan menggunakan 16Kx8 chips untuk EPROM dan RAM tersebut. [9 markab] (25 MARKAH] SULIT SOALAN 2 (BEEC 3444) SULIT a) Daftar status mengandungi Daflar Keadaan Kod (CCR) yang digunakan untuk menunjukkan keputusan perlaksanaan bagi sesuatu program, Terangkan fungsi bagi semua bendera Daftar Keadaan Kod seperti yang ditunjukkan dalam Rajah S2(a). Bait Sistem Bait Pengguna 1 Ct f la 14013 2 1 10 9 8 7 4 3 1 0 [t [s ee [2 Jo x[n[z[vlc CCR Rajah $2(a) [5 markah] b) — Carikan nilai bagi setiap destinasi operand selepas arahan-arahan berikut dilaksanakan mengikut urutan. Diberikan nilai D1 = D3 = $12005678. a @ (iii) Gy) w) (vi) (vii) MOVE.W CLR EXG SWAP, ADD.W NOT.W BSET.B D1, D2 D2 D2, D3 DI #96100, D3 D2 #3, D3 $12340000, D2 = $AA11BBI2, dan [7 markah] ©) Berdasarkan kod program yang diberikan, ramalkan nilai DO, DI dan bendera Daftar Keadaan Kod (CCR) selepas arahan-arahan berikut dilaksanakan. SULIT 4) (BEEC 3444) SULIT (i) Diberikan DO = $7856 2134 dan D1 = $87A9 DECC ADD.L DO, D1 Gi) Diberikan DO = $7189 81CD dan D1 = $0400 0188 LSR.W #7,D1 [4 markah] Tuliskan bahasa pemasangan untuk mengaturcara mikropemproses MC68000 yang akan dapat menyelesaikan persamaan matematik berikut: Y=(X+4(X-2) Y adalah pembolehubah 32-bit tidak bertanda manakala X adalah pembolehubah 16-bit tidak bertanda. (9 markah] [25 MARKAH] SULIT (BEEC 3444) SULIT SOALAN3 @ (b) © Sampukan MicroChip PIC16F877A terdiri daripada DUA (2) sumber luaran. (@) — Takrifkan sampukan (2 markah] (i) Bezakan antara DUA (2) sampukan sumber Iuaran tersebut. {6 markah] Diberikan satu masukan analog 3.15V. Kira nombor digital 10 bit yang berkenaan apabila PIC16F877A menggunakan ADC 10 bit. [4 markah] Tuliskan satu atureara CCS C untuk menghasilkan isyarat PWM pada foym= 1.2 kHz, kitar tugas 60%, [8 markah] Terangkan secara ringkas bagsimana untuk menggunakan modul Timer0 sebagai pembilang. [5 markah] [25 MARKAH] aS. SULIT (BEEC 3444) BAHAGIAN B SOALAN 4 SULIT ‘Anda dipertanggungjawabkan untuk memantau suhu suatu ruang proses dalam talian operasi. Sckiranya suhu mencecah 40°C dan keatas, sistem pengudaraan tambahan perlu diaktifkan seperti ditunjukkan dalam Jadual $4. Terdapat dua unit pengudaraan tambahan yang menggunakan motor arus terus (at). Anda diperlukan untuk merekabentuk satu litar mudah yang terdiri daripada PIC16F877A dengan penukar Analog-ke-Digital (ADC) 10 bit, paparan LCD, penderia suhu LM35 yang menghasilkan OV hingga SV voltan analog, dan dua motor arus terus (at). LCD akan memaparkan bacaan suhu yang dikesan oleh penderia LM35. 1°C bersamaan dengan 10mV. Jadual S4 Suhu, T CO) Motor T<40°C Padam T240C Pasang (@ —_ Bezakan antara motor arus terus dan motor servo. (6) Lukiskan sambungan perkakasan litar tersebut, (ec) Tuliskan satu aturcara CCS C untuk litar tersebut, [4 markah} (8 markah] [13 markah] [25 MARKAH] SULIT (BEEC 3444) SOALAN 5 SULIT Satu litar yang terdiri daripada satu PICIOF877A, dua suis tekan butang dan lapan LED disambungkan seperti dalam Jadual $5, Suis tekan butang 1 disambungkan ke pin RAO dan suis tekan butang 2 ke pin RA1. LED tersambung anod disambungkan ke pin RDO hingga RD3 dan LED tersambung katod disambungkan ke pin RD4 hingga RD7. LED tersambung anod akan berkelip serentak empat kali apabila suis tekan butang 1 ditekan dan LED tersambung katod akan berkelip serentak empat kali apabila suis tekan butang 2 ditekan. Jadual SS ‘Komponen ” Samibangan Suis tekan butang 1 Aktif tinggi Suis tekan butang 2 ‘Aktifrendah TEDI, LED2, LED3, LEDS Tersambung anod LEDS, LED6, LEDT, LEDS Tersambung katod @), (b) © Bezakan antara suis tekan butang aktif tinggi dan aktif rendah dari segi sambungan perkakasan dan aturcara CCS C. Lukiskan sambungan perkakasan litar tersebut. Tuliskan satu atureara CCS C untuk litar tersebut. -Soalan tamat- 7. [4 markah]} [8 markah] (13 markah} (25 MARKAH] SULIT (BEEC 3444) SULIT PARTA QUESTION 1 a) List and explain at least THREE (3) standard elements necessary in any b) 4 microprocessor based system. [6 marks) Explain briefly the THREE (3) main components of a microprocessor with their respective functions, (6 marks] Construct a memory map of MC68000 microprocessor and determine the range of memory addresses that can be accessed. [4 marks] You are required to produce a Motorola 68000-based system that contains memory capacity of 16K word EPROM with a starting address of $600000 and a 16K word RAM with a starting address of $700000. Produce a full address decoder for this system using 16K»8 chips for both EPROM and RAM. [9 marks] [25 MARKS] -8- SULIT (BEEC 3444) SULIT QUESTION 2 a) Status register contains the Condition Code Register (CCR) which is used for indicating the result of a program execution. Explain the function of all the Condition Code Register flags as shown in Figure Q2(a). System Byte User Byte n L c Ve 1 Is 14 13 12 WM 10 9 8 7 6 5 4 302 1 2 0 Te: ee: 0 0 ee x |S z{vfe SSS Figure Q2(a) [5 marks] b) Find the value of each destination operand after the following instruction is executed sequentially. Given value for DI = $12340000, D2 = SAAIIBBI2, and D3 = $12005678. MOVE.W DI, D2 CLR D2 EXG D2, D3 SWAP DI (vy) ADD.W — #%100,D3 (vi) NOT.W D2 (vii) BSETB — #3,D3 [7 marks] ©) _ Based on given programmed code, predict the value of DO, D1 and Conditional Code Register (CCR) flags after the following instructions are executed. SULIT ad (BEEC 3444) SULIT @ Given D0 = $7856 2134 and D1 = $87A9 DECC. ADD.L DO, DI (i) Given D0 = $7189 81CD and D1 = $0400 0188 LSR.W #7,D1 [4 marks} Write an assembly language program for MC68000 microprocessor that will solve the following mathematical equation: Y= (K+4X-2) Y is an unsigned 32-bit variable while X is an unsigned 16-bit variable [9 marks} [25 MARKS] -10- SULIT (BEEC 3444) SULIT QUESTION 3 (@) — MicroChip PIC16F877A interrupt has TWO (2) external sources. (@) Define interrupt. (2 marks] (i) Differentiate between the TWO (2) interrupt external sources, [6 marks] (>) Given an analog input is 3.15V. Calculate the corresponding 10 bit digital number when the PICI6F877A uses a 10 bit ADC. (4 marks] (©) Write a CCS C codes to generate a PWM signal at fwn= 1.2 KHz, 60% duty cycle. [8 marks} (d) Explain briefly how to use Timer0 module as a counter. [5 marks] [25 MARKS] -ll- SULIT (BEEC 3444) SULIT PARTB QUESTION 4 You are responsible to monitor temperature of a process area in an operation line. If the temperature reach 40°C and above, auxiliary ventilation system needs to be activated as shown in Table Q4. There are two units of auxiliary ventilation which using direct current (dc) motors. You are required to design a simple circuit which consists of a PICI6F877A with 10 bit Analog-to-Digital converter (ADC), LCD display, LM35 temperature sensor which output OV to SV analog voltage, and two direct current (dc) motors. The LCD will display the temperature readings sensed by the LM35 sensor. 1°C is equivalent to 10mV. Table Q4 Temperature, T @C) Motor T<40°C OFF T= 40°C ON (@) Differentiate between de motor and servo motor. [4 marks] (6) Draw the hardware circuit connections. [8 marks} (©) Write a CCS C program for the circuit. [13 marks} [25 MARKS] “12s SULIT (BEEC 3444) SULIT QUESTION 5 A circuit consists of a PICI6F877A, two push buttons and eight LEDs are connected as shown in Table QS. The push button | is connected to pin RAO and push button 2 to pin RAL. The common anode LEDs are connected to pin RDO to RD3 and the common cathode LEDs are connected to pin RD4 to RD7 respectively. The common anode LEDs will blink simultaneously four times when the push button 1 is pressed and the common cathode LEDs will blink simultaneously four times when the push button 2 is pressed. Table QS ‘Component Connection Push button 1 Active high Push button 2 Active low LED1, LED2, LED3, LED4 ‘Common anode LEDS, LED6, LED7, LED8. ‘Common cathode (a) __ Differentiate between active high and active low push buttons in terms of hardware connection and CCS C code. [4 marks} (6) Draw the hardware circuit connections. (8 marks} (©) Write a CCS C program for the circuit. (13 marks} [25 MARKS] -End of questions- -13- SULIT Appendix 1 (BEEC 3444) Moeerola 68000 Instruction det Instructien Desersption ama ADDE nog ASL cH BouR aset BSR rst LR nea, cone nen Dace Drv. prw ORT ko Ex? Hubgonn oP sR BEA, ‘uate ASA ROD with extend 20D binary ADD bisiary to Aa ADD Tmnediare AUD J-bit Semediate ADD extended Bit-wine AND Ascembler Syntax Bx, Dy $0) a, Wet =8», cea» Dy. = iy) = ta “,Dn Da, Bit-wise AND With Immediate — Gedatan,coas Arithmetic Shige Left Axithmeric shite nighe Conditional Branch ese 0 ait and Change Tene 4 Bit end cheaR ‘Toot a ait and SEF Rel-85, Dy Dey Beo.8 dabel» Boo. sTabel> Dn, eens sedated, cous bons ciabel> Date site a ee ie Bet we aw Be ba BL at Bet oat BM Dy ne Bw BAL at ob ax Beeneh £0 SubRoutine BERN label> bie vest Da, Aedaeas, eas cwesk Dn Against Bounds ‘eayon Clear eae Compare «eur. comeare address preety Conrare Immeasace weaeras, caus ConPare Menoxy (yy) +, ae) + Looping Instruction Dice Da, abel» Divide signed seay,on DIvids Unsigned Logical smite Late Dx, oy bends soy Logiesl shite eight -14- SULIT condition code SULIT Appendix 2 owe wow Move mov oer passe ROL ROXL Ree. mee aco stor sue soar sung (BEEC 3444) MOVE Pertphmral, Move s-bit immediate mut iply Signed mut iply Vosigned, Msgate aco mote HaGate with extend Ro OPeratiou Form one's complemen Bitrwise OF Bie-wise OR with Temediace Posh Eefactive nddraas RESET ai] external devices Roeste Lett Rotate aighe Rocaee Inge with extend Rotate Right. with extend Refurn from Bxcepeion ergrn and Restore Return from Subraveine Subtract BCD with extend Set to «1 4¢ True, 0 4 Falee Rnable & wait for’ interrupte suseract binary suueract binary trom An subcract Inmodiate supteact abit dnaddate suBtract extended SURP words Of Dn Teer & Sat SB 4 Sot H/2-bite Execute TRAP Exception TRAPY Excepeion if V-bit fet Test for negative ox tere Desllocate stack Prane -15- sear cea> “ean 28 UsPian 4n, US? 049,20 sraginear lists, ,cresister ilots Bn, xtand x(a) ,Da fe-d8 e272 on Heaatas, Reont ai-B> by De, Dy ie nro bx, Dy = aed ay) fedatan Da, stay Da sens 2a by. De = (ay), 00 Bh sxvector> TRARY it on Bat pet BR BRL Bee Be ewe “Wt m™ Bw it z SULIT SULIT

You might also like