Go Down

Topic: NewSoftSerial  & Interrupts (Read 604 times) previous topic - next topic

RandyMan

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

Coding Badly

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

gardner

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.

RandyMan

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... :)

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





Coding Badly

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.

Go Up