Shop OBEX P1 Docs P2 Docs Learn Events
Propeller to propeller serial communication demo. — Parallax Forums

Propeller to propeller serial communication demo.

DgswanerDgswaner Posts: 795
edited 2007-12-22 17:04 in Propeller 1
Does anyone have demo code or a tutorial for propeller to propeller via serial. I'm trying to get 2 RF modules to talk but I don't know if has to do with the RF link or the code. I'm just using the code from Hippy here:
here[noparse]:http:[/noparse]//forums.parallax.com/forums/default.aspx?f=25&m=231500&g=231587#m231587

but there isn't code for receiving data. I can't get the RX function to work.

I'm using the fullduplex serial object.

Thanks in advance

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"A complex design is the sign of an inferior designer." - Jamie Hyneman, Myth Buster

DGSwaner

Comments

  • Paul BakerPaul Baker Posts: 6,351
    edited 2007-12-22 00:30
    How about Beau's High Speed Serial work here: http://forums.parallax.com/showthread.php?p=691952

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Paul Baker
    Propeller Applications Engineer

    Parallax, Inc.
  • DgswanerDgswaner Posts: 795
    edited 2007-12-22 05:10
    I don't think the Parallax RF modules will support that speed.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "A complex design is the sign of an inferior designer." - Jamie Hyneman, Myth Buster

    DGSwaner
  • DgswanerDgswaner Posts: 795
    edited 2007-12-22 07:10
    Here is my code so far, I opted to use the BS2 Functions I just don't know where to begin with it being spin and RF communication. I can't get it to work. The TX part of it seems to be working but the RX side seems to hang on,
    BS2.Serin_Str(8,@myString,9600,1,8)

    I'd appreciate suggestions on where to go from here.

    RX code
    PUB main
        BS2.Start(31,30)
        dira[noparse][[/noparse] 3 ]~~
        Repeat
            !outa[noparse][[/noparse] 3 ]   'blink led
            BS2.Serin_Str(8,@myString,9600,1,8)   ' Accept string passing pointer for variable
            BS2.Debug_Str(@myString)                     ' display string at pointer
            BS2.Debug_Char(13)                    ' CR
            BS2.Debug_Char(myString)           ' show 6th character
            waitcnt(clkfreq + cnt) 'wait 1 second  
    
    



    TX code
    PUB MAIN
        BS2.Start(31,30)
        dira[noparse][[/noparse] 2 ]~~
        repeat
          !outa[noparse][[/noparse] 2 ]  'blink LED
          BS2.Serout_Str(1,string("Spin-Up World!",13),9600,1,8)
          BS2.Serout_Str(1,@myStr,9600,1,8)
    
    



    Thanks for lookin

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "A complex design is the sign of an inferior designer." - Jamie Hyneman, Myth Buster

    DGSwaner

    Post Edited (Dgswaner) : 12/22/2007 4:09:22 PM GMT
  • deSilvadeSilva Posts: 2,967
    edited 2007-12-22 10:00
    DIRA ~~
    is not the best of all ideas smile.gif SEROUT does not touch the DIRA!
    !OUTA
    is even worse! Please understand that you are seriously hurting your communication lines! Logically AND physically, as you shortcircuit the connected pins!

    When you use "non-inverted mode" you should initialize the XMIT-line with High to not confuse the receiver so much.

    It has turned out that the best way of establishing a stable serial communication is to pull-up the line (1k will be fine) and drive it LOW only. Which means: rather than
    OUTA[noparse][[/noparse] n ] := bit
    do
    DIRA[noparse][[/noparse] n ] := !bit

    You can use the code from SimpleSerial which is absolutely simple and serial.

    Post Edited (deSilva) : 12/22/2007 10:43:54 AM GMT
  • DgswanerDgswaner Posts: 795
    edited 2007-12-22 16:12
    I didn't realize that you had to space out the brackets [noparse][[/noparse] ] for the pin assignments. I've updated the code (above, not my actual code). the !OUTA is to blink an LED as the remark indicates, and has nothing to do with the serial communication. it just lets me know that the propeller is continuing to loop through the program.

    I'll take a look at the simple serial code.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "A complex design is the sign of an inferior designer." - Jamie Hyneman, Myth Buster

    DGSwaner
  • deSilvadeSilva Posts: 2,967
    edited 2007-12-22 17:04
    o.k. so then it should work "a little bit" when you enable your pin 1 for output in the transmitter program:
    DIRA[noparse][[/noparse] 1 ]~~
Sign In or Register to comment.