0

Arduino Mega with 2"8 TFT Touch Screen + Motor Stepper Cpntr
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Arduino Mega with 2"8 TFT Touch Screen + Motor Stepper Cpntr

by marchino283 on Sat Aug 09, 2014 7:08 am

Hi, sorry for my bad english, i need to know if possible use together this products:
Motor Stepper shield:
http://www.adafruit.com/products/1438
2"8 TFT Touch Screen:
https://learn.adafruit.com/adafruit-2-8-tft-touch-shield-v2/overview

With Arduino Mega 2560.

If i put the 2"8 TFT up the arduino, i can connect the motor shield out side the board of arduino, but the digital pins are used by TFT so i think i need change the pins number in the library but where and how?, i need to control 2 stepper motor
Thank a lot
bye

marchino283
 
Posts: 4
Joined: Sat Aug 09, 2014 6:54 am

Re: Arduino Mega with 2"8 TFT Touch Screen + Motor Stepper C

by adafruit_support_bill on Sat Aug 09, 2014 8:36 am

The V2 motor controller uses the I2C bus, You can stack up to 32 of them using only the SDA and SCL pins: https://learn.adafruit.com/adafruit-mot ... ng-shields

There is no conflict with the 2.8" TFT.

adafruit_support_bill
 
Posts: 74334
Joined: Sat Feb 07, 2009 10:11 am

Re: Arduino Mega with 2"8 TFT Touch Screen + Motor Stepper C

by marchino283 on Mon Aug 11, 2014 3:27 pm

Thank you very much… it all ok now..

marchino283
 
Posts: 4
Joined: Sat Aug 09, 2014 6:54 am

Re: Arduino Mega with 2"8 TFT Touch Screen + Motor Stepper C

by SWISSKNIFE93 on Thu Sep 12, 2019 9:20 am

IMG_20190912_150741.jpg
Current Setup with ArduinoMega2560 and Adafruit MotorShield v2 and 2.8" TFT LCD mcufriend
IMG_20190912_150741.jpg (883.44 KiB) Viewed 39 times
Hi, I wanted to ask if it worked!

I am also trying to use a 2.8" TFT LCD shield(mcufriend) and the motor shield (Adafruit v2.3) with an Arduino Mega2560 in order to control 2 stepper motors (and 7 servos) with the touchscreen. I have stacked the three on top of each other and been successfully running a Motor control program and a Touch Screen program separately. I am currently merging the two programs, such that the servo motors can also be controlled by the Touchscreen. (The servos work fine, since I use the uneven pins 31-43 for the steering signal and the Vin and Gnd for powering them). What happens is that the resistive Touchscreen freezes and nothing works anymore when i run the initialization of the command in the setup(): AFMS.begin();

After a bit of digging in the libraries(Adafruit_MotorShield.cpp and mcufriend_kbv) I found out that the motor shield(Adafruit) uses (digital)pins 2-13 for the pwm signal transmission while the touch shield(mcufriend) uses (digital) pins 2-9. Thus there is a clash of pin usage and they are not compatible with each other. Is this correct or is there another Problem?

Now I am hoping to solve that Problem with ordering the 2.8" TFT LCD Shield with resistive or capacitive Touch from Adafruit.
I understand that the resistive touch shield uses SPI and the capacitive touch shield uses I2C for control.
Is it correct that the resitive touch shield will not be compatible with the motor shield?
Is it correct that the capacitve touch shield is compatible with the motor shield?

2.8" TFT Touch Shield for Arduino with Capacitive Touch: https://www.adafruit.com/product/1947
2.8" TFT Touch Shield for Arduino with Resistive Touch Screen: https://www.adafruit.com/product/1651
Adafruit Motor/Stepper/Servo Shield for Arduino v2 Kit - v2.3: https://www.adafruit.com/product/1438
Stepper Motors(2; two phases, 4 cables): https://www.welco.net/product/wpm/wpm_g ... ide03.html
Servo Motors(7; 3 cables): https://servodatabase.com/servo/modelcraft/rs-2
2.8" TFT Touch Shield for Arduino with Resistive Touch Screen from mcufriend: https://www.banggood.com/de/Geekcreit-U ... rehouse=UK

SWISSKNIFE93
 
Posts: 2
Joined: Thu Sep 12, 2019 8:36 am

Re: Arduino Mega with 2"8 TFT Touch Screen + Motor Stepper C

by adafruit_support_bill on Thu Sep 12, 2019 9:33 am

After a bit of digging in the libraries(Adafruit_MotorShield.cpp and mcufriend_kbv) I found out that the motor shield(Adafruit) uses (digital)pins 2-13 for the pwm signal transmission

That is not correct. The motor shield generates its own PWM. It uses only the SDA and SCL pins for i2c communication with the shield. Since i2c is a bus, these pins can be shared with other i2c devices. ALL other pins are available for use with other devices.

adafruit_support_bill
 
Posts: 74334
Joined: Sat Feb 07, 2009 10:11 am

Re: Arduino Mega with 2"8 TFT Touch Screen + Motor Stepper C

by SWISSKNIFE93 on Thu Sep 12, 2019 10:16 am

Okay, thank you for the information. So the problem is something else. But what?

I see two sources for the problem:
1. Shared pins ->(see below for pin usage)
2. Power consumption at initialization -> Does it require a lot of Juice when the Motor Shield is initialized with AFMS.begin()?
What other problem sources do exist?

Display uses:
pins 2-9 for LCD signal transmission
pins 10-13 for SD Card (unused in my case)
A5 LCD_RST (Reset)
A4 LCD_CS (Chip Select)
A3 LCD_RS (Register Select)
A2 LCD_WR (Write Data)
A1 LCD_RD (Read Data)

Touch capacity uses:
pins 6, 7, A1, A2 (The libraries share pins A1 and A2, but can be controlled by pinmode(pin, mode))

SWISSKNIFE93
 
Posts: 2
Joined: Thu Sep 12, 2019 8:36 am

Re: Arduino Mega with 2"8 TFT Touch Screen + Motor Stepper C

by adafruit_support_bill on Thu Sep 12, 2019 11:08 am

A5 LCD_RST (Reset)
A4 LCD_CS (Chip Select)

These are SDA and SCL for the 'classic' Arduinos that the motor shield was originally designed for.

Your Mega has plenty of other pins to choose from, so you should re-assign those LCD functions to other pins.

adafruit_support_bill
 
Posts: 74334
Joined: Sat Feb 07, 2009 10:11 am

Please be positive and constructive with your questions and comments.