Go Down

Topic: NewSoftSerial Library: An AFSoftSerial update (Read 18844 times) previous topic - next topic

mikalhart

As long as the clock is 16MHz, I think it's a fair bet that it will work, although I haven't tested anything but the Diecimila.

John_Ryan

I've got a few unassembled RBBBs laying around with 16mhz crystals so il put in a 328, when they arrive, and give it a spin.

mellis

Wow, you guys are amazing.  Nice inline assembly fix.  I'm going to upgrade the Mac AVR tools to the latest version from AVR Mac Pack (which includes avr-gcc 4.3.2).  

halley

mellis, where will you be posting them?  An update to 0013 zip?  Or just instructions on what to grab from another site to do surgery ourselves?

The inline assembly is cool but only works on a case-by-case basis, and there are other folks (including me) who have been bitten by the broken interrupt handlers on OSX.

mikalhart

@mellis, back when I was investigating the problem with the broken Ubuntu random() function, the guys on the avr-libc forum advised steering clear of the 4.3.0 avr-gcc compiler, which they characterized as "broken".  I thought it was funny that that's the version we use with Windows Arduino.  Perhaps it would be good to upgrade *all* the Arduino distros to 4.3.2?

Mikal

mellis

Good point.  The latest version of WinAVR has gcc 4.3.2, too.  I hope to upgrade both OSes for Arduino 0014.

mikalhart

#36
Feb 16, 2009, 04:37 am Last Edit: Feb 16, 2009, 05:01 am by mikalhart Reason: 1
I'm happy to say that I have incorporated etracer's mods to NewSoftSerial and after running the Windows-compiled object through my baud rate test suite, I find that the slightly longer RX interrupt handlers do not significantly affect the error rate.

Code: [Select]
ERROR RATES
  | 300  | 1200 | 2400 | 4800 | 9600  | 14.4K | 19.2K  |  28.8K | 31.25K  | 38.4K  | 57.6K  | 115.2K
TX |  0%  |  0%  |  0%  |  0%  |  0%   |   0%  |   0%   |   0%   |   0%    |   0%   |    0%  |    0%
RX |  0%  |  0%  |  0%  |  0%  |  0%   |   0%  |   0%   |   0%   |   0%    | 0.1%   | 0.35%  |   N/A


@mellis: I would love to be able to make etracer's fix conditional on whether it is needed.  This seems an excellent example of a use case that would benefit from the

Code: [Select]
#define ARDUINO_VERSION 14

proposal I made.

OSX users: Please test.  And would someone please compile NSS 5 on OSX for Diecimila/Duemilanove and send me the binary?  I would like to run it through my test bench.

Mikal

http://sundial.org/arduino/index.php/newsoftserial/




etracer

I'm getting a "Page not found" error when trying to download the latest version.

mikalhart

Ouch.  Sorry.  I thought I had tested all the links.  Try again.

http://sundial.org/arduino/NewSoftSerial/NewSoftSerial5.zip

Mikal

etracer

#39
Feb 16, 2009, 11:11 pm Last Edit: Feb 16, 2009, 11:13 pm by etracer Reason: 1
Quote
And would someone please compile NSS 5 on OSX for Diecimila/Duemilanove and send me the binary?  I would like to run it through my test bench.


Check your private messages.

mikalhart

#40
Feb 17, 2009, 07:29 am Last Edit: Feb 17, 2009, 07:29 am by mikalhart Reason: 1
Tonight I thoroughly tested etracer's OSX build of NewSoftSerial v5 and it performs admirably at all supported baud rates, perhaps even slightly better than the Windows build.

Thanks again, etracer, for your work.

Mikal

ladyada

i fixed a small bug in the interrupt names that was giving 328's a 'compiles but freaks' problem
also made the examples folder a little neater
otherwise, works very nicely with 1 GPS module under v13 ide on windows and mac osx tested with 168 and 328p

http://www.ladyada.net/media/gpsshield/NewSoftSerial_18-02-09.zip

mikalhart


mikalhart

#43
Feb 20, 2009, 07:56 pm Last Edit: Feb 20, 2009, 08:11 pm by mikalhart Reason: 1
I posted NewSoftSerial 6 today, which contains ladyada's contributions.  This new version supports the Atmega328p that she sells.  Go buy a bunch of them.

Thanks,

Mikal

ladyada

well, to be specific, it should work under any 328p
-however- the interrupt bug in v13 is not resolved so there may be freaky experiences.

Go Up