-
-
Notifications
You must be signed in to change notification settings - Fork 7k

Description
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