Shop OBEX P1 Docs P2 Docs Learn Events
3v-5v data translation trouble — Parallax Forums

3v-5v data translation trouble

Richard McCueRichard McCue Posts: 6
edited 2008-02-26 21:52 in BASIC Stamp
Hello,

I am building some data recorders using multiple BS2P24s and some AC4790-1000m transceivers from AeroComm. The AC4790-1000m is a strictly 3.3v device and AeroComm recommends using a 74LVC244a octal buffer/line driver for interfacing with a 5v system, which I have done.

The setup consists of a transmittter (BS2p-74LVC244-XCVR)·sending data to a reciever(XCVR-74LVC244-BS2p).

I believe the xcvrs are working fine but I think I am having trouble with the 3v-5v interface.

The Code:
Main:
·FOR·counter = 0 TO 5000
· Value = counter * 2
· SEROUT rfout, RFBaud, [noparse][[/noparse]counter.HIGHBYTE, counter.LOWBYTE, value.HIGHBYTE, value.LOWBYTE]
· DEBUG 13, "Value = ", DEC counter, " ", DEC value
· PAUSE 5
·NEXT

What the Transmitter is sending:
0····· 0
1····· 2
2····· 4
3····· 6
...etc.

What the reciever is showing:
0····· 0
0····· 0 (15 times)
0····· 257
257·· 257 (15 times)
257·· 514
514·· 514 ( 15 times followed continuously by increases of 257..ad infinitum)

What could be the problem?

Comments

  • Bruce BatesBruce Bates Posts: 3,045
    edited 2008-02-25 23:41
    Richard -

    You haven't provided us with the entire program. At least one thing of importance is how have you defined "counter"? Is it defined as a BYTE or as a WORD?

    Please use the attachment manager in lieu of the inline code. If we need to download it to test it, it's much easier that way.

    Regards,

    Bruce Bates

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "Genius is one percent inspiration and ninety-nine percent perspiration."

    Thomas Alva Edison
  • Richard McCueRichard McCue Posts: 6
    edited 2008-02-26 00:20
    Sorry, I'm new.

    The code for the tx and rx are attached below.

    It is probably worth mentioning that the rx seems to be receiving at about 1/10·of the·rate of tx.
  • Bruce BatesBruce Bates Posts: 3,045
    edited 2008-02-26 01:34
    Richard -

    I don't see anything of real interest to me yet, except for the BAUDMODE (RFBaud) which you have specified as:

    RFBaud CON 110

    A BAUDMODE of 110 is not a common value used with the BS-2p. If you want to give me the baud rate, number of bits (7 or 8), the parity (none or even), and whether the data need to be inverted or true, I can give you an appropriate BAUDMODE to use. If you prefer, you can find it for yourself by looking at the SERIN/SEROUT commands in the PBASIC Reference Manual, or the PBASIC Help File which is part of the PBASIC Editor.

    I'm not sure if this has anything to do with the data rate discrepancy you mentioned or not, but it should be changed none the less.

    Regards,

    Bruce Bates

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "Genius is one percent inspiration and ninety-nine percent perspiration."

    Thomas Alva Edison
  • phil kennyphil kenny Posts: 233
    edited 2008-02-26 01:35
    The first thing I'd try is lowering the Baud rate. The one you have chosen
    is 19.2k. As the attached section of the PBASIC help menu shows, even
    4800 and 9600 may have trouble.

    phil
    788 x 245 - 139K
  • Harry CallahanHarry Callahan Posts: 6
    edited 2008-02-26 14:02
    Try a simpler interface (like a 330 ohm resistor) between your TX and RX stamps to shake all the bugs out of the software side. You'll probably still have similar problems because the receiving stamp can't keep up with the data stream coming from the sending stamp. This is partly due to your DEBUG statements which follow each SERIN. While the DEBUG instruction is running, the next data is coming in and winds up on the floor. You might try a PAUSE 100 after each SEROUT in the sending program.

    DH
  • Richard McCueRichard McCue Posts: 6
    edited 2008-02-26 21:52
    The Baud rate is 19.2K. I did simplify the setup and just went stamp to stamp.
    This worked well with the flow control enabled up to 19.2, beyond that it began to mess up
    again (the manual says flow control will not work beyond 19.2, which I did observe)

    I'm going to try the original setup again and try enabling the flow control.
Sign In or Register to comment.