opened 08:41AM - 02 Jan 13 UTC
closed 10:16AM - 23 Sep 15 UTC
Library: SoftwareSerial
Hello,
Issue raised on the forum: http://arduino.cc/forum/index.php/topic,14022…7.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