SoftwareSerial and PinChangeInt vector overlapping

Hi.

Problem over here. In one sketch I am trying to use both <SoftwareSerial.h> and <PinChangeInt.h> libraries (link to the second library: click me). This results in nasty errors:

Arduino: 1.6.1 (Windows 7), Board: "Arduino Uno"

SoftwareSerial\SoftwareSerial.cpp.o: In function `__vector_3':


C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SoftwareSerial/SoftwareSerial.cpp:227: multiple definition of `__vector_3'


ver3.3.cpp.o:C:\Program Files (x86)\Arduino\libraries\PinChangeInt-master/PinChangeInt.h:594: first defined here


SoftwareSerial\SoftwareSerial.cpp.o: In function `SoftwareSerial::read()':


C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SoftwareSerial/SoftwareSerial.cpp:392: multiple definition of `__vector_4'


ver3.3.cpp.o:C:\Program Files (x86)\Arduino/ver3.3.ino:243: first defined here


SoftwareSerial\SoftwareSerial.cpp.o: In function `SoftwareSerial::read()':


C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SoftwareSerial/SoftwareSerial.cpp:392: multiple definition of `__vector_5'


ver3.3.cpp.o:C:\Program Files (x86)\Arduino/ver3.3.ino:243: first defined here


collect2.exe: error: ld returned 1 exit status


Error compiling.

  This report would have more information with
  "Show verbose output during compilation"
  enabled in File > Preferences.

The reason that I am using the second library is that I have already used both avaiable interrupt pins on Uno. Is there any way that I can bypass that errors?

You haven't shown any code.

Please use code tags.

Read this before posting a programming question

Do you want to send or receive using SoftwareSerial? If sending only, there is a version that doesn't use interrupts.

If you do want to do both you could conceivably edit the SoftwareSerial library (or make a copy) that only uses some of the pin-change interrupts.

Why not use HardwareSerial? Why do you need more than two interrupts?

You may be interested in yet another software serial

...R

If sending only, there is a version that doesn't use interrupts.

Where can this library be found?

I ran into the problem while trying to use SoftwareSerial with PCINT3 on an ATTiny85.

I tried ReceiveOnlySoftwareSerial but I get the same errors as with Software Serial:

libraries\ReceiveOnlySoftwareSerial\ReceiveOnlySoftwareSerial.cpp.o (symbol from plugin): In function `ReceiveOnlySoftwareSerial::read()':

(.text+0x0): multiple definition of `__vector_2'

sketch\chest1_1.ino.cpp.o (symbol from plugin):(.text+0x0): first defined here

collect2.exe: error: ld returned 1 exit status

sketch\chest1_1.ino.cpp.o (symbol from plugin):(.text+0x0): first defined here

collect2.exe: error: ld returned 1 exit status

exit status 1
Error compiling for board ATtiny25/45/85.

I am using the Mellis core and 16MHz clock.

Thanks!

perigalacticon:
Where can this library be found?

Using only TX of SoftwareSerial, leaving RX pin free

Thanks it compiles, but I don't see output on serial monitor. Does it support "print" and "println" commands?

EDIT: Sorry I see from your example usage posts that it does.

I replaced the include, declaration and begin statements with SendOnlySoftwareSerial instead of SoftwareSerial. I have timers 0 and 1 set at 'abnormal' conditions to use the interrupts (PLL clock used for timer1); is the send only library compatible with this condition? I am using PCINT3 and both timers in the code already.

Thanks

perigalacticon:
Thanks it compiles, but I don't see output on serial monitor.

Depending on your wiring, I wouldn't expect you to. The serial monitor normally shows what is being sent on hardware serial. You could feed the serial line into something else (eg. another Arduino, or an oscilloscope) to verify it is working.

I have previously read serial data from the ATTiny85 using the standard SoftwareSerial library, transmitting to an UNO that runs a sketch that reads data from the Tiny85 and sends it to the serial monitor.

Should the ReceiveOnly library work if I am running timers0&1 at non-standard settings, along with PCINT3?

On the ATTiny chips that don't have hardware serial, when using my ATTiny core ( GitHub - SpenceKonde/ATTinyCore: Arduino core for ATtiny 1634, 828, x313, x4, x41, x5, x61, x7 and x8 ), you can get access different software serial implementation named Serial (like the hardware serial normally is) - this one uses the analog comparator pins (AIN0, AIN1) and interrupt, leaving the PCINT one free for whatever you want to do with it.

Still has all the other restrictions associated with software implementations of serial.

perigalacticon:
Should the ReceiveOnly library work if I am running timers0&1 at non-standard settings, along with PCINT3?

You mean, the SendOnly library?

From what I can see from the code it uses timed loops for delays, so the timer settings shouldn't affect it.

I resolved the error by doing a clean.

make clean