Pages: [1]   Go Down
Author Topic: NewSoftSerial  & Interrupts  (Read 568 times)
0 Members and 1 Guest are viewing this topic.
Houston Area
Offline Offline
Jr. Member
**
Karma: 0
Posts: 68
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Reading the form for info but I have a quick question...or two.
I have downloaded the NewSoftSerial 10 which I assume has the support for Mega (Specific pins for RX)

I don't want to keep polling for data for Duemilanove and Mega.

Can I use "attachInterrupt()"?  NewSoftSerial does not use Interrupts?
Thanks
Randy
Logged

Global Moderator
Dallas
Offline Offline
Shannon Member
*****
Karma: 200
Posts: 12779
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
I have downloaded the NewSoftSerial 10 which I assume has the support for Mega (Specific pins for RX)
About a month ago the answer would have been "no".  If version 10 has been released recently then the Mega may be supported.  There is a topic somewhere in the forum about Mega support.  Included are instructions to get it working.

Quote
Can I use "attachInterrupt()"?
You are certainly welcome to use attachInterrupt but it will have no effect on NewSoftSerial.

Quote
NewSoftSerial does not use Interrupts?
It uses "pin change interrupts".
Logged

Ontario
Offline Offline
God Member
*****
Karma: 24
Posts: 862
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

If you have a mega, you have four separate hardware UARTs to work with.  Why are you messing with software serial?

NewSoftSerial does use interrupts, although only for receiving so you would have to look out for conflicts there.
Logged

Houston Area
Offline Offline
Jr. Member
**
Karma: 0
Posts: 68
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

My understanding is that attachInterrupt () uses the hardware interrupt.

Perhaps I don't I understand but...
If I use for example attachInterrupt (Interrupt, function, Change) in  void setup() then it will run the function when the pin changes for that interupt. Interrupts are tied to 4 pins.
Instead of polling inthe program for data.
I have not seen any examples of NewSoftSerial using this aproach.

I'm I clear as mud... smiley

The goal is to pass data through serial from two maybe thress Duem or Uno to Mega.
I like to use serial TX and RX.

Thanks
Randy




Logged

Global Moderator
Dallas
Offline Offline
Shannon Member
*****
Karma: 200
Posts: 12779
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
My understanding is that attachInterrupt () uses the hardware interrupt.
It does.

Quote
I have not seen any examples of NewSoftSerial using this aproach.
What approach?  Sending data in an interrupt service routine?  Receiving data in an interrupt service routine?

Quote
The goal is to pass data through serial from two maybe thress Duem or Uno to Mega.  I like to use serial TX and RX.
Seems reasonable to me.
Logged

Pages: [1]   Go Up
Jump to: