Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.
Photo

Serial 7 data bit caused Argument Exception on SerialPort.Open()


  • Please log in to reply
1 reply to this topic

#1 banalogic

banalogic

    New Member

  • Members
  • Pip
  • 7 posts

Posted 25 June 2013 - 06:48 PM

The following code Open() call thrown an ArgumentException:

   SerialPort comm1Port = new SerialPort(SerialPorts.COM1, 38400, Parity.None, 7, StopBits.One);

   comm1Port.Open();

 

Exception Stack Trace: 

   System.IO.Ports.SerialPort::InternalOpen
   System.IO.Ports.SerialPort::Open
   SerialSelfTest.Program::Main

 

I tried both 4.2 and 4.3 with the same behavior. It appears the SDK only allows 8 databits.

 

 



#2 ziggurat29

ziggurat29

    Advanced Member

  • Members
  • PipPipPip
  • 244 posts

Posted 25 June 2013 - 07:23 PM

to wit, the processor's usarts support 8 and 9 bit modes only; maybe if you had parity, you could emulate it with an 8 bit mode, but you have no parity, so I think probably not; or maybe you can make it look like an extra stop bi.?  Interfacing to an ancient device?






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.