Shop OBEX P1 Docs P2 Docs Learn Events
FullDuplexSerial problem — Parallax Forums

FullDuplexSerial problem

OldFartRadiomanOldFartRadioman Posts: 30
edited 2013-08-16 10:16 in Propeller 1
I am trying to decode a serial 9600 baud data stream that has valid hex FF bytes in the data. Looking at FDS that appears to be the one byte that it won't receive. Anyone know if any of the other serial objects will work?

Comments

  • Cluso99Cluso99 Posts: 18,069
    edited 2013-08-16 06:36
    FDS works for all 256 characters. Most likely you are confusing a return value of -1 ($FFFFFFFF).
    It would help if you posted your code.
  • OldFartRadiomanOldFartRadioman Posts: 30
    edited 2013-08-16 06:53
    The data comes in in 5 byte packets but for some reason once in a while gets out of sync. The timeout is an effort to resync. I know the test for inByte > -1 is filtering out the FF but if I don't have that test I get a continuous stream of FF.

    CON
    
      _CLKMODE = XTAL1 + PLL16X
      _CLKFREQ = 80_000_000
    
    
    OBJ
    
      
      pst              : "Parallax Serial Terminal"
      serial           : "FullDuplexSerial"             
    
    PUB Main | inByte, numBytes
    
      pst.start(921600)
      serial.start( 1, 2, 00, 9_600)
      repeat
        inByte := serial.rxTime(500)
        if inByte > -1
         
          pst.hex(inByte,2)
          pst.char(" ")
          numBytes += 1
          if numBytes == 5
           pst.char(13)
           numBytes := 0
        else
          if numBytes > 0
           numBytes := 0
           pst.char(13)
    
  • JonnyMacJonnyMac Posts: 9,107
    edited 2013-08-16 08:16
    Are you sure you can run PST that fast? If I'm not mistaken, it's foundation is FDS which will not reliably handle 921600 baud.
  • OldFartRadiomanOldFartRadioman Posts: 30
    edited 2013-08-16 09:15
    I have been running it slower but had increased speed on the chance that it was contributing to missed charachers on the RX side. I am thinking at the moment my sync issues are related to the missing FF's.
  • ErNaErNa Posts: 1,752
    edited 2013-08-16 09:46
    Hi, you are not missing FFh, The function returns a long, the character is the LSByte if your long InByte, -1 equals FF_FF_FF_FFh and so 0FFH is a positive number. I would also not run PST at this high speed, You will not have more than 4 times the number of output characters to pst then you read. So 100kBaud is sufficient.
  • Duane DegnDuane Degn Posts: 10,588
    edited 2013-08-16 10:16
    I don't think FDS deals with framing errors correctly.

    Tracy Allen's four port serial driver behaves much better. I've had projects where I had trouble receiving data (garbage data detected) with FDS but when I switched to Tracy's object the problems went away.

    Another plus to using Tracy's driver is you can use the same driver for display your debug information.
Sign In or Register to comment.