Datasheet

Jon Waddington
50
quart long 0 'calculated 1/4 bit time
tquart long 0 'calculated 3/4 bit time
full long 0 ‘calculated full bit time
_l long 0
delay long 5_000_000
half long 0 'timed half bit time
outmask res 1
time res 1
start res 1
addr res 1 'PAR address
rxcode res 1
count res 1
frame res 1
This code is split into four parts, ‘go’, ‘detect, ‘sb2’, and ‘loop’.
The ‘go’ section initializes the input pin and skips to the ‘detect’ section. This waits for
the line to be pulled low and the Propeller’s ‘count’ value is temporarily backed up. The
code waits for the line to be pulled high again and the difference in the ‘count’ value is
compared with the upper and lower threshold for the bit period. If the ‘count’ value is
between 70000 and 75000, the code continues to the ‘sb2’ section.
The ‘sb2’ section of the code waits for three quarters of the bit period and samples the
second start bit. If the second start bit is not detected, the code jumps back to the
detect section.
If the second start bit is present, a loop is entered where the code waits for one bit
period and samples the line. This repeats 12 times until all the bits have been received.
The code is then written to the hub memory so the rest of the Propeller program can
manipulate the code.