Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 5 of 5

Thread: ILI9225 Optimized Library

  1. #1
    Junior Member
    Join Date
    Feb 2015

    ILI9225 Optimized Library

    Here we have a library for the ILI9225 2.2" 176x220 display commonly found on ebay (which is where i purchased mine). But let me start with a thank you to the creator of the teensy boards and also to the creators of the original libraries which i put this one together with. It uses Paul's fast SPI code to talk to the display... it also has all the functions that are in the ILI9341_t3 library (which this one is mainly based on) are the same in this library so there will be compatibility which should only require changing library #includes and display and initializers ... the rest of the functions should be the same. I also added some more functions and other small changes as well (which took me quite some time) like width() height() functions do NOT return 176x220 ... they return 175x219 which is usuable values without taking one away for the zero index in writing code... all the subtractions in the library for all functions where also removed. Another change was i had to take/borrow a part of the SPI library, the chip select function, as i could not get the SPI registers to toggle the _rs line on the display... it did toggle clock select but not the _rs line, so i started looking into the datasheet and found a lot of configuration options for SPI. One option i did find was the SRE bit for SPI... once i enabled it the _rs line was being toggled properly by the the SPI register... i modified the chip select function from the SPI library and included it in this library to manually add the SRE bit.

    Most of this code is not my own and has been used from other libraries which really... in my opinion... should take the credit for it... as i just modified some of the code so the pixels where correct spending alot of time looking through a magnifying glass to ensure the correct pixels was on (i actually only test to the corners and then again -1 from all edges so there was a row of pixels not lit and a row next to it that was lit, and basic checking like that). All rotations can also be inverted/flipped so text/draws are displayed right->left and text is written backwards so the screen can be turned any way round.

    For the most part, it is identical to the functioning of the Highly optimized ILI9341_t3 library, i also named this one ILI9225_t3 as it used the same transmission functions and the public functions was the same, so a library and initializer could be changed and a change of display will still run on the same main code that was written.

    Here is the Adafruit timings from the demo... also a demo of UTFT and a bitmap demo ... although i did not include the UTFT demo as of the copyright in the library... the timings are quite a lot faster than the ILI9341 screen but this display does not have as many pixels to write so that is where the speed mainly is... the SRE bit helped aswell.

    Heres is a pic of the Adafruit demo timings....
    Click image for larger version. 

Name:	Capture.PNG 
Views:	433 
Size:	28.7 KB 
ID:	4434

    Here is a video of the Adafruit demo....

    Here is a video of the UTFT demo....

    Here is a video of the bitmap drawing which just changes the colours of lots of small Adafruit logos.....

    And finally here is the library.... i hope it can be of use to someone for their project.
    Last edited by jayjayuk; 06-05-2015 at 03:18 PM.

  2. #2
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Looks like the attachment didn't work. Any chance you could repost it?

  3. #3
    Junior Member
    Join Date
    Feb 2015
    Fixed. The page made me refresh when i wrote it and it must of discarded the uploaded attachments.

  4. #4
    Junior Member
    Join Date
    Oct 2016
    Longview, WA
    Wow, thank you for sharing this code. I had been using this library ( which worked but was rather slow... Putting in your library made a huge improvement, so much that I am having to add delays so somethings do not go too fast.

  5. #5
    Junior Member
    Join Date
    Mar 2019
    Hi jayjayuk,

    your library seems to be great, thanks for the work!

    Just one question:
    You use SPI_MODE_0 for communication with ili9225.
    According to the diagram in it's data sheet it looks like SPI_MODE_3 (capture on rising edge of CLK and IDLE-High of CLK).

    Am I missing something?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts