Go Down

Topic: AFSoftwareSerial w/ internal clock 8MHz (Read 8712 times) previous topic - next topic


Awesome, thanks.  I'm going to take a look at replacing the current SoftwareSerial library with this one.


Nov 01, 2008, 05:51 pm Last Edit: Nov 01, 2008, 05:53 pm by mikalhart Reason: 1
IF so, may I make the suggestion that it be modified slightly to inherit from Print before incorporation?  That way we don't have to duplicate the formatting code that Print already provides, especially if/when floating point is added to Print.  It would be nice if the HW and SW serial interfaces were identical.



Good point.  :)

If you're feeling bored and want to do it, that would be fine too.  Otherwise, I'll get to it at some point.



Nov 05, 2008, 07:18 am Last Edit: Nov 05, 2008, 07:19 am by mikalhart Reason: 1
@ladyada and @tatien: May I ask why AFSoftwareSerial seems to support only pins 0-13 (and not 14-19 -- the ones marked "analog in")?

Code: [Select]
  if (_receivePin < 8) {
    // a PIND pin, PCINT16-23
    PCMSK2 |= _BV(_receivePin);
    PCICR |= _BV(2);
 } else if (_receivePin <= 13) {
   // a PINB pin, PCINT0-5
   PCICR |= _BV(0);    
   PCMSK0 |= _BV(_receivePin-8);

@tatien: Can you explain why all instances of your modified AFSoftwareSerial must share the same baud rate?  Is there a physical reason for that, or is it just a matter of convenience?

Thank you,



i think i just didnt consider it. it would be easy to add support for the analog pins, they're PCMSK1. i ought to go and finish up that library... :(


I just created a new project on Google code for this advanced version of SoftwareSerial2. No release yet, still need to do some testing, but should soon be working.



Hi tatien, yr link indicates that you are licensing the library under GNU General Public  License.  The LadyAda code (and all the Arduino code I have seen) is licensed under the GNU Lesser General Public License. If this change in license terms is intentional, IMO you should make it very clear that usage of the code carries obligations that differ from other code for the Arduino.


Not to mention the LGPL requires derivatives to be licensed under the same license.

But I'm sure we'll figure it out.



Is there any activity on this interesting project in the last month?  I'm curious to see how all this will work and eager to tweak it to inherit from Print.  (I do have to report that the current version posted does not seem to work for my EM-406A GPS at 4800 baud, where AFSoftSerial does.  I can't immediately see why, although I'll keep working on it.)


Go Up

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131