20.01.2017, 11:35
Hi
I need to communicate via a serial line with a device which requires a special behavior of the parity bit.
I've to send this strange structure:
The communication is two bytes only.
The first byte (address) must ends with parity bit always set to 1
The second byte (data) must ends with parity bit always set to 0
Fortunately the communication is 2 wires only. So I don't need to maintain signalling.
Do you have any idea how to do it?
Can I set parity setting to "Always 1" or "Always 0"? In this example I see none, even or odd. http://openrb.com/serial-port-communication-in-lm2/
Can I switch the parity settings after the port has already been opened?
In case everything above fails. Can I:
1. Calculate parity for address
2. Open the serial port with the calculated parity setting
3. Send the address I want to set
4. close the port
5. Calculate parity for data
6. Open the serial port with the data calculated parity setting
7. Send the data
4. close the port
I'm afraid about buffering. In case the sending won't be fast enough (or the script too fast) did the second port opening clear the sending buffer?
Thank you for any ideas
I need to communicate via a serial line with a device which requires a special behavior of the parity bit.
I've to send this strange structure:
The communication is two bytes only.
The first byte (address) must ends with parity bit always set to 1
The second byte (data) must ends with parity bit always set to 0
Fortunately the communication is 2 wires only. So I don't need to maintain signalling.
Do you have any idea how to do it?
Can I set parity setting to "Always 1" or "Always 0"? In this example I see none, even or odd. http://openrb.com/serial-port-communication-in-lm2/
Can I switch the parity settings after the port has already been opened?
In case everything above fails. Can I:
1. Calculate parity for address
2. Open the serial port with the calculated parity setting
3. Send the address I want to set
4. close the port
5. Calculate parity for data
6. Open the serial port with the data calculated parity setting
7. Send the data
4. close the port
I'm afraid about buffering. In case the sending won't be fast enough (or the script too fast) did the second port opening clear the sending buffer?
Thank you for any ideas
LM5Lp, firmware: 2018.08.22 and 2021.12.15, FlashSYS v2, ARMv7 Processor rev 5 (v7l), kernel 4.4.151 and 4.4.259