Skip to content
This repository has been archived by the owner on Jun 9, 2018. It is now read-only.

SoftwareSerial library is an older, shittier version than it should be #6

Closed
SpenceKonde opened this issue Jun 19, 2015 · 1 comment

Comments

@SpenceKonde
Copy link
Owner

Per jboynton on pg7: http://forum.arduino.cc/index.php?topic=304606.90

Also needs to be fixed in other ATTiny core.


I tested SoftwareSerial on an ATtiny841. I tried three different baud rates and changed the system oscillator frequency by tuning the internal 8MHz oscillator calibration registers. What I found was that SoftwareSerial seemed to work at these frequencies:

9600:  7.5-8.5 MHz
19.2:     7.9-8.6 MHz
38.4:    7.6-7.7 MHz

This seemed weird since I'd only recently tested an Atmega328 and the results were different. I finally came to realize that SoftwareSerial had undergone a change with 1.6.x IDE. It appears to have been an improvement. The 1.6.x 841 core uses the older 1.0.x SoftwareSerial.

Using the 1.6.x SoftwareSerial I got these values:

9600:  7.6-8.4 MHz
19.2:     7.6-8.3 MHz
38.4:    7.8-8.2 MHz

The frequencies aren't highly precise because the internal oscillator has a lot of jitter. But the ranges where it worked were better centered around 8Mhz with the 1.6.x version. Also, the 1.6.x SoftwareSerial is 306 bytes smaller in code size. It uses only 3 bytes extra RAM.

I copied SoftwareSerial.cpp and .h into my hardware/arduino-tiny-841 folder. But rather than have this duplication, is there any way to set up the core so that the SoftwareSerial library in the 1.6.x core is used instead?

@SpenceKonde
Copy link
Owner Author

Updated to software serial from 1.6.3

SpenceKonde added a commit that referenced this issue Jun 20, 2015
This now uses the new version of softwareserial library.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant