Shop OBEX P1 Docs P2 Docs Learn Events
RE: Full-Duplex Serial Driver — Parallax Forums

RE: Full-Duplex Serial Driver

schwiegjcschwiegjc Posts: 41
edited 2009-02-04 17:50 in Propeller 1
The ASCII data stream from a sensor can be successfully read using Serin_Wait(2,@DataIn,"T",4800,mode,8) function (mode=1 or non-inverted) but does not work with Full-Duplex Serial Driver start(2, 2, mode, 4800) function. Is it because of the value of the mode variable? Note. The mode variable never seems to be assigned in the Full-Duplex Serial Driver.

The mode variable is defined for Serin-Wait function as:
Mode: 0 = Inverted - Normally low Constant: BS2#Inv
1 = Non-Inverted - Normally High Constant: BS2#NI

The mode variable is defined for start function as:
'' mode bit 0 = invert rx
'' mode bit 1 = invert tx
'' mode bit 2 = open-drain/source tx
'' mode bit 3 = ignore tx echo on rx

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2009-02-03 18:43
    The mode variable is used differently in the two objects (BS2 Compatibility Library and Full Duplex Serial Driver). For FullDuplexSerial, try mode=0. The Spin portion of the driver passes the start parameters as a block of 4 longs to the assembly portion of the driver. That's why there's no assignment.
  • schwiegjcschwiegjc Posts: 41
    edited 2009-02-03 22:20
    The ascii signal data is transmitted with its bits not inverted. Setting the mode variable to 1 for the SERIN_WAIT function instructs the function not to invert the bits. For the Full Duplex Serial Driver, there does not seem to be method to instruct the assembly code not to invert the bits.
  • Mike GreenMike Green Posts: 23,101
    edited 2009-02-03 23:48
    Not true. The mode bits have both 0 (false) and 1 (true) values. If mode bit 0 is a 0, it means don't invert rx.
  • schwiegjcschwiegjc Posts: 41
    edited 2009-02-04 17:50
    Thank you. I suspected that previous statement was incorrect. I have tried the Full Duplex Serial Driver (set mode to 0) and it does not seem to work. The Serin_Wait function does work. I plan to further determine the problem.
Sign In or Register to comment.