Shop OBEX P1 Docs P2 Docs Learn Events
Prop to prop coms using Fullduplex serial — Parallax Forums

Prop to prop coms using Fullduplex serial

Zap-oZap-o Posts: 452
edited 2009-09-11 19:08 in Propeller 1
Why wont this work


  Serial.rx(Prop.TX)                                                                                                                                                          
  Prop.RX(serial.TX)





I need to make a type of repeater from a computer to a propeller to a propeller.

Comments

  • jazzedjazzed Posts: 11,803
    edited 2009-09-11 19:05
    Can you try this instead?
      Prop.tx(serial.rx)
    
    
    



    You'll need some kind of loop for that. Also, I'm not sure but setting one of the mode bits for FullDuplexSerial might do the same.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    --Steve

    Propeller Tools
  • StefanL38StefanL38 Posts: 2,292
    edited 2009-09-11 19:08
    Hello Zap-o,

    assuming you are using FullDuplexSerial

    you get an error "expected end of line" because serial.rx has NO parameters

    you can find this by looking into the sourcecode of the method rx

      PUB rx : rxbyte
    
    
    



    rxbyte is a RETURN-value and NOT a parameter

    you have to code it vice versa

      serial.tx(Prop.rx)
      prop.tx(serial.rx)
    
    



    you still might have a problem if no bytes were received as the method rx waits for a byte to be received
    if no bytes were received rx will wait for 2 Billion years until the exploding sun will melt the chip

    so to make it run "double-fullduplex" you could use rxtime to avoid long waitings

    depending on how many bytes come in you might have to increase the buffersize (standard is 16 bytes)
    to avoid loosing bytes in the circular buffer of fullduplexserial

    best regards

    Stefan

    Post Edited (StefanL38) : 9/11/2009 7:20:09 PM GMT
Sign In or Register to comment.