8MHz NewSoftSerial released

Hi all–

I posted NewSoftSerial 8 tonight. This is a fairly major release that supports 8MHz Arduino Pro and Arduino Pro Mini. In addition, it also provides a new flush() member and a couple of other little goodies. Feel free to read my little dissertation on it. :slight_smile:

Forthcoming versions should see support for signal inversion and flow control.


Thanks Mikal.

did you code specifically for special cases of 8 and 16MHz, or did you abstract it so that it calculates based on the supplied (e.g. #defined) clock speed? Would it, for example, work at 20MHz?

I don't have any specific project, just curious how you tackled the problem.



It finally compiles and works on linux !

  • avr-gcc 4.3.3_20090316-13.1
  • multiple instances, speeds: 2400, 19200

@kg4wsv: I hand-tuned custom lookup tables (stored in flash) for each of 8MHz and 16Mhz. I LOVE the idea of calculating the values, and worked at it from that angle for some time, but I couldn't quite get it to work without fudging the values, so I eventually abandoned the (runtime) calculations. You may have heard the saying "in theory, theory and practice are the same, but in practice they never are". That's what happened here.

So no, it doesn't support 20MHz yet, although now that I know the drill I don't think it would take very long to support it. However, nobody has sent me a 20MHz Arduino to test with, so I guess I won't be able to. :)

@madworm: I'm delighted that the new NSS works for you, although I'm afraid I haven't the faintest idea why. Yours was the only Linux installation I heard of that failed to compile, so I didn't spend much effort after that initial flurry trying to understand the problem. So what's the difference?? Can you tell us?

And thank you for playing with multiple instances.



I did a diff on the files. Not much has changed. The assembler code of the tunedDelay is exactly the same, which made V7 fail on my system. I can see that you've changed SIGNAL(...) to ISR(...), but it still works if i revert that. V7 still fails to compile.

Beats me.

Just a courtesy alert:

Because of a timing change in digitalRead() in Arduino v. 0015, NewSoftSerial does not currently work very well with the new release, especially at the higher baud rates.

I should have a new version that plays well with all Arduino releases in the next few days. Sorry for the inconvenience.