01.06.2015 Views

A Performance Analysis System for the Sport of Bowling

A Performance Analysis System for the Sport of Bowling

A Performance Analysis System for the Sport of Bowling

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

2.7.8 Communication with <strong>the</strong> COMM Wand<br />

Communications with <strong>the</strong> module are conducted over a wireless, infrared (IR) interface,<br />

using <strong>the</strong> TSL251 as <strong>the</strong> receiver, and two surface-mount LED's as <strong>the</strong> transmitter. Since<br />

<strong>the</strong> 87C752 does not contain an on-board hardware UART, a s<strong>of</strong>tware UART has been<br />

implemented. The s<strong>of</strong>tware UART con<strong>for</strong>ms to several design constraints specific to <strong>the</strong><br />

SMARTDOT module hardware.<br />

Baud Rates: Due to <strong>the</strong> limited response time <strong>of</strong> <strong>the</strong> TSL251, and <strong>the</strong> relatively<br />

slow conversion rate <strong>of</strong> <strong>the</strong> '752's ADC at <strong>the</strong> module's clock frequency, reliable<br />

reception is only possible up to 600 baud. The communication protocol between <strong>the</strong><br />

module and <strong>the</strong> COMM wand is designed such that <strong>the</strong> module normally receives<br />

single character transmissions from <strong>the</strong> wand. Consequently, <strong>the</strong> 600 baud reception<br />

rate does not create a communications bottle-neck. Since <strong>the</strong> COMM wand can<br />

receive at a much higher baud rate than <strong>the</strong> SMARTDOT module, <strong>the</strong> module<br />

transmits to <strong>the</strong> COMM wand at up to 38400 baud (ano<strong>the</strong>r limitation imposed by <strong>the</strong><br />

module's clock frequency).<br />

Data Frame: A 12-bit serial protocol is used on transmission: 1 START bit, 8 DATA<br />

bits, 1 PARITY bit (EVEN), and 2 STOP bits. An 11-bit protocol (using a single<br />

STOP bit) is used <strong>for</strong> reception. This imbalance in STOP bits guarantees a minimal<br />

extra dead space between back-to-back characters, and allows <strong>for</strong> clock skew between<br />

<strong>the</strong> module and <strong>the</strong> COMM wand.<br />

Bit Sampling: The TSL251 and <strong>the</strong> 87C752's ADC are used <strong>for</strong> serial reception.<br />

The light wave<strong>for</strong>m is sampled at 4800 Hz (8 samples per bit time), and <strong>the</strong> middle<br />

four samples <strong>of</strong> each bit determine <strong>the</strong> value (0 or 1) <strong>for</strong> that bit. Ignoring <strong>the</strong> first<br />

two and last two bit samples allows <strong>for</strong> some clock skew between <strong>the</strong> transmit baud<br />

rate <strong>of</strong> <strong>the</strong> COMM wand and <strong>the</strong> receive baud rate <strong>of</strong> <strong>the</strong> module. A count <strong>of</strong> two or<br />

more DARK middle samples constitutes a logical '1', o<strong>the</strong>rwise <strong>the</strong> bit is considered a<br />

logical '0'. The bias is toward <strong>the</strong> DARK samples since <strong>the</strong> COMM wand's presence<br />

over <strong>the</strong> finger insert creates a dark ambient condition. As long as <strong>the</strong> COMM wand<br />

is held relatively close to <strong>the</strong> insert, <strong>the</strong> background remains dark enough <strong>for</strong> <strong>the</strong><br />

module to discriminate between <strong>the</strong> light pulses (0's), and <strong>the</strong> ambient background<br />

level (1's). A noise margin is also built into <strong>the</strong> bit-sampling scheme. There is a gap<br />

established between <strong>the</strong> DARK and LITE levels, with <strong>the</strong> transition point switched<br />

between <strong>the</strong> two depending on <strong>the</strong> value <strong>of</strong> <strong>the</strong> last sample received, creating a digital<br />

hysteresis function. Refer to Figure A-7 (UART Receive Task Flowchart) and Figure<br />

A-8 (Bit Sample ISR Flowchart).<br />

2.7.9 Communication Protocol<br />

All communications with <strong>the</strong> module are initiated by pressing on <strong>the</strong> insert, and <strong>the</strong>n<br />

placing <strong>the</strong> COMM wand over <strong>the</strong> insert, covering <strong>the</strong> opening. The bowler has one<br />

second to remove <strong>the</strong>ir finger from <strong>the</strong> insert, and ano<strong>the</strong>r second following release to<br />

cover <strong>the</strong> insert with <strong>the</strong> COMM wand. If ei<strong>the</strong>r <strong>of</strong> <strong>the</strong>se conditions is not met, <strong>the</strong><br />

module shuts down and must be reactivated.<br />

Upon activation, <strong>the</strong> module waits <strong>for</strong> release to occur, as previously described. When it<br />

identifies a release condition, it looks <strong>for</strong> a valid wave<strong>for</strong>m. In <strong>the</strong> case <strong>of</strong> a COMM<br />

wand transmission, <strong>the</strong> module discovers that <strong>the</strong> ball is not rolling within 600 msecs<br />

(through <strong>the</strong> discrimination and validation routine), switches to <strong>the</strong> COMM wand<br />

detection routine, and waits <strong>for</strong> up to one second <strong>for</strong> <strong>the</strong> insert to become dark (become<br />

26

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!