{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

# ANS1 - 1 25 H igh 100 U ppe r qua rte r 87 M e dia n 82...

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

ECE 4175 QUIZ 9-24-08 (1 of 2) High 100 SEVEN PROBLEMS Upper quarter 87 Open book, open notes Median 82 Lower quarter 69 Low 46 1. Consider the following function taken from a qwik.lst file. Assume that this has been generated from a function called “DisplayRX.” Bit 5 of the PIR1 register is called RCIF. Recreate the C code for the [25%] DisplayRX function to the right of the lines below. void DisplayRX() { 0588 AA9E BTFSS PIR1,5 if (PIR1bits.RCIF) 058A D004 BRA L072 { 058C 50AE MOVF RCREG,W LCDSTRING[3] = RCREG; 058E 6E0C MOVWF LCDSTRING+3 0590 0E01 MOVLW 0x01 LCDFLAG = 1; 0592 6E3C MOVWF LCDFLAG } 0594 0012 L072 RETURN } 2. A question has arisen about QwikBug’s single stepping operation. We want to know whether the latest line that is highlighted in the source file window in response to a step command has (1) just been [15%] executed or (2) will be executed in response to the next step command. To check this, consider how we might use the following BlinkAlive function and note when the LED turns on in response to single stepping. void BlinkAlive() { PORTDbits.RD4 = 0; // Turn off LED if (++ALIVECNT == 250) // Increment counter and return if not 250 { ALIVECNT = 0; // Reset ALIVECNT PORTDbits.RD4 = 1; // Turn on LED for 16 ms every 4 secs } } a. If you set a breakpoint on the ALIVECNT = 0; line and then run to the breakpoint, will the LED be turned on at that point? [ ] Yes [ x ] No b. W hen the PORTDbits.RD4 = 1;

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 ]}

### Page1 / 2

ANS1 - 1 25 H igh 100 U ppe r qua rte r 87 M e dia n 82...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online