My First Viking Longship
Communications: Pairing
Home
The Game

Water Craft

Helm

Communications

     Protocol
     xBee
     Pairing
Gems of Wisdom
Media
The E128 and Smart PIC start out waiting to detect the iButton. Upon detecting the presence the iButton, each processor will start a series of reads. A serial number is deemed valid when the same serial number is read several times consecutively. A valid serial number will cause the helm to broadcast the iButton pairing message. If the ship detects a valid pairing message, it will respond with a matched message, causing the helm to initiate the pregame sequence.

Once the Smart PIC confirms that a valid source address has been received, it will initiate a series of transmissions over the SSP. The Dumb PIC starts out waiting to receive the source address from the iButton. After three successful reads, the Dumb PIC will initiate a majority voting scheme. If two or three of the same serial numbers are detected, they will be flagged as valid. Otherwise, the last serial number detected is set as valid. The Smart PIC will greatly oversend the source address to ensure that three successful reads have taken place.

At this point, the helm should know that the ship has been successfully paired, and both the smart and dumb PIC should have the correct source address to check the origin of valid messages. Each message received by the ship XBee is parsed and acted upon by both PICs. When necessary, the Smart PIC will initiate transmission via the XBee.

State diagrams outlining this pairing process may may be found here.