On 2010-11-27 08:55, Dena Meier wrote: > I think I may have figured it out. > And exactly 'what* did you "figure out" ? And why not tell us ? Is it secret in some way ? > Does anyone know if there are serious issues regarding using > C# .NET System.IO.Ports.SerialPort object? > If you are sending data as "strings", note that SerialPort does default encoding of any charachetrs outside of (higher then) the lowest (0-127) ASCII codes ! For ASCII codes in the range 127-255 there is a default Unicode encoding done. To have the Unicode-encoding as the *default* is a major brain-fart, if you ask me. To send full 8-bit values you have to either set the "encoding" property of the SerielPost object to some encoding that does not change the upper half of the 8-bit characters, *or* send arrays of bytes (they will never, as far as I understand be encoded or changes by SerialPort). A few minutes Googling on "SerialPort encoding 8-bit" or similar will quickly give you some example, such as : http://www.visualstudiodev.com/visual-basic-express-edition/serial-port--se= nding-8-bit-problem-39369.shtml What that what you "figured out" ? And you are correct in that the (old) file-based API's in WIn32 does not do this. > I have discovered that when I wrote a test program using > Win32 API CreateFile, WriteFile, and ReadFile on the > COM4 USB port (the port that is the PIC18LF2450) that > this works fine for both sending and receiving. > So Hyperterm is not using .NET SerialPort. > Hyperterm is probably using the old Win32 API calls, or > using an object that directly calls Win32 for serial access. > > So now I have to figure out a way to access a serial port > in C# .NET without using the SerialPort object!! > Or simply use SerialPort with an encoding that is "transparent" *or* send "bytes" instead of "strings". > There must be a bug in .NET SerialPort. Depends on what you "figured out"... :-) > > Any ideas on this are welcome. > > Thank You, > Dena Meier > --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .