Serial Port ?bug?

I am not sure if this is a bug or something mishandled, but here is my problem:
I have the framework2 using IO.Ports in C# VS2k5
It seems that any byte sent from my device to the PC larger then 4 bits gets turned into a decimal 63(or a hex 3F, "?")
i have no idea why its doing this, or how to go about fixing this...
any thoughts?
[352 byte] By [Bei] at [2007-12-17]
# 1
Hello.

BaudRate mismatch?

You need to match the settings on your to end points. This is almost certainly the result of wrong BaudRate (in fact, doubling or quadrupling it on the PC is likely to do the trick in this case).

The constructor you should use for your SerialPort object is SerialPort (String, Int32, Parity, Int32, StopBits) to clarify your settings. If you do a bit of programming against the serial port, you should use PortMon (www.sysinternals.com/Utilities/Portmon.html) or another port monitoring program (remember to start it before your own app).

"from my device to the PC": In this scenario, I have the best experience with 38400 baud, but higher might be fine, too.

Remember that any program communicating via serial ports should do this in a seperate thread. Serial communication is higly blocking by nature.

Hope this helps
Gorm Braarvig

gorm at 2007-9-9 > top of Msdn Tech,.NET Development,.NET Base Class Library...
# 2
This is happening because you are reading using Strings instead of byte arrays. By default SerialPort uses the ASCII encoding, and anything larger than 7 bits is not valid and turned into a "?". You should read and write byte arrays instead.
David
DavidGutierrez at 2007-9-9 > top of Msdn Tech,.NET Development,.NET Base Class Library...

.NET Development

Site Classified