How to use parity space and mark

How about tell the transmitter to send 2 stop bits but tell the receiver to interpret the first stop bit as a parity bit?

Then that parity bit is always high (mark). How would you send a low (space) parity then?

I read reply #9 as we can choose mark parity instead of space parity.

No, that's the requirement of the non-conforming protocol. Parity can only be chosen odd or even, not mark or space.

Maybe I'm confused by the statement "device which requires the data to be serial parity space and mark." No parity is not an option. Then if neither odd parity nor even parity work, there is no other way to do this.

In that protocol "parity" refers to the bit slot between data and stop bits. Its content is unrelated to parity calculations.

Just theorizing here but if you wrote your own serial routines I wonder if you could manipulate the odd/even parity setting in the hardware USART Control and Status Register C on a byte by byte basis so that the serial stream appears to behave as mark/space parity?

You wouldn't have to tell the receiver anything it would just work because that is what it is expecting, for mark parity.

Yes I have come across this sort of parity before when I was working with access control systems but it is very rare.

So yes the simplest thing is to send two stop bits.

You could write your own software serial routine to do this or modify an existing library.

I think it was the other way round. Mark is the un-driven state of the line and Space is the driven state. Leading to my favourite asynchronous serial data malfunction where the line is driven continuously, being knows as "spaced out".
That is why in TTL format, mark is a logic one, because TTL inputs naturally float high and you have to drive the input low.

No need. Just use the hardware in 9-bit mode and No Parity. The receiver will take the 9th data bit as the parity bit.

Doh! I over thought that problem. :laughing:

Here is a replacement HardwareSerial.h and HardwareSerial.cpp that work with 9-bit characters.

They are from 2012 so they might not be drop-in replacements for the current AVR core but they should be a good basis.

Nope! The printing device replaced the telegraph sounder. When the operator on the other end of the line pressed the key down, current flowed in the line and magnetized the pencil control. The normal, key-up, was always NO current.
Paul

That is what I said. Key up was the mark state, normal un-driven state of the line, key down is the space or driven state.

I think the original telegraph system was a long circuit where all keys and sounders were in series with the loop battery. That is why the old telegraph keys had shorting bars. Every station had a key and a sounder. Each operator kept his key shorted and all sounders were energized. To send a message, an operator opened his key and sent a few 'V's' to alert everyone. Then he sent his message address or call sign of the receiving station. He closed his key and waited for an answer. That is the only way that each station had an equal chance to use the circuit.

Do you confuse Morse code with UART protocol?

In a half duplex current loop it's the only solution to keep all idle keys closed. Voltage driven connections are point-to-point with arbitrary mark and space levels.

Thanks this website helped me a lot

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.