ILI9341 Library Mystery Reg Writes

EL Wire/Tape/Panels, LEDs, pixels and strips, LCDs and TFTs, etc products from Adafruit

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
Poofjunior
 
Posts: 5
Joined: Thu Oct 14, 2010 11:04 am

ILI9341 Library Mystery Reg Writes

Post by Poofjunior »

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

 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

  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.)

User avatar
adafruit2
 
Posts: 22148
Joined: Fri Mar 11, 2005 7:36 pm

Re: ILI9341 Library Mystery Reg Writes

Post by adafruit2 »

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

Poofjunior
 
Posts: 5
Joined: Thu Oct 14, 2010 11:04 am

Re: ILI9341 Library Mystery Reg Writes

Post by Poofjunior »

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?

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

Re: ILI9341 Library Mystery Reg Writes

Post by Exige »

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?

Locked
Please be positive and constructive with your questions and comments.

Return to “Glowy things (LCD, LED, TFT, EL) purchased at Adafruit”