Skip to content
Advertisement

serial port: bytes from device all have their most significant bit = 0

guys tell me please what can be a problem – i send commands (sequence of bytes including bytes with most significant bit (MSB) = 1) to device through serial port, device successfully recognize the commands (so it seems all bytes are sent correct) and reply with almost correct answer. “Almost” here means than answer is correct except that all bytes have zero MSB (while some of them must have MSB = 1).
I use Ubuntu 16 on VirtualBox, Windows 7 as host OS, serial port as USB device on FTDI chip.
Here my serial port settings:

JavaScript

Advertisement

Answer

EDIT I’ve just seen the problem. You’ve got the line

JavaScript

ISTRIP means “strip off the eighth bit”. You need

JavaScript

to simply enable input parity.


You’ve enabled EVEN parity

JavaScript

as well as 8-bit bytes

JavaScript

So that’s one start bit, 8 data bits, 1 parity bit, and 1 stop bit. I’m not sure that the FTDI chip can handle all that!

If you don’t want parity, use

JavaScript

And if I’ve maligned the FTDI chip, I apologise – in which case are you sure the other end is configured the same way? 8E1 is not very common compared to 7E1 or 8N1

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement