SoftwareSerial Bug #1195

Closed
4dsystems opened this Issue Jan 2, 2013 · 3 comments

Comments

Projects
None yet
5 participants

Hello,

Issue raised on the forum: http://arduino.cc/forum/index.php/topic,140227.0.html

We are having problems with the SoftwareSerial library found in the Arduino 1.02 Release.

When the SoftwareSerial is initialised, it sets the tx port to output and then sets it to HIGH. This causes a momentary low spike that is being interpreted as a start bit on some controllers.

The code currently is:-
void SoftwareSerial::setTX(uint8_t tx)
{
pinMode(tx, OUTPUT);
digitalWrite(tx, HIGH);
_transmitBitMask = digitalPinToBitMask(tx);
uint8_t port = digitalPinToPort(tx);
_transmitPortRegister = portOutputRegister(port);
}

The 'fixed' code is:-
void SoftwareSerial::setTX(uint8_t tx)
{
digitalWrite(tx, HIGH);
pinMode(tx, OUTPUT);
_transmitBitMask = digitalPinToBitMask(tx);
uint8_t port = digitalPinToPort(tx);
_transmitPortRegister = portOutputRegister(port);
}

This solves the issue.

Please advise

Regards
4D Systems

ffissore added the New label Feb 27, 2014

cmaglie removed the New label Feb 27, 2014

cmaglie was assigned by ffissore Jul 1, 2015

hbisby commented Sep 23, 2015

closed by 90ca393

@4dsystems Please use the latest version of the IDE.

hbisby closed this Sep 23, 2015

@ffissore ffissore modified the milestone: Release 1.6.6 Sep 23, 2015

Thank you. What release was this fixed on, just out of interest. Was this fixed a while ago and just updated now, or was it just updated recently? 1.02 was the latest release at the time of reporting the issue... Thanks.

Collaborator

matthijskooijman commented Sep 24, 2015

@4dsystems, if you click the commit link, you can see that this commit was first present in the 1.6.1 release (just below the commit message).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment