Pages: [1]   Go Down
Author Topic: SoftwareSerial limitations - no bit-size, parity, or stop bits  (Read 2622 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 19
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The document for SofwareSerial should mention in the "Limitations" section that serial config is limited to 8N1.
http://arduino.cc/en/Reference/SoftwareSerial

I'd like to see the SoftwareSerial library extended to support an overloaded begin() method with a second "config" parameter so that I could pass it something like  mySerial.begin(1200, SERIAL_7E1), but until such time as that is implemented, the limitation should be noted in the documentation.
Logged

Global Moderator
Netherlands
Online Online
Shannon Member
*****
Karma: 227
Posts: 14009
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


The level of documentation is a frequently discussed item here.
As you have the sources of the serial you are invited to have a DIY party.

Easiest way to get 7-bit is to stuff the 8th bit with a 1 or a 0. might work like this

Code:
char c = 'a';
c = c & 0x80;
Serial.write(c);
Logged

Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

0
Offline Offline
Newbie
*
Karma: 0
Posts: 19
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thank you for your reply.   I looked for the source code for the documentation but just found the source for the Arduino IDE and firmware.   I hope to be able to submit useful pull requests to that project on GitHub too, but for now I was hoping to contribute to accurately describing the limitations of the library in its documentation.

The Arduino reference home says at the bottom of the page, "Corrections, suggestions, and new documentation should be posted to the Forum." (with a link here).

I suggest adding the following bullet point in the "Limitations" section of the SoftwareSerial page:
  • Data bits, parity, and stop bits must be 8-N-1
« Last Edit: November 30, 2012, 01:44:27 am by rgm » Logged

Pages: [1]   Go Up
Jump to: