Difference between revisions of "CSC270 Final Exam 2012"

From dftwiki3
Jump to: navigation, search
Line 3: Line 3:
  
 
<onlydft>
 
<onlydft>
 +
=<center>CSC270 Final Exam 2012</center>=
  
=Problem #1=
+
<bluebox>
 +
::''This exam is given under the rules of the <b>[http://www.smith.edu/sao/handbook/socialconduct/honorcodestatement.php honor code].</b><br>It is open books, open notes, open Web.  However, until the deadline is passed, you cannot discuss  any of the details of this exam with anybody except your instructor.  This includes live conversation, email, sms, any mode of electronic communication.''
 +
 
 +
::''If  you have questions about this exam, email them to your instructor and the question and its answer will be emailed back to the whole class. This way everybody will have access to the same material and information.''
 +
 
 +
::''The exam is due at <b>noon</b> on Thursday, <b> May 10th</b>''.  Please drop it under your instructor's door, or leave it with Daryl Jett in the main office on the second floor of Ford Hall, opposite FH241.
 +
 
 +
::''You must demonstrate the correct operation of your hardware.  Please make an appointment in advance for a 10-minute demonstration.  The demonstration cannot be made past the noon deadline on 5/10/12.'' 
 +
</bluebox>
 +
<br><br><br>
 +
==Problem #1 (3.5 points)==
  
 
The Arduino uses the handshake protocol to send characters out.  It sends all the ASCII characters from 'A' to 'Z', and starts over.  It sends an active-low Strobe signal and listens to an active-low Ack signal.  The Arduino waits 1/2 second between each character.  Whenever it sends 'A' it activates its yellow on-board LED.  The LED is turned off when a 'B' (or any character other than 'A' is sent). This LED turns ON every 13 seconds approximately, and stays ON for approximately 1/2 second (26 characters * 0.5 sec = 13 sec).
 
The Arduino uses the handshake protocol to send characters out.  It sends all the ASCII characters from 'A' to 'Z', and starts over.  It sends an active-low Strobe signal and listens to an active-low Ack signal.  The Arduino waits 1/2 second between each character.  Whenever it sends 'A' it activates its yellow on-board LED.  The LED is turned off when a 'B' (or any character other than 'A' is sent). This LED turns ON every 13 seconds approximately, and stays ON for approximately 1/2 second (26 characters * 0.5 sec = 13 sec).
  
Your assignment is to design a system that will receive the characters, and turn ON its own LED whenever it sees the code for 'A'.  This way your receiver hardware will blink synchronously with the Arduino.  The LED should stay ON for about 1/2 second.
+
Your assignment is to design a system that will receive the characters, and turn ON its own LED whenever it sees the code for 'A'.  This way your receiver hardware will blink synchronously with the Arduino.  The LED should stay ON for about 1/2 second.
  
 
<br />
 
<br />
Line 51: Line 62:
 
// takes the character ch and puts its 5 LSBs on
 
// takes the character ch and puts its 5 LSBs on
 
// pins D0, D1, D2, D3, and D4.
 
// pins D0, D1, D2, D3, and D4.
void sendChar( ) {
+
void sendChar( char c ) {
 
   byte mask=1;
 
   byte mask=1;
 
   int  pin = D0;
 
   int  pin = D0;
 +
 
   for ( int i=0; i<5; i++ ) {
 
   for ( int i=0; i<5; i++ ) {
 
      
 
      
     if ( ch & mask )   
+
     if ( c & mask )   
      digitalWrite( pin, HIGH );
+
        digitalWrite( pin, HIGH );
 
     else
 
     else
      digitalWrite( pin, LOW );
+
        digitalWrite( pin, LOW );
 
     pin += 1;
 
     pin += 1;
 
     mask <<= 1;
 
     mask <<= 1;
 
   }
 
   }
  ch = ch + 1;
 
  if ( ch > 'Z' ) ch = 'A';
 
 
}
 
}
  
Line 92: Line 102:
 
   if ( ch == 'A' )
 
   if ( ch == 'A' )
 
     digitalWrite( 13, HIGH );
 
     digitalWrite( 13, HIGH );
   sendChar();
+
   else
  delay( 500 );  // wait 1/2 second
+
    digitalWrite( 13, LOW ); // turn LED OFF
  digitalWrite( 13, LOW ); // turn LED OFF
+
  sendChar( ch );
 
    
 
    
 
   // set STB low
 
   // set STB low
Line 101: Line 111:
 
   // wait for ACK to go low
 
   // wait for ACK to go low
 
   while ( digitalRead( ACK ) == HIGH )  
 
   while ( digitalRead( ACK ) == HIGH )  
     delay( 100 ); // wait  
+
     delay( 10 ); // wait  
 
      
 
      
 
   // bring STB back up
 
   // bring STB back up
Line 108: Line 118:
 
   // wait for ACK to get back up
 
   // wait for ACK to get back up
 
   while ( digitalRead( ACK ) == LOW )  
 
   while ( digitalRead( ACK ) == LOW )  
       delay( 100 ); // wait
+
       delay( 10 ); // wait
 +
 
 +
  // When we're here, the character has been absorbed by the receiver.
 +
  // send 0 on all output data bits
 +
  sendChar( 0 );
  
 +
  // wait 1/2 second before sending new char
 +
  delay( 5000 );
 
   state = READY_TO_START;
 
   state = READY_TO_START;
 
}
 
}
Line 115: Line 131:
 
</source>
 
</source>
 
<br />
 
<br />
Feel free to modify this program if needed.  A good introduction to the Arduino and how to download programs to it can be found [http://arduino.cc/en/Guide/HomePage here].  Your solution circuit, however, '''must''' work with the original program.
+
Feel free to modify this program if needed.  A good introduction to the Arduino and how to download programs to it can be found [http://arduino.cc/en/Guide/HomePage here].  Your solution circuit, however, '''must''' work with the original program shown above.
  
 
Your solution circuit should interface with the Arduino as illustrated below:
 
Your solution circuit should interface with the Arduino as illustrated below:
Line 132: Line 148:
 
The Arduino must be connected to a computer via the USB cable to get the appropriate power.  The computer does not need to have the arduino software installed for the Arduino to work.  The Arduino keeps its program in memory when it is powered down.
 
The Arduino must be connected to a computer via the USB cable to get the appropriate power.  The computer does not need to have the arduino software installed for the Arduino to work.  The Arduino keeps its program in memory when it is powered down.
  
=Misc. Information=
+
==Misc. Information==
==Arduino==
+
===Arduino===
 
* The Arduino will keep its program in memory when it is powered off.  This means that as soon as you connect it to a live USB port, the sending program will start.  The Arduino will wait for the receiving hardware to activate ACK and get characters.
 
* The Arduino will keep its program in memory when it is powered off.  This means that as soon as you connect it to a live USB port, the sending program will start.  The Arduino will wait for the receiving hardware to activate ACK and get characters.
 
* You can reset the Arduino and force it to restart the program by pressing the small push-button in the middle of the board.
 
* You can reset the Arduino and force it to restart the program by pressing the small push-button in the middle of the board.
 
* You can easily test whether your Arduino is running properly by connecting its STB to its ACK signal in a loop.  In effect you make it think it has a very very fast receiver that sets its ACK simultaneously as the STB is activated.  In other words, if you connect Pin 3 of the Arduino to its Pin 4, it will think it has a live receiver and will send all the letters of the alphabet in 13 seconds, flashing its LED for 1/2 second once a loop.
 
* You can easily test whether your Arduino is running properly by connecting its STB to its ACK signal in a loop.  In effect you make it think it has a very very fast receiver that sets its ACK simultaneously as the STB is activated.  In other words, if you connect Pin 3 of the Arduino to its Pin 4, it will think it has a live receiver and will send all the letters of the alphabet in 13 seconds, flashing its LED for 1/2 second once a loop.
  
==Arduino Receiver Code==
+
===Arduino Receiver Code===
 
For completeness, the code for the receiving Arduino is shown below.
 
For completeness, the code for the receiving Arduino is shown below.
  
Line 246: Line 262:
 
</source><br />
 
</source><br />
  
=Problem #2=
+
==Problem #2 (1 point)==
  
 
* Simulate your solution circuit for Problem 1 with the Xilinx ISE.
 
* Simulate your solution circuit for Problem 1 with the Xilinx ISE.
* You only need to simulate the circuitry you will have built on the breadboard.  No need to simulate a 6811!
+
* You '''do not need''' to include the derivation of your circuit (e.g. truth tables, except if you circuit is not working as you expected).
* Include a screen capture of your schematics, and a screen capture of the Isim window.  Either the waveform or the output in the console is sufficient.
+
* You only need to generate/simulate the circuitry you will have built on the breadboard.  No need to simulate a 6811!
 +
* Include a screen capture of  
 +
*# your schematics, and of  
 +
*# the Isim window.  Either the waveform or the output in the console is sufficient.
 +
 
 +
==Submission==
 +
 
 +
* Make an appointment to demonstrate the correct operation of your circuit.
 +
* Please return your exam with the Arduino microcontroller and the USB cable in the envelop provided.  You can drop it off at my office or leave it with Daryl Jett in the main office.
 +
 
 +
==Grading==
  
=Submission=
+
* 4.5 = A+, 4.0 = A, 3.7 = A-, 3.3 = B+, 3.0 = B, etc...
  
* Please return your exam with the Arduino microcontroller along with the USB cable in the envelop provided.
+
==Important Information==
 +
* If you decide to design an input port for the 6811, <font color="red">you must make wait and not connect the output of the tristate buffers to the data bus '''until''' you are sure that you have a short negative pulse on the enable of your drivers (assuming an active-low enable).  Once you observe the negative pulse for the enable of the drivers can you complete the connection to the data bus.  See the '''blue signal''' in the photo below for reference.
 +
<br />
 +
<center>[[File:6811IO1.jpg|500px]]<br />(Waveform captured by Tiffany Liu)</center>
 +
<br />
 +
<br />
 +
<br />
 +
<center>'''Good Luck!'''</center>
 +
<br />
 +
<br />
 +
<br />
 +
<br />
  
 +
[[Category:6811]][[Category:csc270]][[Category:arduino]]
 
</onlydft>
 
</onlydft>

Revision as of 22:05, 27 April 2012

--D. Thiebaut 23:04, 25 April 2012 (EDT)



...