Go Down

Topic: Programming Due with TFT LCD issue (Read 7642 times) previous topic - next topic

mattnew

Hey all, new to the forum, I picked up a due and a 5" tft lcd display and I'm almost immediately running into a problem.

by itself, the Due seems to work fine, I can upload sketches, everything works fine.

if I connect the display, the computer can't detect the DUE, no Arduino found on COM3 messages. I can unplug the LCD,and then download a sketch, then plug the LCD in and hit reset and everything works. however if I hit reset again it appears that the sketch gets erased. I have to download again

I'm digging.. and I think I've found something, but need some guidance here:
per the Due spec:     Programming port: To use this port, select "Arduino Due (Programming Port)" as your board in the Arduino IDE. Connect the Due's programming port (the one closest to the DC power jack) to your computer. The programming port uses the 16U2 as a USB-to-serial chip connected to the first UART of the SAM3X (RX0 and TX0)"

well, the LCD display also uses RX0 and TX0 and I think what is happening is I might be hitting a situation where I'm getting the soft erase caused by the LCD resetting. I also think the fact that both are using RX0 and TX0 are causing me the upload issues.

any ideas? I'm going to dig some more but I'm wondering how hard it is to move the LCD to RX1 and TX1 aside from changing the pins which would be trivial....

mattnew

well.. it doesn't appear that TX0 and RX0 actually go anywhere on the shield. Pins are there however no connectivity.. so scratch that idea... hmmm...

ghlawrence2000

#2
Dec 18, 2014, 11:52 pm Last Edit: Dec 18, 2014, 11:57 pm by ghlawrence2000
Suggest using AC/DC power supply, 9V/1A does the job. It would be helpful to let us know specifically what shield and TFT you are using.

Code: [Select]
UTFT myGLCD(*****, 25,26,27,28);

Would be a good place to start. Swap ***** for CTE50 or CPLD depending on which display you have.

If it is a CTE shield or cheap Sainsmart rip-off of a CTE shield, you will need to uncomment line 3 in \UTFT\hardware\arm\HW_ARM_defines.h

If you are using the Sainsmart bastardised versions of Hennings UTFT libraries, get the real ones from here. UTFT Libraries

Regards,

Graham

UTFT_SdRaw now included in library manager!! ;) High speed image drawing from SD card to UTFT displays for Mega & DUE.
UTFT_GHL - a VASTLY upgraded version of UTFT_CTE. Coming soon to a TFT near you! 8) Shipping April 1 2016!

mattnew

Thanks for the reply back,

I saw it just as I was logging in to post that I read in another forum ( LCD displays ) some people with issues where the LCD drew too much current for the USB to adequately power  both the Arduino and the LCD.

Turns out this was it, Added a 10.5 Volt supply to the DC input and things are working perfectly now.

It was a sainsmart due/shield/TFT combo that I grabbed. Wanted to mess with something dirt cheap before I bought the real thing. I haven't been using their libraries though, went straight to the source for UTFT and UTOUCH and those seem to be working as I'd expect.



Anyway, Thanks again for the response.

apaolini

Excuse me mattnew, which controller is on your TFT? Is it a CPLD (MD050SD)?

I have a 7" Sainsmart CPLD (MD070SD) and I can't make it work with a shield and a Due, so if someone reads this message and has a similar screen working (even without shield) please let me know, I'd like to see the software.

ghlawrence2000

@Apaolini,

My post on 18th December is equally relevant to you! 'someone' already gave you your answer!

Graham
UTFT_SdRaw now included in library manager!! ;) High speed image drawing from SD card to UTFT displays for Mega & DUE.
UTFT_GHL - a VASTLY upgraded version of UTFT_CTE. Coming soon to a TFT near you! 8) Shipping April 1 2016!

RayLivingston

A 5" LCD will draw FAR more power than the USB port can provide....

Regards,
Ray L.

apaolini

@ghlawrence2000

Sorry, I've read your reply only now; thnk you for your post, but I have some doubt about the fact that my problems depend only on the applied power.

In fact, I tried to connect the screen directly to the Sainsmart Due (excluding the shield) and I provided the power via a programmable PSU (5 VDC, 3.3 VDC and GND to the screen via its pins, 9 VDC and GND to Due), and it behaves as usual (a mess).

Anyway, can you confirm that a SainSmart CPLD (MD070SD or MD050SD, NOT SSD1963) *CAN* be driven by the original UTFT library?

Thanks!

ghlawrence2000

Anyway, can you confirm that a SainSmart CPLD (MD070SD or MD050SD, NOT SSD1963) *CAN* be driven by the original UTFT library?
Actually, no, sorry, I CAN however confirm a CTE 5"CPLD and CTE shield work with unmodified UTFT library and DUE pefectly as expected.

Regards,

Graham
UTFT_SdRaw now included in library manager!! ;) High speed image drawing from SD card to UTFT displays for Mega & DUE.
UTFT_GHL - a VASTLY upgraded version of UTFT_CTE. Coming soon to a TFT near you! 8) Shipping April 1 2016!

apaolini

Thank you anyway; as you can see in my original post Sainsmart CPLD screen, Due and UTFT the CTE 7" works perfectly (by the way, with the USB 5VDC only), but the Sainsmart screens don't. I'd like to know if anyone ever succeeded in this.

ghlawrence2000

#10
Jan 28, 2015, 04:34 pm Last Edit: Jan 28, 2015, 05:50 pm by ghlawrence2000
A friend of mine had a Sainsmart 7" CPLD display, the LCD worked fine, the touch did not. Sainsmart is more trouble than it is worth! Return your display.

Regards,

Graham

Edit: I just read your original (long) post, you have had quite a time of it! My advice stands, return the display and get a CTE display, that will resolve ALL of your current problems. It is annoying/amusing/frustrating the number of newbies that end up in these forums AFTER they bought some Sainshit product or other.... And all to save a few dollars (28th Jan price on ebay.com $69.98 inc p&p for CTE or $63.99 for Sainsmart CPLD 7") all this time and effort is simply not worth your $6!
UTFT_SdRaw now included in library manager!! ;) High speed image drawing from SD card to UTFT displays for Mega & DUE.
UTFT_GHL - a VASTLY upgraded version of UTFT_CTE. Coming soon to a TFT near you! 8) Shipping April 1 2016!

apaolini

#11
Jan 29, 2015, 01:21 pm Last Edit: Jan 29, 2015, 01:27 pm by apaolini
Thank you Graham,

the problem is that being in Italy I prefer buying from european eBay sellers to avoid customs expenses, so at that time there were no CTE, only Sainsmart. Moreover, I need two screens for my project (a billiard scoreboard), and now I got both for the price of one... if only I could make them work  :D

I'm late to return them, so if you could ask your friend what libraries used with his screen, I'd really appreciate. Then, if he confirms he used the original UTFT (in which case I'd like some details), or if I'll have troubles with the touch part, I'll throw them through the window!

Regards,
Andrea

ghlawrence2000

Hi Andrea,

I don't need to ask him, as I helped him from the start when his display first arrived. Originally he was using the Sainsmart modified UTFT libraries, I suggested he download the genuine UTFT libraries, we got the display working fine, but the touch functions were inverted and as such, UTFT_Buttons would not work properly.

I am sorry to hear you now have 2 of the Sainsmart displays, but could you not advertise them on ebay at a reduced rate to move them on, and then when you get some money back, get 1 genuine CTE display from wkws20 (Coldtears ebay name)?

I live in the UK and have ordered plenty of stuff from Hong Kong and China, and touch wood, so far I didn't pay any customs fees, maybe I have just been lucky? Very often the customs declarations just say value $10 gift, even though that is clearly not the case  :P.

Regards,

Graham
UTFT_SdRaw now included in library manager!! ;) High speed image drawing from SD card to UTFT displays for Mega & DUE.
UTFT_GHL - a VASTLY upgraded version of UTFT_CTE. Coming soon to a TFT near you! 8) Shipping April 1 2016!

sailordoc

Dear all,
I know this is an old post but I thought I would provide an update. I would agree with others that probably best to go for the more expensive, and likely more reliable options.

If you have bought a Sain"Smart" (You may want to replace Smart with shi%^#...) these are the steps to get the screen AND touch working (well, it worked for me with 7" display) with Arduino Due:

1/ Ensure Arduino environment is installed
2/ Plug in the DUE only (do not connect the shield or lcd screen) via the programming port
3/ Windows may fail to install driver, but you can help it out as per instructions at https://www.arduino.cc/en/Guide/ArduinoDue
4/ Once driver installed, disconnect the usb from programmin port and connect to native usb port. Follow the same process in step 3. Now you have both usb ports ready to use
5/ Download the UTFT and UTouch libraries from http://www.rinkydinkelectronics.com/library.php?id=51 and install in libraries folder.
6/ Go to folder: [arduino sketches]/libraries/UTFT/hardware/arm
7/ Open file HW_ARM_defines.h
8/ Uncomment the line: #define CTE_DUE_SHIELD 1
9/ Save the file
10/ Go to folder: [arduino sketches]/libraries/UTFT/
11/ Open file: memorysaver.h
12/ Uncomment all the lines except #define DISABLE_SSD1963_800 (5" display)  or  #define DISABLE_SSD1963_800_ALT (7" display)
(this will save you memory space)
13/ Assemble your Due/Shield/TFT display
14/ Connect the Due to a power source via the power plug! Do NOT expect the USB to be able to deliver enough current to drive the Due and LCD!
15/ Connect usb to Due programming port
16/ Open arduino environment
17/ Open Examples/UTouch/Arduino/UTouch_Calibration
18/ Change line: #define TOUCH_ORIENTATION  PORTRAIT   to   #define TOUCH_ORIENTATION  LANDSCAPE
19/ Change line:  UTFT    myGLCD(ITDB32S,38,39,40,41);  to 
UTFT    myGLCD(CTE50,25,26,27,28);
for 5" display
UTFT    myGLCD(CTE70,25,26,27,28);
for 7" display
20/ The line  UTouch  myTouch( 6, 5, 4, 3, 2);  does not need to be altered!
21/ Upload the program and follow the calibration sequence
22/ Open folder [arduino sketches]/libraries/UTouch
23/ Enter the calibration figures in file UTouchCD.h

You should now be able to use any of the examples. But remember to always change the line
UTFT    myGLCD(ITDB32S,38,39,40,41); 
to your correct display.


I hope that helps others and let me know if I forgot something.

Go Up