The following page outlines the various state machines implemented on the coach, player and LiFKIM PIC. Associated C Code files are listed on the code subpages. All systems except the LiFKIM PIC utilized the Events and Gen2.2 Framework provide by the course.
Player C Code
Coach C Code
LiFKIM Assembly Code
Player State Machines
Player Top level functional state machine. This machine sets the waiting to be paired state or the paired state. In WaitLink the machine responds to pair request or relays messages. In the Paired state, the machine relays messages, waits to be tagged out, or signal to set outputs accordingly.
UART receiver state machine. This machine processes messages from the XBee via UART and signal other machines to good received packets.
UART transmitter state machine. This machine receives request to send out messages and sends the message over UART via the XBee.
Decision tree for player while in WaitLink. As the player is waiting, this decision tree processes good messages received and then responds accordingly.
Decision tree for messages when in Paired State. As the player is paired, this decision tree processes good messages and then responds accordingly depending on the message contents.
SPI state machine for communicating with the LiFKIM.
Player - LiFKIM PIC SPI State Machine
Coach PIC State Machines
Coach top level state machine. This machine keeps track of what state the coach is in, Idle, Waiting for pairing, or Paired. Within each state it gets good message events and then process each message and responds accordingly.
UART transmit state machine.
UART receive state machine.
Decision tree for messages received while the Coach is in the IDLE state.
Decision tree fro processing message while coach is in the WaitPair state.
Decision tree for processing message while coach is in the Paired state.
SPI machine for communicating with the Coach C32