CS594Fall14 HW 08 Key - HW Answer Key PDF

Title CS594Fall14 HW 08 Key - HW Answer Key
Author Nonya Bs wax booboo
Course Microprocessor System Design
Institution Wichita State University
Pages 2
File Size 159.5 KB
File Type PDF
Total Downloads 12
Total Views 159

Summary

HW Answer Key ...


Description

CS 594 Microprocessor Based System Design

Fall 2014 DRZ

(Take Home) HW-08 Due: before class on Oct/30

It is extremely important that you unde rstand the homework assignments; please participate in the classroom discussion. You are expected to solve the homework assignments individually. You are encouraged to discuss with your friends. However, do not copy. Follow the submission and grading policies. Show all steps with your solutions for full points.

NAME & WSU ID: KEY / 50 Note: Up to 10% marks may be subtracted if not submitted/stapled properly. The following questions are based on Labs 7 and 8. (1 point per question) 1. What is used to represent the input? (Key: Pushbutton / GND) 2. What is CodeWarrior KBI? (Key: Keyboard Interrupt – a special firmware interrupt) 3. How does KBI work? (Key: When pressed, code execution is re-routed to the KBI event) 4. KBI can be programmed using only the interrupt technique. True or False? Why? (Key: False. KBI can be programmed using both polling and interrupt techniques) 5. What are the KBI I/O pin values? (Key: PTB7_, PTB6_, PTE2_, and PTE1_) 6. Name the software and version number used. (Key: Code Warrior Version 10.x) 7. Name the hardware used. (Key: Freescale DEMOEM board) 8. Name the microcontroller used. (Key: Coldfire V1 / MCF51EM family) 9. Name the CPU used. (Key: MCF51EM256CLL 32-bit ColdFire V1 CPU) 10. Name the BDM Programmer used. (Key: P&E Embedded USB Multilink)

11. (20 points) Briefly discuss the following terms for writing efficient C code for embedded systems: (a) Infinity Loop, (b) Global Variables, (c) Division and Modulus, and (d) For Loop Key: (a) Infinity Loop – allowed, needed, must! (b) Global Variables – avoid if possible (c) Division and Modulus – avoid if possible (d) For Loop – countdown, avoid if possible 12. (20 points.) Re-write the logic used in Lab-07 so that after 60 blinks (approximately) the LED remains ‘on’ (and does not become ‘off’ unless the supply power is ‘low’). Provide adequate comments. Submit ProcessorExpert.c and Events.c files. [Hints: Change code in ProcessorExpert.c and Events.c. Use a counter.] Continue to next page…

Dr. Zaman (WSU-5261)

EECS Depart ment , Wichita State University

Page 1 of 2

CS 594 Microprocessor Based System Design

Fall 2014 DRZ

(Take Home) HW-08 Due: before class on Oct/30

/* Q#12 – one possible solution */ /* File: ProcessorExpert.c */ … bool timer_flag = FALSE; byte blink_count = 0; … void main (void) { … /* my loop starts here */ for ( ; ; ) { if (blink_count < 120) /* for two interrupts per second */ { if (timer_flag == TRUE) { Bit1_NegVal(); timer_flag = FALSE; }/* end of timer if */ }/* end of blink if */ else Bit1_ClrVal(); /* make LED on */ }/* end of for */ …

/* File: Events.c */ … extern bool timer_flag; extern byte blink_count; void TI1_OnInterrupt (void) { /* Write your code here ... */ timer_flag = TRUE; if (blink_count < 120) /* Why this check is needed? Ask the instructor. */ blink_count ++; }/* end */ …

Dr. Zaman (WSU-5261)

EECS Depart ment , Wichita State University

Page 2 of 2...


Similar Free PDFs