CSE466 | Class Schedule | Lab Updates | Syllabus | Web Resources | Final Project | Lab 8 | Lab 7 | Lab 6 |    | Email Archive | Hardware Lab

CSE466-02au Final Project Competition Specification

Last update:Sunday, 05-Oct-2003 16:38:52 PDT

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.

Game

There will be 5 preliminary rounds (enough that so that every project can participate) three heats each, scores averaged, where your team will square off between 4-5 opponents. The winners of the preliminary rounds will advance to the final round. The winners of the final round will receive a small amount of extra credit, and great glory. The basic idea of the game is to complete 4 tasks and transmit the results to our readers as soon as possible.

Competition Tasks

  1. Obtain two other serial numbers.
  2. Obtain the 5-byte message from the central transmitter/receiver.
  3. Ensure that your serial number is transmitted to as many others as possible.
  4. Send the completion data to the central receiver.

Scoring

Completion of the tasks, points will be awarded by order received, # of Serial Numbers collected, and # of times your serial number is turned in by others(1 pt. each):
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

Game Play

Startup

Everyone will receive their serial number for the round from a course staff member. Palm pilots will be placed on the table, and when the Go signal is given, a team member will pick up the pilot, enter their serial number, and up to 4 optional configuration variables. The Palm must transmit this information to the ATMega16. Once the Atmel has received the info, it begins to search for other Atmels and the center. The Atmel should come up with the motor powered off (all outputs = 0) so that the TAs can position the motor to an arbitrary position. The motor should be started after receiving the serial number and configuration variables. One variable may be used to tell the Atmel what direction to start scanning, if desired.

Serial Number Exchange

One of the goals of the competition is to spread your serial number to as many people as possible, while collecting their serial numbers. Protocol 1 details how two Atmels will locate each other and exchange serial numbers. Serial numbers will be 8 bits, in the range 1-255, communicated to your Palm in decimal.

Central Message

One of the components of completing the turn-in is acquiring the 5-byte (10 characters in ASCII 0-9,A-F) from the spinning central transceiver. For example, if the first message is 0xf8, then it will be transmited as ASCII f and ASCII 8. The transceiver will spin back and forth, and respond toProtocol 2. It will only give out 1 byte of the message to an Atmel per revolution.

Turn-in

After the Atmel has collected 2-4 serial numbers and the 5-byte message, it needs to turn in via Protocol 3. The order of turn-in's is determined by the last turn-in.

Protocols

competitor setupThis will be updated

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.

Codes used

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

Protocol 1: Atmel to Atmel search and serial exchange

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 3 300 ms, then listen)

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

Protocol 2: Atmel to center message request

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 assume a transmission error, and not use the data. You will need to re-request the data (start over, look for SOH).

Center sends Atmel sends
SOH (one every 3 300 ms, then listen)

RQ1-RQ5
2 ASCII hexadecimal (2 chars, MS first)
Checksum of message characters
EOT

Protocol 3: Atmel to center turn-in

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.