Go Down

Topic: Display hx8347l (Read 2085 times) previous topic - next topic

Litzy

hi, I am another unfortunate soul to possess hx8347l display. I am creating a project with the Arduino Mega 2560 to control, led, reciprocating pumps, temperature of a marine aquarium. I read the post where he describes the same problem with this bloody display that stays with white screen. I downloaded different libraries and followed the file changes but I can not make it work in any way. I kindly ask you, help explaining step by step the procedure and what libraries to use.
thank you for the time you have dedicated to me.
regards
Lisa

david_prentice

#1
Feb 11, 2017, 11:29 pm Last Edit: Feb 12, 2017, 09:27 am by david_prentice
It "looks" as if your Display is 16-bit Mega2560 Shield.
Please confirm that the photo of the pcb matches the Display that you received.
Some of the "other" photos in the link show different items.

UTFT only supports the HX8347-A
Code: [Select]
#define ITDB32 0 // HX8347-A (16bit)


However,  the HX8347-A is completely different to the HX8347-D, HX8347-G, HX8347-I.

You could probably edit the UTFT driver to suit the HX8347-I.

MCUFRIEND_kbv can support HX8347-I but you need to make several edits:
utility/mcufriend_shield.h:
Code: [Select]
#define USE_SPECIAL             //check for custom drivers

utility/mcufriend_special.h:
Code: [Select]
#define USE_MEGA_16BIT_SHIELD     //RD on PL6 (D43)

MCUFRIEND_kbv.cpp:
Code: [Select]
#define SUPPORT_8347D             //HX8347-D, HX8347-G, HX8347-I +520 bytes, 0.27s


And since your Shield is write-only,   you can not read the ID.  So every sketch needs:
Code: [Select]
tft.begin(0x9595);    //force the ID for HX8347-I

The MCUFRIEND_kbv library is designed for Uno Shields.   I am sorry that you have to make all the edits for a 16-bit Shield.

Please let me know how you get on.   I do not own a HX8347-I.   As far as I know,  most HX8347-I users have got an 8-bit interface.

You can install MCUFRIEND_kbv via the Arduino Library Manager.
You can download UTFT.zip from Henning Karlsen's site and "install ZIP" from the IDE.

David.

Edit.  Add a link to the OP's Ebay item.

Litzy

thanks for the info, I'll try tomorrow this procedure, correcting and making the changes. I will let you know if it works .. https://github.com/arekjan/UTFT

Litzy

I also tried this library,    https://github.com/arekjan/UTFT.   I made some changes, but the result does not change ... white screen. I am wrong some step or I decided to make me mad.

Litzy

I edit the file in UTF folder, open the program Arduino 1.6.10 use the library UTFT - examples - Arduino (AVR) and open the sketch UTF Demo 320x240, modify the parameter UTFT myGLCD, inputting (HX8347I, 38,39,40,41 ), click the button loads and displays the following error:

UTFT_Demo_320x240: 33: error: expected ',' or ';' before 'void'

 void setup ()

 ^

exit status 1
expected ',' or ';' before 'void'

What should I change in order not to see the error?

david_prentice

I gave advice for "my" MCUFRIEND_kbv library.   I obviously know the details of this.

I suggest that you try MCUFRIEND_kbv first.   Unfortunately,   this is a bit fiddly.   But I do know that there are several successful HX8347-I users.

I explained that HX8347-I is different to HX8347-A.    I could write the appropriate HX8347-I "initlcd.h"  for UTFT on your behalf.   However,   Henning Karlsen is the UTFT author.    It is not wise for me to change / adapt / modify his work.

David.

Litzy

sorry for yet another silly question, I downloaded the library MCUFRIEND_ KBV but I can not figure out what to enter in parameters to change.


utility/mcufriend_shield.h:
Code: [Select]
#define USE_SPECIAL             //check for custom drivers

amend paragraph writing what?


utility/mcufriend_special.h:
Code: [Select]
#define USE_MEGA_16BIT_SHIELD     //RD on PL6 (D43)

amend paragraph writing what?


MCUFRIEND_kbv.cpp:
Code: [Select]
#define SUPPORT_8347D             //HX8347-D, HX8347-G, HX8347-I +520 bytes, 0.27s

amend paragraph writing what?


Code: [Select]
tft.begin(0x9595);    //force the ID for HX8347-I
amend paragraph writing what?


david_prentice

All those defines are commented out by default.
Your edit simply means removing the //

Remember to save the files after the edit.

The tft.begin() statement will be in setup() of most sketches.
You must force the correct ID.  e.g. tft.begin(0x9595);

David.

Litzy


thanks for the explanation, I provide now to change. and sorry again for the stupid questions, but as you'll see I do not understand much, actually nothing. :D  The programming is not for me.

Litzy

I made the changes to the file uploaded the sketch "graphictest-KBV and generates the error:
avrdude: stk500v2_setparm (): failed to Set parameter 0x9e
avrdude: stk500v2_command (): unknown status 0xc8
avrdude: initialization failed, rc = -1
         Double check connections and try again, or use -F to override
         this check.

avrdude: stk500v2_command (): unknown status 0x01
Error loading the sketch
avrdude: stk500v2_disable (): failed to leave programming mode

david_prentice

#10
Feb 13, 2017, 09:35 am Last Edit: Feb 13, 2017, 09:35 am by david_prentice
I suggest that you try the Arduino again after you and your PC have had a good night's sleep.

The Arduino and Windows are not happy if you unplug the MEGA2560 when the Serial Terminal is running.

1. Close the Serial Terminal. 
2. Unplug the MEGA2560.   Connect Shield.
3. Re-plug the MEGA2560. 
4. Open the Serial Terminal.   
5. Upload a sketch.

David.

Litzy

I know that you were quite right, windows was already in dreamland, I continued to ask, but he did not answer. This morning I tried it on another pc and like magic the display is in color,  :o  :D it appears drawings and lines .. I should insert the touch function?!? :smiley-confuse:
Many thanks for the help. ;)

david_prentice

Woo-hoo.  So is everything working now?

The Mcufriend Uno Shields have a Resistive Touch Panel which shares pins with the TFT.
Your Mcufriend Mega Shield has an intelligent Touch controller chip i.e. XPT2046

You need a suitable library e.g. UTouch.h, URTouch.h, XPT2046.h, XPT2046_TouchScreen.h

The Touch should work fine.
The microSD will be UNRELIABLE.

David.

Litzy

to display it on for now only view a play of lines, tomorrow URtouch load the library from another PC, why this continues to give errors, and work there is to.
thank you

david_prentice

Please verify whether graphictest_kbv sketch works.

1. readReg() will fail.  you are write-only
2. readID() will fail.   you are write-only.  It will always return 0xD3D3
3. Software Scroll will fail because readPixel(), readGRAM() will fail.  you are write-only.

Colours, Lines, Shapes, Rotations, Text, Vertical Scroll,  Band Scroll, should all work perfectly.

There is no point in investigating Touch until the screen is displaying properly.

David.

Go Up