Pages: 1 ... 4 5 [6] 7 8 ... 11   Go Down
Author Topic: NewSoftSerial Library: An AFSoftSerial update  (Read 12950 times)
0 Members and 1 Guest are viewing this topic.
Chennai, India
Offline Offline
God Member
*****
Karma: 0
Posts: 752
Peace!!!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.

Cheers,
pracas  smiley
Logged

Be The Change...

Indiana
Offline Offline
Full Member
***
Karma: 1
Posts: 234
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

@mikalhart:

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

See:

hardware/tools/avr/avr/include/avr/iom8.h

vs.

hardware/tools/avr/avr/include/avr/iom168p.h

After a quick look at the datasheet, I'm not sure that ATmega8 has pin change interrupt capability.
« Last Edit: March 02, 2009, 11:27:36 am by etracer » Logged

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

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.

Mikal
« Last Edit: March 02, 2009, 12:29:10 pm by mikalhart » Logged

Indiana
Offline Offline
Full Member
***
Karma: 1
Posts: 234
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

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

Thanks!  I fixed it.

Mikal
Logged

Lille - France
Offline Offline
Jr. Member
**
Karma: 0
Posts: 69
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi

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 smiley 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 smiley

And again, thanks for your work, really impressive !
Logged

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

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,

Mikal
Logged

Lille - France
Offline Offline
Jr. Member
**
Karma: 0
Posts: 69
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

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

Good idea.  Consider it done.

Mikal
Logged

"The old Europe"
Offline Offline
Edison Member
*
Karma: 1
Posts: 2005
Bootloaders suck!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Code:
/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:
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.  >smiley-sad

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

• Upload doesn't work? Do a loop-back test.
• There's absolutely NO excuse for not having an ISP!
• Your AVR needs a brain surgery? Use the online FUSE calculator.
My projects: RGB LED matrix, RGB LED ring, various ATtiny gadgets...
• Microsoft is not the answer. It is the question, and the answer is NO!

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

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?

Mikal
« Last Edit: March 21, 2009, 10:34:18 am by mikalhart » Logged

"The old Europe"
Offline Offline
Edison Member
*
Karma: 1
Posts: 2005
Bootloaders suck!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

This is all I've got to choose from:

Code:
Reading installed packages...

S | Name                           | Type    | Version               | Arch | Repository
--+--------------------------------+---------+-----------------------+------+------------------
  | avr-gdb   | package | 6.8.50.20081120-39.6  | 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 | 2.18.50.20080409-12.1 | 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.
Logged

• Upload doesn't work? Do a loop-back test.
• There's absolutely NO excuse for not having an ISP!
• Your AVR needs a brain surgery? Use the online FUSE calculator.
My projects: RGB LED matrix, RGB LED ring, various ATtiny gadgets...
• Microsoft is not the answer. It is the question, and the answer is NO!

Switzerland
Offline Offline
Sr. Member
****
Karma: 0
Posts: 268
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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:
hardware\libraries\NewSoftSerial/NewSoftSerial.h:27:19: error: Print.h: No such file or directory

Thx
Geko
« Last Edit: March 25, 2009, 02:18:08 am by GekoCH » Logged

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

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:
#define ARDUINO_VERSION 15

would be in the wiring.h.

Thanks,

Mikal
Logged

0
Offline Offline
Faraday Member
**
Karma: 7
Posts: 2526
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Mikal, would a strategically placed

Code:
#ifndef Print_h
#error "Print library required for software serial"
#endif
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.

-j

Logged

Pages: 1 ... 4 5 [6] 7 8 ... 11   Go Up
Jump to: