Pages: 1 [2]   Go Down
Author Topic: AFSoftwareSerial w/ internal clock 8MHz  (Read 5359 times)
0 Members and 1 Guest are viewing this topic.
Forum Administrator
Cambridge, MA
Offline Offline
Faraday Member
*****
Karma: 12
Posts: 3538
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Austin, TX USA
Offline Offline
God Member
*****
Karma: 5
Posts: 998
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.

Mikal
« Last Edit: November 01, 2008, 11:53:01 am by mikalhart » Logged

Forum Administrator
Cambridge, MA
Offline Offline
Faraday Member
*****
Karma: 12
Posts: 3538
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Good point.  smiley

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

Austin, TX USA
Offline Offline
God Member
*****
Karma: 5
Posts: 998
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'd be delighted!  Thanks.

Mikal
Logged

Austin, TX USA
Offline Offline
God Member
*****
Karma: 5
Posts: 998
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

@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:
  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,

Mikal
« Last Edit: November 05, 2008, 01:19:29 am by mikalhart » Logged

0
Offline Offline
Full Member
***
Karma: 0
Posts: 239
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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... smiley-sad
Logged

Montreal
Offline Offline
Newbie
*
Karma: 0
Posts: 22
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.

http://code.google.com/p/softwareserial2/
Logged

London
Offline Offline
Tesla Member
***
Karma: 10
Posts: 6255
Have fun!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Forum Administrator
Cambridge, MA
Offline Offline
Faraday Member
*****
Karma: 12
Posts: 3538
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

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

Austin, TX USA
Offline Offline
God Member
*****
Karma: 5
Posts: 998
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Tatien--

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.)

Mikal
Logged

Pages: 1 [2]   Go Up
Jump to: