Interfacing Pic to HX8347-A?

Thread Starter

spinnaker

Joined Oct 29, 2009
7,830
Well your wrong. Had I gone on you "why not try it" I would have wasted hours for nothing. You can be very helpful to forum members but also very hostile too.

I did some more investigating and it looks like this eBay device is very different than the actual controller I think I will post under a new subject line hopefully will get some more notice.
 

Thread Starter

spinnaker

Joined Oct 29, 2009
7,830
Well I've never considered encouraging someone in their work to be "very hostile."

Sorry but that is not how I took, I think it is fairly obvious that I can just try it but the purpose of this forum is to share useful information. I was hoping I would find someone to point me in the write direction so that I am not chasing after something that simpley does not work.
 

Thread Starter

spinnaker

Joined Oct 29, 2009
7,830
After getting some information on the microchip forum I found that the eBay board is indeed compatible with the HX8347 datasheet. The whole problem for me is that the HX8347 datasheet is not very descriptive at least to me. While some datasheets give me a little trouble I eventually figure at least most of it out. The microchip datasheets are one of the easiest for me to figure out. But his HX8347 is very difficult. I am guessing a solid understanding of TFT displays is required since the HX8347 is simply the controller.

I found some code that looks pretty complete. Probably the best I have found to date.

https://blackrynius.wordpress.com/2011/05/03/hx8347-a-lcd-code-for-pic18f4580/

Here is the init code for the device.

Code:
LCD_REST = 1;

Delay10KTCYx(1); //5ms delay

LCD_REST = 0;

Delay10KTCYx(3); //10ms delay

LCD_REST = 1;

Delay10KTCYx(3); //20ms delay



//Vendor gamma

LCD_write_COM_DATA(0x0046,0x00a4);

LCD_write_COM_DATA(0x0047,0x0053);

LCD_write_COM_DATA(0x0048,0x0000);

LCD_write_COM_DATA(0x0049,0x0044);

LCD_write_COM_DATA(0x004a,0x0004);

LCD_write_COM_DATA(0x004b,0x0067);

LCD_write_COM_DATA(0x004c,0x0033);

LCD_write_COM_DATA(0x004d,0x0077);

LCD_write_COM_DATA(0x004e,0x0012);

LCD_write_COM_DATA(0x004f,0x004c);

LCD_write_COM_DATA(0x0050,0x0046);

LCD_write_COM_DATA(0x0051,0x0044);




//240x320 window settings

LCD_write_COM_DATA(0x0002,0x0000); //Column address start2

LCD_write_COM_DATA(0x0003,0x0000); //column address start1

LCD_write_COM_DATA(0x0004,0x0000); //Column address end2

LCD_write_COM_DATA(0x0005,0x00ef); //Column address end1

LCD_write_COM_DATA(0x0006,0x0000); //Row address start2

LCD_write_COM_DATA(0x0007,0x0000); //Row address start1

LCD_write_COM_DATA(0x0008,0x0001); //Row address end2

LCD_write_COM_DATA(0x0009,0x003f); //Row address end1



//display settings

LCD_write_COM_DATA(0x0001,0x0006); //IDMON=0,INVON=1,NORON=1,PTLON=0

LCD_write_COM_DATA(0x0016,0x00c8); //MY=0,MX=0,MV=0,ML=1,BGR=0,TEON=0

LCD_write_COM_DATA(0x0023,0x0095); //N_DC=1001 0101

LCD_write_COM_DATA(0x0024,0x0095); //PI_DC=1001 0101

LCD_write_COM_DATA(0x0025,0x00ff); //I_DC=1111 1111



LCD_write_COM_DATA(0x0027,0x0002); //N_BP=0000 0010

LCD_write_COM_DATA(0x0028,0x0002); //N_FP=0000 0010

LCD_write_COM_DATA(0x0029,0x0002); //PI_BP=0000 0010

LCD_write_COM_DATA(0x002a,0x0002); //PI_FP=0000 0010

LCD_write_COM_DATA(0x002c,0x0002); //I_BP=0000 0010

LCD_write_COM_DATA(0x002d,0x0002); //I_FP=0000 0010



LCD_write_COM_DATA(0x003a,0x0001); //N_RTN=0000,N_NW=001

LCD_write_COM_DATA(0x003b,0x0000); //P_RTN=0000,P_NW=001

LCD_write_COM_DATA(0x003c,0x00f0); //I_RTN=1111,I_NW=000

LCD_write_COM_DATA(0x003d,0x0000); //DIV=00

Delay1KTCYx(2); //1ms delay

LCD_write_COM_DATA(0x0035,0x0038); //EOS=38h

LCD_write_COM_DATA(0x0036,0x0078); //EQP=78h

LCD_write_COM_DATA(0x003e,0x0038); //SON=38h

LCD_write_COM_DATA(0x0040,0x000f); //GDON=0fh

LCD_write_COM_DATA(0x0041,0x00f0); //GDOFF



//Power Supply Settings

LCD_write_COM_DATA(0x0019,0x0049); //CADJ=0100,CUADJ=100,OSD_EN=1,60Hz

LCD_write_COM_DATA(0x0093,0x000f); //RADJ=1111, 100%

Delay1KTCYx(2); //1ms delay

LCD_write_COM_DATA(0x0020,0x0040); //BT=0100

LCD_write_COM_DATA(0x001d,0x0007); //VC1=111

LCD_write_COM_DATA(0x001e,0x0000); //VC3=000

LCD_write_COM_DATA(0x001f,0x0004); //VRH=0011



//VCOM Settings

LCD_write_COM_DATA(0x0044,0x004d); //VCM=101 0000

LCD_write_COM_DATA(0x0045,0x000e); //VDV=1 0001

Delay1KTCYx(2); //1ms delay

LCD_write_COM_DATA(0x001c,0x0004); //AP=100

Delay1KTCYx(4); //2ms delay

LCD_write_COM_DATA(0x001b,0x0018); //GASENB=0,PON=1,DK=1,XDK=0,VLCD TRI=0,STB=0

Delay1KTCYx(2); //1ms delay

LCD_write_COM_DATA(0x001b,0x0010); //GASENB=0,PON=1,DK=0,XDK=0,VLCD TRI=0,STB=0

Delay1KTCYx(2); //1ms delay

LCD_write_COM_DATA(0x0043,0x0080); //set VCOMG=1

Delay1KTCYx(4); //2ms delay



//Display On Setting

LCD_write_COM_DATA(0x0090,0x007f); //SAP=0111 1111

LCD_write_COM_DATA(0x0026,0x0004); //GON=0,DTE=0,D=01

Delay1KTCYx(2); //1ms delay

LCD_write_COM_DATA(0x0026,0x0024); //GON=1,DTE=0,D=01

LCD_write_COM_DATA(0x0026,0x002c); //GON=1,DTE=0,D=11

Delay1KTCYx(2); //1ms delay

LCD_write_COM_DATA(0x0026,0x003c); //GON=1,DTE=1,D=11



//Internal Register Settings

LCD_write_COM_DATA(0x0057,0x0002); //TEST_Mode=1: into test mode

LCD_write_COM_DATA(0x0095,0x0001); //SET DISPLAY CLOCK AND PUMPKING CLOCK TO SYCRONIZE

LCD_write_COM_DATA(0x0057,0x0000); //TEST Mode=0:exit TEST Mode



LCD_write_COM(0x0022);
While I understand basically what is going on. That the various registers are being set, I am struggling to understand what each of these registers are actually doing or better why the programmer is setting them or knew the need to set them.

I found a couple of tutorials online but basically they are just how to hook up the chip then run this code. It would be nice to know what the code is doing and why. So far I have not founs that type of tutorial.
 

michael8

Joined Jan 11, 2015
415
If you follow your link to ebay and follow the link on ebay where it says:

Data download: 2.4" TFT LCD Module

you get a rar file with non-printing non-english file names. There is a pdf file in there with the name containing ILI9325.pdf.

This appears to be an english datasheet for the LCD controller chip (and it's 111 pages). Oh, just googling for ILI9325
brings up the first link with a later version of the data sheet...


www.hpinfotech.ro/ILI9325.pdf

PS: I haven't used this or any other LCD controller...
 

Thread Starter

spinnaker

Joined Oct 29, 2009
7,830
If you follow your link to ebay and follow the link on ebay where it says:

Data download: 2.4" TFT LCD Module

you get a rar file with non-printing non-english file names. There is a pdf file in there with the name containing ILI9325.pdf.

This appears to be an english datasheet for the LCD controller chip (and it's 111 pages). Oh, just googling for ILI9325
brings up the first link with a later version of the data sheet...


www.hpinfotech.ro/ILI9325.pdf

PS: I haven't used this or any other LCD controller...
Thanks but mine is based on the HX8347 and I do have the datasheet (there was a similar rar file on the page where I ordered the product.). It is just that it is not very descriptive. No where near like microchip's datasheets.
 

Thread Starter

spinnaker

Joined Oct 29, 2009
7,830
Did you look at the ILI datasheet?

The initialization code isnt that dramatic.

Googling said chip names isnt far off either.
Gives you this link: http://blog.iteadstudio.com/initialization-for-ili9325c-ili9325d-ili9327-and-hx8347-a/

With better comments. What do you expect? One of these PIC assembler tutorials?

Did you try to get it going? What is the problem?

View attachment 78613
No problem so far. In the process of bread boarding it all. I did not realize the ILI9325 was essentially compatible with the HX8347. I will take a look at that datasheet to see if it is more palatable.
 

ErnieM

Joined Apr 24, 2011
8,377
Is there some reason not to use the Microchip driver which already has a complete ResetDevice() function for this device along with the Microchip graphics libraries showing objects built in the Microchip Graphic Display Designer?

They all worked nicely for me in 2011.
 

Thread Starter

spinnaker

Joined Oct 29, 2009
7,830
Well I got this thing all wired up and it is not working. I suspect there is something wrong with the device. All I need to do is to connect DB1 and ground. When I measure the voltage on DB1 the level can be 2-3 volts under the 5V supply. Disconnect the ground and it pops up to where it should be. DB0 works fine with ground connected.

Any idea what could be wrong? DB1 shorted internally or something?
 
Top