Your new topic does not fit any of the above??? Check first. Then post here. Thanks.

Moderator: igrr

User avatar
By SurfCoders
#29853 I am pleased to announce that Peter Lerup has created a SoftwareSerial library that is compatible with the ESP8266. I've tested it and it is pretty fast (at least fast enough for my application) and efficient (using it with pins 13 and 15 for RX and TX respectively).

The library can be found at https://github.com/plerup/espsoftwareserial.

Enjoy!
User avatar
By dkinzer
#29928
SurfCoders wrote:Peter Lerup has created a SoftwareSerial library that is compatible with the ESP8266.
It should be noted that although this code does disable interrupts during transmission and reception of each character, non-maskable interrupts may still occur and such interrupts might affect the bit timing periodically. With that in mind, it would be better to choose a lower baud rate rather than a higher one because the time disturbance of NMI servicing would represent a smaller percentage of a bit time at a lower baud rate. On the other hand, higher baud rates are preferred because the shorter bit time requires interrupts to be disabled for shorter periods of time.

From reading the code I believe that the range of supported baud rates is 2000 to 200,000 baud. Since the code uses micros() to realize the timing, the resolution of the bit timing is 1uS. (This could be improved by using the tick count of RTC Timer2 directly since it has a resolution of 200nS.) For a point of reference, the bit time at 115.2Kbaud is 8.68uS. The code uses round() to compute the bit time in uS so it uses 9uS for 115.2Kbaud - this represents a 3.7% error. The 1uS resolution can result in a smaller error at lower baud rates (e.g. 0.2% at 38400 baud).
User avatar
By brolly759
#30326 I tried the library out, I get garbage data in 1 direction. I am using an HUZZAH ESP8266 from Adafruit.

Going from Hardware Serial to SoftwareSerial works fine, Going from SoftwareSerial to Hardware Serial I get random characters.

The softwareSerial is using a 3v FTDI adapter running 3V logic.