Guys,
thanks for all the ideas, I was thinking more or less along
these lines, but I wasn't sure what would be the best thing
to do. I actually got it to work by doing this:
Start:
Pulse = 0
PULSIN Rx_Pin, 0, Pulse
IF Pulse < 290 THEN Start
Get_Data:
FOR i = 0 to 6
FOR w = 0 TO 5
Pulse = 0
PULSIN Rx_Pin, 0, Pulse
If Pulse > 80 and Pulse < 120 THEN Rx_Bit = 0
IF Pulse > 180 AND Pulse < 220 Then Rx_Bit = 1
Rx_Byte.0 = Rx_bit
Rx_Byte = Rx_Byte << 1
NEXT w
Rx_Data[i] = Rx_Byte >> 1 ' SIMPLE BUT EFFECTIVE
NEXT i
i = 0
w = 0
GOSUB Checksum ' Put a pinholder here, hehehe!
GOSUB Send_Data
GOTO Start
END
Now it works like a charm, but I'll give it a go with your
idea Bruce cuz it lookes slicker hehehe. BTW Archilochus,
I'll add a couple of IF THEN or CASE statements to make
sure shorter or longer pulses are discarted.
And now something completely different
If you take a look at the code above you'll see that I
decided to implement checksum to my routine and since
I'm messin' 'round with 6-bits like Dwayne said, I ran into
another problem. Spent whole afternoon trying to solve it
but no dice.
I've opened another thread regarding this, so if any of you
still have any patience left for trying to crack this one, this
is the place to look:
http://www.picbasic.co.uk/forum/show...=&threadid=833
Thanks to everyone who helped me out with this one.
--
Sincerest regards,
YZ7REA Vladimir M Skrbic
4N7ATV Repeater Administrator
YU7GHZ Radio Club President





Bookmarks