CSE466 | Class Schedule | Lab Updates | Syllabus | Web Resources | Final Project | Lab 8 | Lab 7 | Lab 6 | | Email Archive | Hardware Lab |
Your final project will consist of a stepper motor (controlled by the Atmel) with an IR transmitter/receiver mounted to the top. You will move the IR transmitter around and communicate with various objects. There will be 4-5 opponents placed in a configuration similar to the figure below.
Turn-in rank | Serial Numbers Turned In | ||
---|---|---|---|
2 | 3 | 4 | |
First | 5 | 6 | 7 |
Second | 4 | 5 | 6 |
Third | 3 | 4 | 5 |
Fourth | 2 | 3 | 4 |
Fifth | 1 | 2 | 3 |
All message traffic will be in ASCII (using the ASCII hexidecimal represenation of the number, so a 1 byte number is sent as two ASCII characters). The palm pilot and ATmega16 should be configured with 8 bits, 2 stop bits, no parity, and 9600 baud. Note that Atmel's may not impersonate the Center.
Code | ASCII equiv | Hex | Dec |
---|---|---|---|
ENQ | ENQ | 0x05 | 5 |
ACK | ACK | 0x06 | 6 |
EOT | EOT | 0x04 | 4 |
CAK | DC1 | 0x11 | 17 |
NAK | NAK | 0x15 | 21 |
SOH | SOH | 0x01 | 1 |
STX | STX | 0x02 | 2 |
RQ1 | ETB | 0x17 | 23 |
RQ2 | CAN | 0x18 | 24 |
RQ3 | EM | 0x19 | 25 |
RQ4 | SUB | 0x1A | 26 |
RQ5 | ESC | 0x1B | 27 |
Once a handshake has been completed (ENQ, ACK), each party should
try for up to 3 times (If you are receiving NAKs) or 300 milliseconds.
Note that you will be sending ENQs; if you
hear an ACK you continue with the Searcher side. If you hear an ENQ you
send an ACK and continue with the Receiver side.
Checksum: the checksum is a 8-bit sum of the two ASCII hexadecimal characters in the message. If the checksum you receive is not equal to your own results, you should indicate an error by sending NACK.
Searcher sends | Receiver sends |
---|---|
ENQ (one every |
|
ACK | |
Serial number, ASCII hexadecimal (2 chars, MS first) | |
Checksum of serial number characters | |
EOT | send NACK if error and
go
to Listen |
Serial number, ASCII hexadecimal (2 chars, MS first) | |
Checksum of serial number characters | |
EOT | |
ACK or NACK |
Center sends | Atmel sends |
---|---|
SOH (one every |
|
RQ1-RQ5 | |
2 ASCII hexadecimal (2 chars, MS first) | |
Checksum of message characters | |
EOT |
The turn-in protocol has been modified to provide feedback on the
turn-in. On a valid turn-in, the center will send back CAK and a
Checksum. The Atmel should verify the returned checksum against an
internally calculated checksum to make sure that no corruption
occurred. To
make sure there is no advantage to spam the turn-in receiver to get the
center position, once you send STX to the receiver, you must do a
successful turn-in within 60 seconds, or lose.
Checksum: the checksum is a 8-bit sum of the entire message,
beginning with STX and including EOT. If the checksum you receive from
the center is not equal to your own results, you should assume that the
message did not transmit properly. Send the entire message again.
Atmel sends | Center sends |
---|---|
STX | |
5-byte message in binary | |
My Serial number in binary | |
Serial number 1 in binary | |
Serial number 2 in binary | |
Serial number 3 or 0 | |
Serial number 4 or 0 | |
EOT | |
CAK |
|
Checksum |
Note that the Atmel now sends STX rather than SOH, so that you can't
try to "turn-in" to other Atmels to slow them down.