Shop OBEX P1 Docs P2 Docs Learn Events
Issues with 27980 / 27981 Transmitter/Reciever with the Propeller chip — Parallax Forums

Issues with 27980 / 27981 Transmitter/Reciever with the Propeller chip

The RizzThe Rizz Posts: 3
edited 2007-07-23 02:27 in Propeller 1
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!

Comments

  • codemonkeycodemonkey Posts: 38
    edited 2007-07-10 02:35
    Just in case you didn't know about the object exchange that has a bunch of useful objects running around in it(http://ww1.parallax.com/Default.aspx?tabid=65), especially one object that supports a bunch of BS2 commands. Its name is "BS2 Functions V1.3.5" and the description is "General PBASIC functionality library, written in Spin, that mimics and extends many popular BS2 functions: COUNT, DEBUG, DEBUGIN, FREQOUT, PAUSE, PULSOUT, PULSIN, PWM, RCTIME, SEROUT, SERIN, SHIFTOUT, SHIFTIN." This might help you.
  • Mike GreenMike Green Posts: 23,101
    edited 2007-07-10 02:48
    There is also the FullDuplexSerial object that comes with the Propeller Tool and several Spin serial objects as well that are good up to 19.2KBaud.
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2007-07-10 03:03
    Rizz, I think your problem is that you are not taking into account that this is not a piece of wire but an RF link. RF stuff needs preambles just to get the tx/rx circuits settled. You can't just send a single character and expect it to appear on the other end, you need some sort of protocol, even a simple one. I just had a look at the manual and even it says you need to synch it (Look at page 3, Calibration). If in doubt, RTM.

    *Peter*
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2007-07-10 03:13
    Peter is correct…For proper operation you not only need to sync the units but you must use inverted baud mode so the resting state of the line is LOW. The nice thing about the Propeller is that it has the resources to actively maintain sync and handle CRC full-time. Take care.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
  • The RizzThe Rizz Posts: 3
    edited 2007-07-11 01:05
    Thank you all for your very swift feedback im on it now! Ill let ya know when i get it set.

    Thnks again,


    Rizz
  • stampedstamped Posts: 68
    edited 2007-07-11 03:38
    Sounds good Rizz. I am just about to get started on the RX/TX units myself. I will be interested in an update when you get them working.
  • The RizzThe Rizz Posts: 3
    edited 2007-07-23 02:27
    Greetings! Thank you all for your help the basic issue has been solved!

    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.
Sign In or Register to comment.