Technical log entry 3- 10-11-09


 
WOW, the handshake works... now the hardest bridge to cross; verifying the SAME program on two devices...

Determine the actual wait time per face.
-65000 counts gives 156mS (approx 2.4uS per count)

Assuming a handshake on one face involves the transfer of the entire global database (20 bytes) + handshaking (4 bytes) = about 24 bytes of data.
Assuming delays for processing etc, and at 230Bps this is about 120mS per face.

The initial wait for the cube to have transactioned with 5 faces should be around 600mS.

The actual collision avoidance delay should be as small as possible. To avoid a collision we need to allow enough time for one cube to have sent a hello and this to be received in the buffer and acted upon.
Theoretcally, this is only 1/230Bps max = 4.3mS (to transfer 1 byte of data (HELLO))
To be safe, try 7mS.

To wait for sync = 600mS = 250000 counts
Collision avoidance = 7mS = 2917 counts

define WAITFORSYNC_COUNT 25000