Can you explain more about that please, because few days ago, we tested few things that related to UART - LCD Touch with stop bit is None, it seems fine.
@ Dat - The following code fails on a Spider and G400 (and i would guess a G120) but is fine on a Cerb.
SerialPort port = new SerialPort("COM1",9600,Parity.None,8,StopBits.None);
port.Open();
Here is the exception.
Using mainboard GHI Electronics FEZSpider version 1.0
#### Exception System.ArgumentException - 0xfd000000 (1) ####
#### Message:
#### System.IO.Ports.SerialPort::InternalOpen [IP: 0000] ####
#### System.IO.Ports.SerialPort::Open [IP: 0018] ####
#### StopBitsTest.Program::ProgramStarted [IP: 0014] ####
#### StopBitsTest.Program::Main [IP: 0015] ####
A first chance exception of type ‘System.ArgumentException’ occurred in Microsoft.SPOT.Hardware.SerialPort.dll
An unhandled exception of type ‘System.ArgumentException’ occurred in Microsoft.SPOT.Hardware.SerialPort.dll
Changing the StopBits.None to StopBits.One runs fine on the Spider and G400
SerialPort port = new SerialPort("COM1",9600,Parity.None,8,StopBits.One);
port.Open();
Hi,
I think stopbit.none is not complient with the definition of rs232. The receiver must synchronize on the falling edge from the stop signal e.g. (logic 1) to the start bit (logic 0). If there would be no stop bit the receiver could not synchronize as you can not know whether the last data bit is high or low… Stopbit.one means at least one bit length on logic 1, it can be longer and it is longer if no data are transmitted.
Regards
Roland
I have a feeling that the stopbits.none is for when the port is used in the synchronous mode (if supported) and is not actually valid for asynchronous use. I can’t find any reference to no stop bits for UART cases anywhere.
It’s certainly not something I have seen before either having used RS232 for the last 25+ years
@ ollengenic -
I think the statement in the post release issues that StopBits.One does not work is (inadvertently) wrong.
As the link in Dave McLaughlin’s post shows StopBits.None is not allowed in .NET as well.
This is normal, not an issue.
@ Dat - You know more about this code than I do, but please re-read the link given by Dave McLaughlin. As I read it, it sounds like the exception is the correct result for StopBits.None.