ILI9163 128x128 LCDs

Posted on
  • They're commonly sold on eBay as 'Replace Nokia 5110 LCD'. They're only pin compatible though, as instead of 84x48x1 they're 128x128x16, with a totally different protocol!

    I just did a driver - it handles palletted mode as well: http://www.espruino.com/ILI9163

    Also just made some changes to SPI.write too so it can keep up around 4Mbps, which makes the whole thing a lot more usable (although still a little slow for my liking). Screen refreshes are around 300ms - so ok, but not really up to animations.

  • Wow, that is perfect.
    Today my 1.44" TFT (128x128) arrived,
    BUT it is based on the ST7735 driver

    @Gordon how do I port or make a driver for this one?
    It is also an existing arduino library

  • There is a typo in espruino.com/ILI9163. Module points to ILI9361, which should be ILI9163

  • @JumJum thanks - just updated it on GitHub, so the next website update will have that fixed.

    @Jorgen, that's a bit unfortunate! What I'd do is:

    • copy the code for the ILI9163 into the Web IDE's right hand side
    • put the line var exports = {}; right at the top of it.
    • Copy the example initialisation code to after it, but replace require("ILI9163") with exports

    So then it's a totally self-contained bit of code that you can send, tweak and debug quite quickly.

    It looks like it behaves in an almost identical way - the bytes that are sent to set the pixels are identical. About the only thing that's different seems to be the bytes you have to send to initialise it...

    So you just need to put this code into here and it should just start working! :)

  • Thanks @Gordon!
    I will try this today - never thought it could be so simple.
    I really love your work and playing with Javascript is so awesome ;)

  • I think the two are the same, or maybe one is the screen, one's the driver... Lots of eBay listings with both part numbers in the title

  • Thanks for being the voice of sanity :) Checking up a bit further the commands do look the same.

    @Jorgen have you tried the display out with the ILI9163 module? It may 'just work'.

  • @DrAzzy thanks for the hint. They look also really similar on the pictures.
    @Gordon not yet - I'll try this tonight on my spare time ;)

  • I create a new thread for the ST7735...
    It did not work out of the box, so I have to modify it.

  • Ok - it's close though.

    Replied on that thread, but it'd be good to find a way to change the existing module such that it can support the different types of display.

  • There's a 128x160 variant with ILI9163, see http://www.aliexpress.com/item/5PCS-1-8-­inch-TFT-LCD-Screen-Module-with-PCB-ILI9­163-Drive-IC-128-160-SPI/32361332234.htm­l .
    Even comes with an SD card slot. Could be the ideal Pico partner.

    Edit: not pin compatible.

  • I also ordered one (~3.80 USD), but did not arrived yet.

  • I've just got my paws on an Arduino A000096 display, which is 160x128.
    It works, however in ILI9163.js you have to change var LCD_HEIGHT to 160, because the default orientation is portrait, with the active row of pins at the bottom.
    I haven't tried the SD card slot yet, maybe tomorrow, before the pub.

  • Hi Gordon.

    I've tried everything but I can't find a way to speed up this screen, have you been able to find a way after all this time?

  • I'm afraid it is just quite slow because there is a lot of data to transfer... What Espruino device are you using?

    Paletted will be faster to draw, but slower to update. If you can increase the SPI speed that will help with transmission.

    There is a possibility that with the latest Espruino builds you could use JIT for the setPixel/fillRect functions in the un-paletted driver and that would speed things up a lot (but right now JIT isn't enabled for the STM32-based boards, only nRF52).

  • Thank you very much for your answer

    Display: Blackboard SPI 1.44 128x128
    Module: ESP-WROOM-32 (looks fast and has fast rendering power)

    As far as I understand, the number of setPixel executions to render each pixel is heavy and long, it would be great if all the pixels are collected and fully rendered at once

    Note: What I mean by the execution of the setPixel function is that this command is called individually for each pixel.

    There is one thing, how did you write the Bangle.js library or page code that renders so fast.

    I don't know much about C language and CPP, but it would be great if you could take a look at the ILI9163 library for Arduino, so you can use its rendering method for Espruino. I need your cooperation for this

    https://github.com/sumotoy/TFT_ILI9163C

  • Hi,

    You could build your own firmware with support for the LCD built in, and that would be a lot faster.... Or since you have ESP32 you probably have enough free RAM to allocate one big buffer rather than using paletted.

    The code for paletted is at https://github.com/espruino/EspruinoDocs­/blob/master/devices/ILI9163.js#L107-L13­1

    And I imagine the code to write the image direct with just a big buffer would be something like:

    exports.connectBigBuffer = function(spi, dc, ce, rst, callback) {
      var g = Graphics.createArrayBuffer(LCD_WIDTH, LCD_HEIGHT, 16, { msb:true });
      g.flip = function() {
        ce.reset();
        spi.write(0x2A,dc);
        spi.write(0,0,0,LCD_WIDTH);
        spi.write(0x2B,dc);
        spi.write(0,0,0,LCD_HEIGHT);
        spi.write(0x2C,dc);
        spi.write(g.buffer);
        ce.set();
      };
      init(spi, dc, ce, rst, callback);
      return g;
    };
    
  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

ILI9163 128x128 LCDs

Posted by Avatar for Gordon @Gordon

Actions