{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

# ANSFA - E C E 4 1 7 5 A F in a l 4-3 0-0 9 N IN E PR O B LE...

This preview shows pages 1–2. Sign up to view the full content.

ECE 4175A Final 4-30-09 Page 1 of 3 High 103 NINE PROBLEMS Upper quarter 87 Open book, open notes Median 82 Lower quarter 72 Low 47 1. [ ] I have completed the CIOS course evaluation. [5%] [ ] I have not completed the CIOS course evaluation. 2. A retriggerable one-shot is a device that generates an output pulse in response to a rising input edge. A resistor and capacitor connected to the device sets the pulse width (e.g.,two seconds). The “retriggerable” [20%] feature means that if another rising edge occurs while the output pulse from a previous rising edge is still being generated, the pulse extends for another two seconds from the time of this new edge. For this problem you are to write a function called OneShot that is called each time around the ten- millisecond main loop and that examines a global char variable called TRIGGER . If TRIGGER is set to a non-zero value, OneShot clears TRIGGER to zero and initiates the generation of a two-second output pulse on pin RE2 of PORTE and returns. At the end of two seconds worth of loop times, RE2 is cleared. If while RE2 is set, OneShot is called and finds TRIGGER again set to a non-zero value, RE2 is continued set for another two seconds from this point. Use a local static unsigned char variable called TRIGCNT to keep track of the two-seconds worth of loop times. void OneShot() { static unsigned char TRIGCNT = 0; if (TRIGGER) { TRIGGER = 0; PORTEbits.RE2 = 1; TRIGCNT = 0; } if (TRIGCNT == 99) {PORTEbits.RE2 = 0;} else {TRIGCNT++;} } 3. Assume that the Timer3/CCP1 input capture mode of the 4321 chip is using Fcpu = 1 MHz as its clock. The leading edge of a pulse is captured into the sixteen-bit register, CCPR1, as 0xFEDC while the trailing [ 5%] edge is captured as 0x1234. What is the pulsewidth (expressed in microseconds), assuming no aliasing has occurred? Show all work clearly. 0x1234-0xFEDC = 0x1234+(0x0123 + 1) = 0x1358 = 4952 : s 4. I have ordered a \$35 2x20 character Noritake VFD display similar to the one Glen Akins used in his Inclinometer. It is specified to (typically) draw 130 mA when all its pixels are turned on but only 2 mA [15%] when all are turned off. Once the display has been sent its message to be displayed, the pixels can be turned off by sending the command 0x08 and turned back on by sending the command 0x0C.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}