218C - ANSEL aTOMs

Code

Below are the C and Assembly source files used in our project.  While every file contains inline comments, for a more general view of the functionality of our code, please see either the ACV State Machines or CVC State Machines page.

General

Global Header Files


ACV Code

ACV Xbee PIC

The ACV Xbee PIC is responsible for sending team finding and atoll capture messages, as well as receiving and interpreting commands from the CVC for distribution to the Motor Driver PICs.

Security Controller PIC

The Security Controller PIC is responsible for extracting a scanned card's serial number from the RFID PIC, obtaining a security key from the Security Controller, and passing the necessary data to the Xbee PIC.

RFID Reader PIC

The RFID Reader PIC, whose code was written in Assembly, receives the ASCII-encoded serial number from the RFID reader, translates these to Hex, and then sends the serial number to the Security Controller PIC.

Motor and Servo PICs

Two identically coded Motor and Servo PICs interprets the commands sent by the AVC Xbee PIC and sends PWM signals to the motor drivers.  An input line tied high or low on each PIC determines which motor it would control.

RFID Spoof PIC (God Mode)

This PIC lived in the moral gray area.  A board with this PIC on it can replace the RFID reader itself.  When an input line is set high, this PIC sends faked scans of every atoll to the Security Controller and RFID Reader PIC.  This allowed us to capture every single atoll near simultaneously, and without moving.

CVC Code

CVC Xbee PIC

This PIC was responsible for sensing inputs and the interpretation of these inputs into a motor mapping; it was subsequently responsible for the transmission of the motor commands. In addition, the PIC had to receive either score or team color updates and update the appropriate servos through UART to the "Display Servos PIC". 

Display Servos PIC