3v-5v data translation trouble
Richard McCue
Posts: 6
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?
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
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
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.
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
is 19.2k. As the attached section of the PBASIC help menu shows, even
4800 and 9600 may have trouble.
phil
DH
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.