Forum Rule: Always post complete source code & details to reproduce any issue!
Page 3 of 10 FirstFirst 1 2 3 4 5 ... LastLast
Results 51 to 75 of 227

Thread: ILI9163C 128x128 TFT driver

  1. #51
    Hey guys! after messing around with the library and the code quite a bit I got the TFT working with an Arduino Nano. I have a eBay $4 knockoff Arduino Nano and the red version of the TFT.

    Pins : (TFT => Arduino)

    SCK => 13 (D13),
    SDA => 11 (D11),

    CS => 7 (D7),
    DC => 9 (D9),
    RST => 8 (D8),

    I also changed this line:

    TFT_ILI9163C tft = TFT_ILI9163C(__CS, __DC, 23);

    to

    TFT_ILI9163C tft = TFT_ILI9163C(__CS, __DC, __RST);

    and used

    #define __RST 8

    Other than those pins I just used 3v3 for power and LED (LED w/ resistor).

    I hope this helps anyone who is having issues getting it working! This setup should apply exactly the same for any Arduino with the ATmega328 chips (Nano, Uno, Pro Mini etc).
    Email me if you have any questions! Thanks!

  2. #52
    even though this thread is kinda old, i have got this library to work natively with the teensy audio library!

    portable media player anyone?
    Last edited by pix-os; 11-22-2015 at 03:08 AM.

  3. #53
    Thank You - This new library port is appreciated.

    I wonder if there could possibly be a typo in your readme.md in the "Pay Attention to connections" section.

    You say
    "- Teensy 3 and LC cannot use any pin for CS and RS(DC) but should be choosen as follows:

    pins:2,6,9 or 10,15 or 20,13 for CS and RS."

    Since pin 13 is usually SPI SCK... Perhaps you intended to say ... "20,21 for CS and RS." ?????

  4. #54
    Indeed, you're right, will fix it once I get on my pc

  5. #55
    Senior Member sumotoy's Avatar
    Join Date
    Nov 2012
    Location
    Venezia, Italia
    Posts
    421
    even though this thread is kinda old, i have ported this library to work natively with the teensy audio library! (example included)
    An PJRC Audio board compatible version, updated and faster version (even SPI transaction compatible) than old one exist already:

    Link

    UPDATE
    Looking your ported library, it's looks the same link above, bit per bit...





    Last edited by sumotoy; 11-18-2015 at 09:01 PM.

  6. #56
    well, somehow mine didn't work, i had to replace these functions:

    writecommand_cont
    writedata8_cont
    writedata16_cont

    writecommand_last
    writedata8_last
    writedata16_last

    note that i'm using the sd and tft on the same spi line.

  7. #57
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,794
    Starting and stopping SPI transactions for each piece of data is probably much less efficient than starting before an entire command and ending afterwards.

  8. #58
    true, hough this was the only way it worked for me

  9. #59
    Senior Member sumotoy's Avatar
    Join Date
    Nov 2012
    Location
    Venezia, Italia
    Posts
    421
    Paul it's right, this is a very inefficent way, I'm actually fixing this as it should.

  10. #60
    Junior Member
    Join Date
    Nov 2015
    Location
    Canada
    Posts
    2
    Hey there,

    I'm trying to use your library with this LCD:
    https://www.digikey.ca/product-detai...3-T-ND/4429437

    It has a built in ILI9163C controller but the SPI isn't broken out to the flat flex cable.
    It just has the parallel interface available.
    I didn't see a way to enable parallel communication from the teensy so I was wondering if
    you think I could use your library with a shift register?

  11. #61
    Senior Member sumotoy's Avatar
    Join Date
    Nov 2012
    Location
    Venezia, Italia
    Posts
    421
    It's possible, you have to modify all SPI functions to parallel. Did you consider buy an SPI version from china market? Have seen as low as 3US time ago! Probably it cost 1 US more than a shift register...

  12. #62
    those spi based ones are as low as 3.19USD (free international shipment)

    ebay link: ebay.com/itm/141196897388

  13. #63
    Junior Member
    Join Date
    Nov 2015
    Location
    Canada
    Posts
    2
    I might try getting this one working. I didn't even realize the incompatibility when I researched the part; I just found lcd with controller 'x' and googled library for controller 'x' and thought, "perfect."
    Looking at the controller's datasheet was a bit of an eye opener for me.

    I'm definitely going to purchase an SPI version, it seems there's loads available from aliexpress as well: aliexpress.com/wholesale?catId=0&initiative_id=SB_20151126093518& SearchText=ILI9163C

  14. #64
    Junior Member
    Join Date
    Jan 2016
    Posts
    1
    Hi sumotoy,

    I am planning to get the TFT LCD and links it with a temperature sensor using an Arduino UNO. Can the LCD reads and displays the reading collected from the temperature sensor? I am not familiar with SPI screen, thanks lot if you could help.

  15. #65

    Unhappy

    Click image for larger version. 

Name:	20160412_145256.jpg 
Views:	164 
Size:	246.5 KB 
ID:	6963Click image for larger version. 

Name:	20160412_145248.jpg 
Views:	570 
Size:	336.7 KB 
ID:	6964

    I use the same lcd, and the code you have posted here, But i have a problem my lcd is a part where the screen seems like it doesn't work, maybe i have a error with the code?
    Could you help me ?
    Thanks


    Code:
    /* Binary sketch size: 10,188 bytes (of a 30,720 byte maximum)
       Tested and documented by M. Ray Burnette 20140812
       Compiled with Arduino 1.0.5 for Arduino Nano (clone)
       WARNING: direct GLCD wiring requires that Arduino run at 3.3 Volts maximum!
    */
    #include <SPI.h>
    #include <Adafruit_GFX.h>
    #include <TFT_ILI9163C.h>
    
    // All wiring required, only 3 defines for hardware SPI on 328P
    #define __DC 9
    #define __CS 10
    // MOSI --> (SDA) --> D11
    #define __RST 12
    // SCLK --> (SCK) --> D13
    
    // Color definitions
    #define	BLACK   0x0000
    #define	BLUE    0x001F
    #define	RED     0xF800
    #define	GREEN   0x07E0
    #define CYAN    0x07FF
    #define MAGENTA 0xF81F
    #define YELLOW  0xFFE0  
    #define WHITE   0xFFFF
    
    TFT_ILI9163C tft = TFT_ILI9163C(__CS, __DC, __RST);
    
    void setup() {
      tft.begin();
    }
    
    void loop(){
      testLines(random(0x00ff,0xffff));
      delay(100);
      testText();
      delay(5000);
    }
    
    
    unsigned long testText() {
      tft.fillScreen();
      unsigned long start = micros();
      tft.setCursor(0, 0);
      tft.setTextColor(WHITE);  
      tft.setTextSize(1);
      tft.println("Hello World!");
      tft.setTextColor(YELLOW); 
      tft.setTextSize(2);
      tft.println(1234.56);
      tft.setTextColor(RED);    
      tft.setTextSize(3);
      tft.println(0xDEAD, HEX);
      tft.println();
      tft.setTextColor(GREEN);
      tft.setTextSize(4);
      tft.println("Hello");
      return micros() - start;
      delay(5000);
    }
    
    unsigned long testLines(uint16_t color) {
      tft.fillScreen();
      unsigned long start, t;
      int           x1, y1, x2, y2,
      w = tft.width(),
      h = tft.height();
      tft.fillScreen();
      x1 = y1 = 0;
      y2    = h - 1;
      start = micros();
      for(x2=0; x2<w; x2+=6) tft.drawLine(x1, y1, x2, y2, color);
      x2    = w - 1;
      for(y2=0; y2<h; y2+=6) tft.drawLine(x1, y1, x2, y2, color);
      t     = micros() - start; // fillScreen doesn't count against timing
      tft.fillScreen();
      x1    = w - 1;
      y1    = 0;
      y2    = h - 1;
      start = micros();
      for(x2=0; x2<w; x2+=6) tft.drawLine(x1, y1, x2, y2, color);
      x2    = 0;
      for(y2=0; y2<h; y2+=6) tft.drawLine(x1, y1, x2, y2, color);
      t    += micros() - start;
      tft.fillScreen();
      x1    = 0;
      y1    = h - 1;
      y2    = 0;
      start = micros();
      for(x2=0; x2<w; x2+=6) tft.drawLine(x1, y1, x2, y2, color);
      x2    = w - 1;
      for(y2=0; y2<h; y2+=6) tft.drawLine(x1, y1, x2, y2, color);
      t    += micros() - start;
      tft.fillScreen();
      x1    = w - 1;
      y1    = h - 1;
      y2    = 0;
      start = micros();
      for(x2=0; x2<w; x2+=6) tft.drawLine(x1, y1, x2, y2, color);
      x2    = 0;
      for(y2=0; y2<h; y2+=6) tft.drawLine(x1, y1, x2, y2, color);
      return micros() - start;
    }

  16. #66
    I fixed editing the file TFT_ILI9163C_settings.h and I set #define __144_BLACK_PCB__//128x128

    That's all for me.

    Thank you again.

  17. #67
    Senior Member sumotoy's Avatar
    Join Date
    Nov 2012
    Location
    Venezia, Italia
    Posts
    421
    Ok, looks like a new strain of the Red PCB display it's spreading all over, it looks exact like the old Red PCB one, same text on the back but display has no text around border, it's a bit smaller than common one and it uses yellow pins (but this can change in future). It works in rotation 0,1 but NOT in 2,3 and I even not sure it uses ILI9163C!!! I got one of this display just today but many users complain not working well with current library in rotation 2,3, this is what I want discover in these days.
    Some vendor says it's a ST7735, most says ILI9163C and others II9165(!). If you have projects that needs rotation 2 or 3 please consider that I still try to figure out what controller it uses!!!
    UPDATE
    It doesn't like to use ILI9163C, many commands shows a small offset and react strange on slide, also a couple of commands does nothing (but RED,BLACK,BLUE and old version yes)

  18. #68
    Thank you sumotoy for your effort.

  19. #69
    Senior Member sumotoy's Avatar
    Join Date
    Nov 2012
    Location
    Venezia, Italia
    Posts
    421
    I solved the problem with thes new RED PCB Yellow Pin display, tomorrow (sunday 17,4,2016) I will post 1.0r6 that include this display and has an updated structure to support easily any type of incoming chinese strain.

  20. #70
    Exelent Sumotoy, let me know when you post the solution. Thanks

  21. #71
    Senior Member sumotoy's Avatar
    Join Date
    Nov 2012
    Location
    Venezia, Italia
    Posts
    421
    It's already done, it's a quite large update, there's still some minor tuning on color parameters (different between display's) but today I definetively release it.

  22. #72
    Great !!! thank you

  23. #73
    Senior Member sumotoy's Avatar
    Join Date
    Nov 2012
    Location
    Venezia, Italia
    Posts
    421
    Version 1.0r6 online, as always Teensy fly with this!
    Library mostly redesigned, now display's are in separate files and it's easy to handle any possible future strain.

    UPDATE
    Paul, can you use the latest 1.0r6 for future Teensyduino releases? It works much better and has support for the new yellow pin display, impossible with old version.
    GitHub page
    Last edited by sumotoy; 04-20-2016 at 09:14 PM.

  24. #74
    Thank's sumotoy I try the new library but I think maybe I have a error . What do you think ? See when make the scroll


  25. #75
    Senior Member sumotoy's Avatar
    Join Date
    Nov 2012
    Location
    Venezia, Italia
    Posts
    421
    Easy to fix, just need to know what display you have and if you used the scroll example of the library (and rotation 0?)...
    Last edited by sumotoy; 04-22-2016 at 08:55 PM.

Posting Permissions

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