Hi, so I'm using Mega 2560 and I'm wondering about which pins i should be using for serial communication and why. I want to be able to keep communication open with my computer via usb while also communicating with another Mega 2560.
For clarification, I'll refer to the Arduino Mega connected to both my pc & the other Arduino as: Mega 1, and the other Mega 2.
My initial plan was to keep Mega 1's pins 0/TX0 & 1/RX0 free for my pc, and then use any of two pairs of RX/TX pins from 14-19 labelled as communication for connecting with Mega 2. I used the SoftwareSerial Library to define my pins for communicating to Mega 2. However after i tried to do this the Mega 1 couldn't receive data from Mega 2... it could transmit data to Mega 2 just fine. After some investigating i came across this on one of the Arduino pages on SoftwareSerial:
//Note: 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 i defined RX as 50 & TX as 49 and it now seems to be working fine.
My questions about this are:
- My understanding of change interrupts are that when a detected change occurs it is then prioritized above other tasks to allow for immediate execution... is my understanding correct?
- Is the reason why i could not get the specified communication pins to work only because of the SoftwareSerial Library i was using?
- What is purpose of having those pins dedicated as communication pins? and how can i properly utilized them?
Thanks so much for your time and input!