Pages: [1]   Go Down
Author Topic: SoftwareSerial with Mega pins confusion  (Read 562 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 13
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi guys,

I am a bit confused with assigning pins for SoftwareSerial. So I have Mega ADK board and a Bluetooth Silver Mater that I want to connect. I've seen examples of SoftwareSerial using pins 2-13 no problem. However, I have a motor shield which uses up those pins.

So I thought ok I'll just use other pins. Know, I've found that on mega, there is only a set of pins that you can use
Quote
Not all pins on the Mega and Mega 2560 support change interrupts, so only the following can be used for RX: 10, 11, 12, 13, 50, 51, 52, 53, 62, 63, 64, 65, 66, 67, 68, 69

So at first I was a bit lost with 50-69 pins. But then I worked out that ok 63 = 15(RX3), 64 = 14(TX3). So I plugged the TX,RX pins into 14,15 and I thought of we go right?
Code:
SoftwareSerial bluetooth(15,14);
No.

No matter which pins I use, nothing gets received.

Can I not use these pins because they for Serial3? I am not using Serial3 anywhere.

Thanks in advance.
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 617
Posts: 49463
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Using the HardwareSerial pins to do software serial doesn't make sense. If the hardware serial pins are available, why are you not using one of the HardwareSerial instances?

SoftwareSerial is for boards that don't have 4 hardware serial ports.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 13
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Ah that explains everything.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 13
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Is there a place where I can read how to use HardwareSerial, cause I can't seem to find any examples or tutorials. Hmmmm


Thanks
Logged

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 361
Posts: 17294
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Is there a place where I can read how to use HardwareSerial, cause I can't seem to find any examples or tutorials. Hmmmm


Thanks

Well there are lots of example sketches using serial in the files/Examples/Communications menu.
And the Serial library is pretty well documented here:

http://arduino.cc/en/Reference/Serial

Lefty
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 13
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I get it now. I did not realise Serial1, 2 and 3 were Instances of HardwareSerial. dough!
Logged

Pages: [1]   Go Up
Jump to: