I plan to use the TFT 2.8" shield on the UNO - but i also need 2 x software serial ports. One for communicating with another UNO (for stepmotor control) and one for IR remote.
Right now i use 8-9 and 10-11 and it works fine. But the LCD-shield are using pins 8+9 for data-bits. And pins 10,11,12,13 are used for the SD-card, and i don't want to use the SD-card.
Then the question: If i cut the pins 10,11,12,13 of the shield board, can i then use the pins for software.serial? 10-11 for one port, and 12-13 for the other port.
Using the hardware serial ports (pin 1-2) interfere with the upload of the compiled program, so it is annoying to have to unplug the pins 1-2 when i need to upload.
Fairly straightforward. Buy a Mega2560 or Due. Then you have several extra Hardware Serial ports. As well as lots of spare GPIO pins without hacking the Uno-format shield.
Alternatively buy a Mega2560 Display Shield and a Mega2560 Arduino.
It is "possible" to create Software Serial ports on 10-13 of a Uno but I am not aware of anyone doing so.
Thank you for the reply - i tested if software.serial is working with pins 12+13, and it does.
So i guess that if i don't load the SD-card library, the pins (12+13) are not claimed by any other process.
As i was adviced, i bought MEGA 2560 also from Elegoo - mounted it, and using the Elegoo library it works fine as display.
My display is the 2.8" touch display shield from Elegoo.
The documentation tells me, that i have to put this define in the .h file:
"// **** IF USING THE LCD BREAKOUT BOARD, COMMENT OUT THIS NEXT LINE. ****
// **** IF USING THE LCD SHIELD, LEAVE THE LINE ENABLED: ****
// #define USE_Elegoo_SHIELD_PINOUT"
If i enable the line, i get all kind of errors - even if i use one of the example codes, it is still the same.
OK - thats how it is, but i can't make the SD-card works
Here is the line i have 'stolen' from examples and added to my code:
*const int chipSelect = 10; // change this to 53 on a mega *
In void setup() {
pinMode(chipSelect, OUTPUT); // change this to 53 on a mega
// we'll use the initialization code from the utility libraries // since we're just testing if the card is working! if (!card.init(SPI_HALF_SPEED, chipSelect)) {
Serial.println("initialization failed. Things to check:");*
_ Serial.println("* is a card is inserted?");_
_ Serial.println("* Is your wiring correct?");_
_ Serial.println("* did you change the chipSelect pin to match your shield or module?");_
return;* } else {
Serial.println("Wiring is correct and a card is present.");* }
All i get is "initialization failed" - The SD-SS pin is 10 even though it is clearly stated that i should change it to 53. So i have left it on 10.
I have honestly run out of ideas - can anyone point me in the right direction?
(I am using this thread since the SD card is on my TFT card - if it is wrong, please tell me where to put this post.
I presume that your display is a "Blue 2.8 inch Mcufriend" Uno Shield.
It should work out of the box with MCUFRIEND_kbv library.
And the "showBMP_not_Uno.ino" example explains how to use microSD card with Software SPI on pins 10-13.
The example sketch on GitHub "master" has instructions that are more "up to date" than the example in v2.9.9-Release
I presume that Elegoo has an example for your Mega2560 (but I have not looked)