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

Error to open serialport with parity set to mark

serialport

  • Please log in to reply
5 replies to this topic

#1 boussihak

boussihak

    New Member

  • Members
  • Pip
  • 3 posts

Posted 23 March 2014 - 02:48 PM

i have exception whene i  try to open serial port with Parity.Mark 

 " serialPort = new SerialPort(SerialPorts.COM2, 19200, Parity.Mark, 8, StopBits.One);"

and when i set parity.none  it's ok 

 

 serialPort = new SerialPort(SerialPorts.COM1, 19200, Parity.None, 8, StopBits.One);

 

can somebody help me to resolve this issue 



#2 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 23 March 2014 - 05:28 PM

Hi boussihak,

Which Netduino board do you have? It's possible that Mark parity isn't supported by the microchip, since it's a pretty rare setting. Or it may only be supported with 7 data bits. Or there might be a bug in the firmware :)

In any case...first step is to identify which board you have, and then we can go from there.

Chris

#3 boussihak

boussihak

    New Member

  • Members
  • Pip
  • 3 posts

Posted 23 March 2014 - 09:34 PM

hi chris,

i have netduino plus 2..

i use parity mark for wakup bit used for slot machine (8bits data + 1 bit wakup)

 

Khelil



#4 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 25 March 2014 - 07:40 AM

Hi Khelil,

I checked the STM32 docs...the micro only supports Odd and Even parity.

That said...Mark parity is just a bit of "1" set as an "extra bit" after the data in every character. Are you sending any other characters to the slot machine--or just the wakeup message? If it's just the wakeup message you could use Even/Odd parity and then just sent a character which made the parity bit a "1".

We can look into possible ways to software-enable a Mark/Space bit (by left-bit-shifting 8-bit data into 9-bit data and then manually settings the lowest bit high/low accordingly) in a future firmware release--or if you feel like firmware hacking you could do that today.

Also--if you wanted you could always emulate UART via the SPI bus, if your UART speeds are configurable to an even divisor of the 168MHz clock.

Chris

#5 boussihak

boussihak

    New Member

  • Members
  • Pip
  • 3 posts

Posted 14 May 2014 - 01:15 PM

hi chris,

Any news about parity mark in the new release 

 

Khelil



#6 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 14 May 2014 - 06:54 PM

Hi Khelil,

There is no support for Mark parity in the STM32 micro. If there are enough votes for looking into manually adding support, we can get it on the feature request list. Netduino is also open source--so if someone wants to tackle this with/for you, we'd also be happy to help provide guidance.

Chris





Also tagged with one or more of these keywords: serialport

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.