Shop OBEX P1 Docs P2 Docs Learn Events
FDX configurable 5-8 Databits, 0,1,2 stopbits, N, E, O, M, S parity — Parallax Forums

FDX configurable 5-8 Databits, 0,1,2 stopbits, N, E, O, M, S parity

StefanL38StefanL38 Posts: 2,292
edited 2010-08-15 15:45 in Propeller 1
Hi,

I want to connect the serial port of an an old FANUC 6T CNC-control
to a propeller. The propeller then works as an external CNC-program-storage-device.

The serial interface works on 7 databits 2 stopbits and even parity.

I did a search of the forum for FDX (FullDuplexSerial) versions that are configurable for
5-9 Databits
0,1,2 Stopbits
None, Even, Odd, Mark, Space -parity

I found this posting 7-bit (7/1/E) w/Schenk's FDS?

It refers to a sourcecode attachment. The URL has changed because of the new forum software

I adapted the URL to the new home of the old forum
You have to replace

http://forums.parallax.com/forums

through

http://forums.parallaxinc.com/forums

FD_Serial_Conf.spin

This FDX-version can do No, Odd or Even parity on transmitting.

As for 7 Databits 1 stopbit with EVEN parity, the parity-bit is the 8th bit.
With some spincode tweaking, this version is able to receive 7E1.

I'm no expert about parity-bit calculating. Can somebody estimate the effort how much it would take to code a FULL configurable version of FDX?

Maybe Kye has fun on coding this? :-))

If somebody has links that explain parity-calculating with EXAMPLES
this will help too.

thank you very much in advance

best regards

Stefan


P.S. If somebody here might happen to know the specifications of the FANUC TAPE-READER-interface, an alternative could be to build a DIY
BTR (behind the tapereader)

Comments

  • kwinnkwinn Posts: 8,697
    edited 2010-08-15 06:31
    Generating a parity bit should not be too difficult since the PASM code already has a loop to output each data bit (assuming there is space for the extra code).
    If you start with the parity bit set to 0, you XOR each data bit with the parity bit as part of the output loop. When all the data bits have been sent the parity bit will be 0 if there were an even number of 1 data bits, 1 if an odd number of 1 data bits. The parity bit is sent if even parity is wanted, or inverted and sent for odd parity.

    After posting this, I realized if you start with the parity bit set to 0 for even or 1 for odd you automatically end up with the correct setting of the parity bit.
  • KyeKye Posts: 2,200
    edited 2010-08-15 06:37
    Look at the "and" instruction and what it produces for the C flag. Parity can be computed in one OP.
  • kwinnkwinn Posts: 8,697
    edited 2010-08-15 07:43
    Thanks for pointing that out Kye. In all the PASM programming I have done to date I never spotted that. Sure makes parity calculation easier. Now to take a look at the rest of the bit mainipulation instructions to see what other goodies I may have missed.
  • AribaAriba Posts: 2,690
    edited 2010-08-15 15:45
    Stefan

    The FD_Serial_Conf should work for your application. It sends always 2 stop bits (like FullDuplexSerial).
    On the receiving side the number of Stop bits do not matter, more stopbits are just a longer idle time between bytes.
    Just set the MSBit to zero for the recived bytes to eliminate the Parity as in the thread you've linked to.

    Andy
Sign In or Register to comment.