Issues with 27980 / 27981 Transmitter/Reciever with the Propeller chip
The Rizz
Posts: 3
Greetings! Just wanted to see if anyone else had tried to interface the 27980/27981 Tx/Rx to the propeller. I am having incredible difficulty. From the documentation it appears the devices accept 8-N-2 or 8-N-1 protocol for serial transmission. Thus I have tried to implement a test circuit using Hyper Terminal 9600, 8-N-1, but have failed. I send "a" for example and the Hex code that gets passed across is 40h, If you know your ASCII code it should be 61h. Just to see if the Hyperterminal was able to communicate with the Prop, i hardwired it up (through a transister to bring it to 0-3.3v levels ;0 ) and it worked fine.
My guess is the way the Tx/Rx Combo is sending, kinda looks as though the start bits are getting stripped but i dont know. The documentation doesnt really get into the nitty gritty of it as it is just basically written for Basic Stamp Serin/Serout commands. Anybody know if its possible with the prop and perhaps where i am going wrong? I got a set of them and i just saw the 900MHZ models which support Prop a week later >.<, Dont want to drop another $150 on a set of transcievers! Any Help would be greatly appreciated!
My guess is the way the Tx/Rx Combo is sending, kinda looks as though the start bits are getting stripped but i dont know. The documentation doesnt really get into the nitty gritty of it as it is just basically written for Basic Stamp Serin/Serout commands. Anybody know if its possible with the prop and perhaps where i am going wrong? I got a set of them and i just saw the 900MHZ models which support Prop a week later >.<, Dont want to drop another $150 on a set of transcievers! Any Help would be greatly appreciated!
Comments
*Peter*
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
Thnks again,
Rizz
It was easily accomplished using the BS2 Library provided in the object exchange. As well as a little bit of code. Now i have a basic test routine with 2 prop chips with a display on one. The code is as follows:
For the Transmitter:
CON
_clkmode = xtal1 + pll16x
_xinfreq = 5_000_000
OBJ
'FDS : "FullDuplexSerial"
BS2 : "BS2_Functions" ' Create BS2 Object
Var byte TXByte 'Single byte variable for transmission
Long stack1[noparse][[/noparse]50] ' Stack for 2nd BS2 Cog
PUB Start
BS2.start (31,30)
RunLoop
Pub RunLoop
TXByte:=$35
repeat
BS2.PULSOUT_uS(0,3600)
BS2.SEROUT_CHAR(0,TXByte,9600,0,8)
For the Reciever:
''******************************
''* TX_RX Test for FW Raft *
''* Single-precision IEEE-754 *
''* (C) 2006 Parallax, Inc. *
''******************************
CON
_clkmode = xtal1 + pll16x
_xinfreq = 5_000_000
VAR
byte RxChar
OBJ
BS2 : "BS2_Functions" ' Create BS2 Object
TVT : "TV_Terminal"
PUB Start
BS2.start (31,30)
TVT.start(12)
RunLoop
PUB RunLoop
Repeat
RXChar:=BS2.SERIN_CHAR(0,9600,0,8)
{{
Accepts asynchronous character (byte) on defined pin, at Baud, in Mode for #bits
Mode: 0 = Inverted - Normally low Constant: BS2#Inv
1 = Non-Inverted - Normally High Constant: BS2#NInv
x:= BS2.SERIN_Char(5,DEBUG_Baud,BS2#NInv,8)
BS2.Debug_Char(x)
BS2.Debug_DEC(x)
}}
!RXChar
TVT.out(2)
TVT.hex(RxChar,2)
TVT.out($0D)
TVT.out(2)
TVT.dec(RxChar)
TVT.out($0D)
waitcnt(cnt+80_000_000)
Note that it utilized the TV Terminal for debugging purposes.
On the Reciever Side: Data was connected to P0 via a current limiting resistor, also note that the Single Character Variable was Inverted before it was Displayed.
On the Transmitter Side: A resistor was used to limit the current draw on the output pin used (P0)
If there are any additional questions please feel free to ask. As well thank all of those who responded to my question quickly.
The main underlying problem had to do with the interfacing to the device with the Full Duplex Object, and the output being held high, it was much easier to remedy with the BS2 Functions.