0

ILI9341 Library Mystery Reg Writes
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

ILI9341 Library Mystery Reg Writes

by Poofjunior on Fri Nov 14, 2014 4:51 am

Hi everyone,

I've cracked open the Adafruit_ILI9341 library
https://github.com/adafruit/Adafruit_ILI9341
to see exactly how the screen is being configured, and I had a question about the init sequence.
It seems that at the beginning, there are a number of "mystery memory address writes" to the ILI9341's memory that look like this:

Code: Select all | TOGGLE FULL SIZE
 if (hwSPI) spi_begin();
  writecommand(0xEF);
  writedata(0x03);
  writedata(0x80);
  writedata(0x02);

  writecommand(0xCF); 
  writedata(0x00);
  writedata(0XC1);
  writedata(0X30);

  writecommand(0xED); 
  writedata(0x64);
  writedata(0x03);
  writedata(0X12);
  writedata(0X81);
 
  writecommand(0xE8); 
  writedata(0x85);
  writedata(0x00);
  writedata(0x78);

  writecommand(0xCB); 
  writedata(0x39);
  writedata(0x2C);
  writedata(0x00);
  writedata(0x34);
  writedata(0x02);
 
  writecommand(0xF7); 
  writedata(0x20);

  writecommand(0xEA); 
  writedata(0x00);
  writedata(0x00);


I've identified all of these as settings written to registers in the ILI9341's memory using the datasheet except for the very first command:
Code: Select all | TOGGLE FULL SIZE
  writecommand(0xEF);
  writedata(0x03);
  writedata(0x80);
  writedata(0x02);


The value 0xEF isn't documented as a command or a memory address in the datasheet? Is this some sort of code needed to initialize the display?

Thanks! (I can make a pull request with comments for the rest of these once I get a better handle on what's going on.)
Poofjunior
 
Posts: 5
Joined: Thu Oct 14, 2010 11:04 am

Re: ILI9341 Library Mystery Reg Writes

by adafruit2 on Fri Nov 14, 2014 1:56 pm

yep, those are undocumented but necessary commands that ILItek and the TFT manufacturer come up with. WELCOME TO WORKING WITH TFTS!!! :) :) :)

adafruit2
Site Admin
 
Posts: 17162
Joined: Fri Mar 11, 2005 7:36 pm

Re: ILI9341 Library Mystery Reg Writes

by Poofjunior on Fri Nov 14, 2014 2:08 pm

Thanks for your reply!

Undocumented but necessary?!

Ok, I cant help asking: how did you know that these particular commands needed to be written at this location?

Was there a previous teardown or driver that I can reference? ...and the datasheet doesn't mention any sort of initialization sequence like this eirher?
Poofjunior
 
Posts: 5
Joined: Thu Oct 14, 2010 11:04 am

Re: ILI9341 Library Mystery Reg Writes

by Exige on Sun Sep 16, 2018 5:53 am

Does someone have more info on this?

I am also interested in knowing what the undocumented (0xEF, 0x03, 0x80, 0x02) commands are for. Especially if they are necessary.

Could they be for power or timing compatibility between the ILI9341 driver and the TFT perhaps?

Exige
 
Posts: 1
Joined: Sun Sep 16, 2018 5:46 am

Please be positive and constructive with your questions and comments.