I am trying to program an ATMega2560 chip on a designed PCB. I'm with a group designing this product and I am responsible for writing the code that will be used on the PCB. Since the ATMega chip is on a different board on the ArduinoMega2560, how would I go about using specific pins?
For example, if I wanted to use pins number 35 and 36 (pin names PL0 and PL1 respectivley) as TX and RX pins with the SoftwareSerial library, would the following command correctly define the referenced chip pins as a transmitter receiver pair?
I think you are correct...here is some more information from an example I found! Hope this helps.
"The circuit:
* RX is digital pin 10 (connect to TX of other device)
* TX is digital pin 11 (connect to RX of other device)
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
Not all pins on the Leonardo and Micro support change interrupts,
so only the following can be used for RX:
8, 9, 10, 11, 14 (MISO), 15 (SCK), 16 (MOSI).
created back in the mists of time
modified 25 May 2012
by Tom Igoe
based on Mikal Harts example "
This example code is in the public domain.
#include <SoftwareSerial.h>
SoftwareSerial mySerial(10, 11); // RX, TX