Go Down

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


ok its the Atmega8... I just changed the option to Deicimila and tried compiling... it works fine! perhaps we can add a word of caution about this. Will test it with Atmega168 chip tommorow and let you know how it goes.

pracas  :)


Mar 02, 2009, 05:25 pm Last Edit: Mar 02, 2009, 05:27 pm by etracer Reason: 1

The interrupt vectors and registers are named completely differently for the ATmega8.





After a quick look at the datasheet, I'm not sure that ATmega8 has pin change interrupt capability.


Mar 02, 2009, 06:18 pm Last Edit: Mar 02, 2009, 06:29 pm by mikalhart Reason: 1
Yeah, the Atmega8 is not currently supported by NewSoftSerial, although I'd love to add it.  Beside changing the vectors and registers, does anyone know differences that we would need to accomodate?

EDIT: Oooh, the pin change interrupt is really the foundation of this library.



Sorry I didn't see this sooner.

There's a problem with how the examples are packaged in the latest version (NewSoftSerial7.zip).

The NewSoftSerialTest example has its contents named "SoftSerialTest.pde" instead of "NewSoftSerialTest.pde".  This makes the example inaccessible from the IDE as the directory name must match the .pde filename.




Just to tell that I'm using NewSoftSerial to send data via xbee from one arduino 328p to another arduino 328p

It just works like a charm :) Thanks for you work !

Now I'm thinking of using an arduino pro to have a smaller piece of electronics.
I've seen that support for 8Mhz is in your roadmap mikalhart, so as soon as it works, i buy some arduino pro to test that :)

And again, thanks for your work, really impressive !


Thanks for your support, enzo, and for the feedback on your successful deployment of NewSoftSerial.  There are a couple of us that plan to work on porting to 8 Mhz when we get some time.  I'll keep you posted.

Thanks again,



By the way, do you think it's possible to code a NewSoftSerial.flush() function ?
it empty the buffer in fact

manual is here for remind : http://arduino.cc/en/Serial/Flush



I was trying to run NewSoftSerial7 with arduino-0013 on linux and got a complaint about missing registers:

Code: [Select]

/tmp/ccAd7yGb.s: Assembler messages:
/tmp/ccAd7yGb.s:855: Error: register r24, r26, r28 or r30 required
/tmp/ccAd7yGb.s:912: Error: register r24, r26, r28 or r30 required
/tmp/ccAd7yGb.s:957: Error: register r24, r26, r28 or r30 required

Binary sketch size: 976 bytes (of a 30720 byte maximum)

I use avr-gcc 4.3.3

Code: [Select]
avr-gcc -v
Using built-in specs.
Target: avr
Configured with: ../configure --prefix=/opt/cross --infodir=/opt/cross/share/info --mandir=/opt/cross/share/man --libdir=/opt/cross/lib --libexecdir=/opt/cross/lib --enable-languages=c,c++ --enable-checking=release --with-gxx-include-dir=/opt/cross/include/c++/4.3 --enable-ssp --disable-libssp --with-bugurl=http://bugs.opensuse.org/ --with-pkgversion='SUSE Linux' --disable-libgcj --disable-libmudflap --with-slibdir=/lib --with-system-zlib --enable-__cxa_atexit --enable-libstdcxx-allocator=new --disable-libstdcxx-pch --enable-version-specific-runtime-libs --disable-shared --disable-nls --target=avr --build=i586-suse-linux
Thread model: single
gcc version 4.3.3 [gcc-4_3-branch revision 144878] (SUSE Linux)

It turned out that this error even appears with an empty sketch.
When I downgrade to 4.1.3 I get a different error and 328 support is gone.  >:(

Code: [Select]
Print.h:32: warning: 'class Print' has virtual functions but non-virtual destructor
NewSoftSerial.h:40: warning: 'class NewSoftSerial' has virtual functions but non-virtual destructor
NewSoftSerial.cpp: In member function 'void NewSoftSerial::begin(long int)':
NewSoftSerial.cpp:53: error: inconsistent operand constraints in an 'asm'

Binary sketch size: 998 bytes (of a 14336 byte maximum)

I deleted all the old object files after downgrading the compiler.

It works on windows with V14. I can run it virtualized, but that should not be necessary.


Mar 21, 2009, 04:26 pm Last Edit: Mar 21, 2009, 04:34 pm by mikalhart Reason: 1
Thanks, madworm.  Any other Linux users experiencing issues like this?  Is it just with the 328 that you see this?  Do you get the same errors with AFSoftSerial?  I would guess so, since the error would seem to be located (line 53) in the assembler delay function (tunedDelay/whackDelay).  Very curious.

Is the downgraded compiler really 4.1.3 or is it 4.3.1?



This is all I've got to choose from:

Code: [Select]
Reading installed packages...

S | Name                           | Type    | Version               | Arch | Repository
 | avr-gdb   | package |  | i586 | AVR
v | avr-libc   | package | 1.6.2-2.17            | i586 | AVR
v | avr-libc   | package | 1.6.1-25.1            | i586 | openSUSE-11.0-Oss
i | avr-libc    | package | 1.6.2-2.15            | i586 | (System Packages)
v | avrdude  | package | 5.5-137.8             | i586 | AVR
v | avrdude  | package | 5.5-67.1              | i586 | openSUSE-11.0-Oss
i | avrdude   | package | 5.5-137.7             | i586 | (System Packages)
v | cross-avr-binutils | package | 2.19.51-6.3           | i586 | AVR
v | cross-avr-binutils | package | | i586 | openSUSE-11.0-Oss
i | cross-avr-binutils  | package | 2.19.51-6.2           | i586 | (System Packages)
 | cross-avr-gcc                  | package | 4.1.3_20071030-39.1   | i586 | openSUSE-11.0-Oss
v | cross-avr-gcc43                | package | 4.3.3_20090316-13.1   | i586 | AVR
i | cross-avr-gcc43                | package | 4.3.3_20090126-13.3   | i586 | (System Packages)

The stock openSUSE 11.0 avr packages are rather ancient. I use the ones available via buildservice.

Switching to 11.1 is no option, as KDE4 still sucks big time.


Mar 25, 2009, 08:10 am Last Edit: Mar 25, 2009, 08:18 am by GekoCH Reason: 1
just a question:

Does someone have this library running with Arduino 0011?
mine does not work... (can I just upgrade the avr to 4.3?)
Problem: I do get this error
Code: [Select]

hardware\libraries\NewSoftSerial/NewSoftSerial.h:27:19: error: Print.h: No such file or directory



That's right GekoCH.  NewSoftSerial relies on Print.h, which wasn't introduced until version 0012.

mellis, if I may make another plug for it, this is a good example for how beneficial a

Code: [Select]

would be in the wiring.h.




Mikal, would a strategically placed

Code: [Select]
#ifndef Print_h
#error "Print library required for software serial"

help?  I admit I'm not familiar enough with the arduino pre-preprocessing stage to know for sure.

I too am in favor of a version specific #define.


Go Up