Shop OBEX P1 Docs P2 Docs Learn Events
RF Array Help??? — Parallax Forums

RF Array Help???

PlatoPlato Posts: 2
edited 2007-01-18 03:34 in BASIC Stamp
So I have been playing around with RF Transmitter & Receiver (#27980 & 27981) for the past few weeks, and hit a rather odd snag...

Transmitter Code:

junk    VAR   Word(4)
index   VAR   Nib
 
junk(0) = 2048
junk(1) = 2054
junk(2) = 2050
junk(3) = 2501
 
FOR index=0 TO 3
  DEBUG ? junk(index)
NEXT
 
PULSOUT 7, 1200
SEROUT 7, 16468, [noparse][[/noparse]"!!", junk.HIGHBYTE(0), junk.LOWBYTE(0), junk.HIGHBYTE(1), junk.LOWBYTE(1),
                        junk.HIGHBYTE(2), junk.LOWBYTE(2)]


Receiver Code:
junk      VAR     Word(4)
Main:
  SERIN 15, 16468, [noparse][[/noparse]WAIT("!!"), junk.HIGHBYTE(0), junk.LOWBYTE(0), junk.HIGHBYTE(1), junk.LOWBYTE(1),
                                junk.HIGHBYTE(2), junk.LOWBYTE(2)]
  DEBUG ? junk(0)
  DEBUG ? junk(1)
  DEBUG ? junk(2)
GOTO Main


Now here is what has me scratching my head. When I run the code, the debug window on the transmitter shows that the array is filled with the correct values - no problem here.

However, in the debug window for the receiver code, I will get:
junk(0) = 2048
junk(1) = 2055
junk(2) = 0    <-------- THIS IS MY PROBLEM


The junk(2) value is not supposed to be 0. If I change the code to only SEROUT junk(0) and junk(1), then I will get:
junk(0) = 2048
junk(1) = 6    <------------ AGAIN, A PROBLEM


Anyone have any ideas as to why the last transmitted value is junk?

Thanks in advance!!

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2007-01-18 02:27
    I can think of two things, neither of which should be happening:
    1) There is some delay in the transmitter or receiver that affects the reliability of the last few bits received.
    2) The two Stamps have a timing difference so that after several characters, they lose synchronization

    Some things to try:
    1) Transmit an extra character. $FF has the advantage of leaving the transmitter off after the serial start pulse
    2) Reduce the Baud from 9600 to 4800 and see what happens.
    I know the transmitter/receiver is supposed to be good to 19.2KB, but the system isn't working.
  • FranklinFranklin Posts: 4,747
    edited 2007-01-18 03:34
    You might also try a CR after the last debug in case you have something in the buffer.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen
Sign In or Register to comment.