Problem 1, Digital Camera Design (20pts)

Complete the schematic for this digital camera (this is a purely qualitative exercise). The black circles indicate missing connections. Your job is to choose the most appropriate way to interface the device to microprocessor and to fill any other necessary devices that are missing including those needed for protection. Missing components might include analog amplifiers (single-ended or differential), plain wires, resistors, capacitors, inductors, diodes, and transistors. The shutter is open when the coil is energized and closed otherwise. Give a sentence or two to explain each choice. You don’t need to give sizes or values for the components. Assume that the microprocessor is a variant of the 8051 that has two analog inputs with internal analog to digital converters. You cannot assume that the analog inputs are high impedance.


Problem 2: Microcontroller Memory Architecture

A. Explain what the C compiler would have to do to convert this code into 8051 assembly by showing all the necessary segment declarations and explain what goes into each segment. Yes…it is possible. Don’t worry too much about using proper 8051 assembly instructions and directives; just provide pseudo-assembly code for the contents of any code segments, but make sure you are clear about addressing modes and intent (use comments if necessary). (20 pts)

 

unsigned byte table[8] = {1,2,3,4,5,6,7,8};  
int i;

void main() using 0 {  // tells compiler to use register bank 0

      while (1)

for (i = 0; i<8; i++) {
       table[i] = table[i]+1; 

 P1_0 = ~P1_0;
}

}
// defines interrupt function for external interrupt INT1

void external_handler(void) interrupt 2 using 1 { // register bank 1
      P1_0 = ~P1_0;
}


B. Draw the expected waveform on P1.0 if external interrupt int1 were enabled.  Assume that the time between dotted lines is equal to one iteration of the inner loop, which is equal to the execution time of the external interrupt handler. (10 pts)

 

 

 



Work space