Shop OBEX P1 Docs P2 Docs Learn Events
FullDuplexSerial at 5bps — Parallax Forums

FullDuplexSerial at 5bps

mojorizingmojorizing Posts: 249
edited 2009-05-25 16:31 in Propeller 1
Is there any reason why the FullDuplexSerial.spin at obex.parallax.com/objects/54/ won't work at 5 bps? Seems like it should work at any odd baud rate....

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Bad spellers of the world untie!

Comments

  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2009-05-25 03:14
    Looking at the code for FullDuplexSerial, there's no apparent reason for it not to work at 5 baud. Are you sure the baudrate is the source of your trouble and not something else? Can you show us your program?

    -Phil
  • mojorizingmojorizing Posts: 249
    edited 2009-05-25 04:34
    Hi Phil,

    This is using a USB Pro Dev. brd. The usual debug using pin 31 and 30 to output what's coming into pin 1, so the prop. is a simple pass thru to a PC running Parallax Serial Term.

    CON
       
      _clkmode = xtal1 + pll16x
      _xinfreq = 5_000_000
     
    VAR
          BYTE            Data
    
    
    OBJ
    
      ComputerConnection : "Debug_PC2"         'data connection to the PC
      HammerConnection :   "FullDuplexSerialPlus"  'data connection to the Hammer
    
    PUB Main
    
      HammerConnection.start(1, 2, 0, 5)  ' pin1 to recv - only to monitor traffic, pin2 not used. Need to change buad rate for diff. ECU.
    
      ComputerConnection.start(57600)
      waitcnt(clkfreq*2 + cnt)
      ComputerConnection.putc(ComputerConnection#FF)  'Form Feed
      
      Repeat
        CommunicateFromHammer
        UpdateVariables
        
    PUB CommunicateFromHammer
      ' monitor data from Hammer
      
      Data := HammerConnection.GetHex
      
    PUB UpdateVariables
    
    
         ComputerConnection.Str(String(ComputerConnection#TAB))
         ComputerConnection.hex(Data,2)
         ComputerConnection.Str(String(ComputerConnection#CR))
    
    




    Using another computer serially connected to the Pro Brd DB9 connection, all's well with 300, 600 etc. baud. I know of no terminal program that you can dial down to 5 baud (not my favorite RealTerm either) to check, but on my o'scope the 5 baud input looks as it should. I own a copy of Viewport, so I'll fire that up. Can you see anything amiss?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Bad spellers of the world untie!
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2009-05-25 04:53
    You're calling GetHex, which requires the sending device to send hex data as a zero-terminated string. Is this what your "hammer" device does?

    -Phil
  • hinvhinv Posts: 1,255
    edited 2009-05-25 15:00
    Can I ask why 5baud? Are you doing some long distance low power communication?
  • mojorizingmojorizing Posts: 249
    edited 2009-05-25 16:31
    This project is an OBD code reader on a vehicle (porsche 911 made from '89 to '94) that uses ISO:9141:1989 protocol.
    A certain initial 5bps address byte is sent on the "L" line to a certain control unit in the car.

    Phil, you're correct, and this explains it....this isn't sent using a zero terminated string.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Bad spellers of the world untie!
Sign In or Register to comment.