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

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)
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
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.
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