Menu

Ili9341 and xpt2046 touch display

Help
2021-04-17
2021-08-18
1 2 3 > >> (Page 1 of 3)
  • Boris Breuer

    Boris Breuer - 2021-04-17

    Hello fellow friends of decent microcontroller programming,

    i have this Display laying around: https://www.az-delivery.de/products/2-4-tft-lcd-touch-display
    and found some english info for the arduino environment: https://www.hackster.io/calogerus/arduino-uno-2-4-tft-lcd-display-shield-touch-panel-ili9341-576b1b

    As far as i read, the ili9341 is supported by Great Cow BASIC but only as spi variant (the display seems to be driven in parallel and has some pins more to be connected). The touch driver xpt2046 seems to be compatible with the ADS7843 https://www.espruino.com/XPT2046 which also seems to be supported (at least in conjuction with another display driver).

    What do you think, would this display work without too much hassle? I would give it a try on my arduino uno, but could use some hints to get started...

    Thanks in advance.

    Cheers,

    Boris

     
  • Anobium

    Anobium - 2021-04-18

    We support that GLCD all ready. See ..\GreatCowBasic\Demos\touch_sensor_solutions there are many demos there.

     

    Last edit: Anobium 2021-04-18
  • Boris Breuer

    Boris Breuer - 2021-04-18

    i saw that but got a bit confused, because this one i got is advertised as parallel one and i thought that would differ from the spi ones ... at least i was scratching my head because of the more pins...

    but will have deeper look...

     
  • Anobium

    Anobium - 2021-04-18

    The mega is not SPI.

     
  • Boris Breuer

    Boris Breuer - 2021-04-18

    thanks for the pointer: saw in the github repo this one Great-Cow-BASIC-Demonstration-Sources/GLCD_Solutions/GLCD_Discovery_for_MCUFRIEND_devices

    afair the display should be a clone of a mcufriend one - maybe the luck is with me ;)

    from your last post i did not get the point: i would drive the display on an arduino uno.

     
  • Anobium

    Anobium - 2021-04-18

    OK. I ask question. What chip are you planning to use ?

     
  • Boris Breuer

    Boris Breuer - 2021-04-18

    for initial development the atmega328p on the uno r3 i got. Later i would try to downsize to a arduino mini to get a clock module and bluetooth module to work... so same chip.

    if this is not feasible i have some greater chips on stock (have to lookup which) but wanted to avoid too much soldering on perfboard :)

     
  • Anobium

    Anobium - 2021-04-18

    Just validate the solution using the shield and an UNO. Then decide.

    I would use the LGT chipset. Much faster. However, the Touch driver will have to sorted (works ok on Uno the LGT is so fast the XPT is overclocked).

     
  • Boris Breuer

    Boris Breuer - 2021-04-18

    didn't recognize the LGT until today, looks very interesting. touch isn't necessarily to be used - maybe i will use another display. have to try out 3 in different sizes and the touch seemed nice (as written a bit confusing...), but maybe a bit complicated to use, will see... have to figure out the overall size, so that will be a constraint, too.

     
  • Boris Breuer

    Boris Breuer - 2021-08-11

    Hi again,

    did have the time to try everything out andd the discovery program shows good values on serial. Should anything besides a white screen be seen on display itself? And has someone a hint where a demo program for the 8bit mode of the ili9341 is? Afair, there are examples of the normal spi mode...

    thanks in advance.

     
    • Anobium

      Anobium - 2021-08-11

      You device IS an 8-bit GLCD.

      Remind me what is the chip? and, how is it connected to the GLCD.

      This info will help me recommend the next step.

       
  • stan cartwright

    stan cartwright - 2021-08-11

    I have three ili9341 displays and they all have the same pin out although one has bigger display it is the same 320 x 240 resolution.
    They are all spi and work with hardware spi on a uno but faster on lgt328.
    Seemed hardware spi touch doesn't work with lgt328 so need to use software spi which is the display, not just the touch, which negates using the lgt328.
    Hardware spi using touch works with a uno or nano ok.
    @Boris's display looks parallel and no touch. No mosi, miso.

     

    Last edit: stan cartwright 2021-08-11
  • Boris Breuer

    Boris Breuer - 2021-08-11

    @Stan: You're right that it is parallel, but it should have the same touch capabilities as the spi ones.

    i found some more information on it with respect to arduino:
    https://create.arduino.cc/projecthub/javagoza/2-4-tft-lcd-touch-display-road-test-89f51b

    Displaycontroller is ili9341, Touch xpt2046.

    "This module consumes most of the resources available in Arduino UNO. This is not a limitation of the module itself. In return, using a parallel interface allows you to quickly update the image. If you want to take advantage of all its functionality (LCD + touch screen + SD card), only pins 0 and 1 (RX and TX, respectively) and pin 19 (A5) remain unused."

    "Pin 9 - Touch X+ / LCD_D1
    Pin 17 (A3) - Touch X- / LCD_CS
    Pin 8 - Touch Y- / LCD_D0
    Pin 16 (A2) - Touch Y+ / LCD_RS"

    frome above link.

     

    Last edit: Boris Breuer 2021-08-11
    • Anobium

      Anobium - 2021-08-12

      What is the display attached to? an UNO? which chip ?

       
  • Boris Breuer

    Boris Breuer - 2021-08-12

    It's attached to a wattuino uno with a atmega328p. The wattuino is a 100% clone of the uno.
    The only difference i think is the usb2serial-converter (FTDI FT231X).

    https://learn.watterott.com/de/breakouts/wattuino-uno/

     
  • Anobium

    Anobium - 2021-08-12

    OK. Use the GCB@Syn\GreatCowBasic\Demos\glcd_solutions\glcd_discovery_for_mcufriend_devices\glcd_discovery_8bit_databus.gcb program to show the type of board.

    The program will output a load of info to the serial terminal. Please share. This will inform on the chip in the GLCD. They are NOT always what they say they are....

     
    • Boris Breuer

      Boris Breuer - 2021-08-12

      Here are the lines from the program:

      Read Registers on GLCD
      controllers either read as single 16-bit
      e.g. the ID is at GLCDreadReg(0)
      or as a sequence of 8-bit values
      in special locations (first is dummy)
      
      Operating in 8-bit addressing mode
      
      reg(0x0000) 00 00   ID ILI9320, ILI9325, ILI9335, -G (0x75)...
      reg(0x0004) 00 00 00 00 Manufacturer ID
      reg(0x0009) 00 00 61 00 00  Status Register
      reg(0x000A) 00 08   Get Power Mode
      reg(0x000C) 00 06   Get Pixel Format
      reg(0x0061) 00 00   RDID1 -G
      reg(0x0062) 00 00   RDID2 -G
      reg(0x0063) 00 00   RDID3 -G
      reg(0x0064) 00 00   RDID1 -A
      reg(0x0065) 00 00   RDID2 -A
      reg(0x0066) 00 00   RDID3 -A
      reg(0x0067) 00 00   RDID Himax -A
      reg(0x0070) 00 00   Panel Himax -A
      reg(0x00A1) 00 00 00 00 00  RD_DDB SSD1963
      reg(0x00B0) 00 00   RGB Interface Signal Control
      reg(0x00B4) 00 02   Inversion Control
      reg(0x00B6) 00 0A 82 27 04  Display Control
      reg(0x00B7) 00 06   Entry Mode Set
      reg(0x00BF) 06 00 00 00 00 00   ILI9481, HX8357-B
      reg(0x00C0) 00 21 00 00 00 00 00 00 00  Panel Control
      reg(0x00C8) 00 00 00 00 00 00 00 00 00 00 00 00 00  GAMMA
      reg(0x00CC) 00 71   Panel Control
      reg(0x00D0) 07 00 00    Power Control
      reg(0x00D2) 00 00 00 03 03  NVM Read
      reg(0x00D3) 03 00 93 41 ILI9341, ILI9488
      reg(0x00DA) 41 00   RDID1
      reg(0x00DB) 00 00   RDID2
      reg(0x00DC) 00 00   RDID3
      reg(0x00E0) 00 0F 16 14 0A 0D 06 43 75 33 06 0E 00 0C 09 08 GAMMA-P
      reg(0x00E1) 00 08 2B 2D 04 10 04 3E 24 4E 04 0F 0E 35 38 0F GAMMA-N
      reg(0x00EF) 00 03 80 02 02 02   ILI9327
      reg(0x00F2) 02 02 02 02 02 02 02 02 02 02 02 02 Adjust Control 2
      reg(0x00F6) 02 01 00 00 Interface Control
      
      Examining  : GLCD Device ID 
      Read       : GLCD Device ID = 0x9341
      Controller : GLCD ILI9341
      Completed  :
      
       
  • Anobium

    Anobium - 2021-08-12

    That is a ILI9341....and, the thing is wired up correctly. This is great news.


    Share the first two lines of the ASM please. What version of the compiler? I am checking that the FOR-NEXT issues are affecting this program. The WHITE could be caused by that FOR-NEXT failing.


    Attach your software code please.

     
  • Anobium

    Anobium - 2021-08-12

    Also, look in this folder... GCB@Syn\GreatCowBasic\Demos\vendors\hiletgo\graphicallcddiscovery

    register 0x00D3 is different. Not sure what this means.

     
    • Boris Breuer

      Boris Breuer - 2021-08-12

      First two lines of the asm:

      ;Program compiled by Great Cow BASIC (0.98.07 2021-07-24 (Windows 64 bit) : Build 1005) for Microchip MPASM
      

      I have a look at the hiletgo thing...

       
      • Anobium

        Anobium - 2021-08-12

        OK. re the ASM.


        I do not think this is the FOR-NEXT issue. I just tried a version with the 'known' FOR-NEXT issue and my UNO/GLCD works here. (just tested).


        Your source and ASM please. I want to check the 8bit code is being executed,

         
  • Boris Breuer

    Boris Breuer - 2021-08-12

    Here is the output of the hiletgo-program:

    Operating in 8-bit addressing mode
    
    reg(0x0000) 00 00   ID ILI9320, ILI9325, ILI9335, -G (0x75)...
    reg(0x0004) 00 00 00 00 Manufacturer ID
    reg(0x0009) 00 00 61 00 00  Status Register
    reg(0x000A) 00 08   Get Power Mode
    reg(0x000C) 00 06   Get Pixel Format
    reg(0x0061) 00 00   RDID1 -G
    reg(0x0062) 00 00   RDID2 -G
    reg(0x0063) 00 00   RDID3 -G
    reg(0x0064) 00 00   RDID1 -A
    reg(0x0065) 00 00   RDID2 -A
    reg(0x0066) 00 00   RDID3 -A
    reg(0x0067) 00 00   RDID Himax -A
    reg(0x0070) 00 00   Panel Himax -A
    reg(0x00A1) 00 00 00 00 00  RD_DDB SSD1963
    reg(0x00B0) 00 00   RGB Interface Signal Control
    reg(0x00B4) 00 02   Inversion Control
    reg(0x00B6) 00 0A 82 27 04  Display Control
    reg(0x00B7) 00 06   Entry Mode Set
    reg(0x00BF) 06 00 00 00 00 00   ILI9481, HX8357-B
    reg(0x00C0) 00 21 00 00 00 00 00 00 00  Panel Control
    reg(0x00C8) 00 00 00 00 00 00 00 00 00 00 00 00 00  GAMMA
    reg(0x00CC) 00 71   Panel Control
    reg(0x00D0) 07 00 00    Power Control
    reg(0x00D2) 00 00 00 03 03  NVM Read
    reg(0x00D3) 03 00 93 41 ILI9341, ILI9488
    reg(0x00DA) 41 00   RDID1
    reg(0x00DB) 00 00   RDID2
    reg(0x00DC) 00 00   RDID3
    reg(0x00E0) 00 0F 16 14 0A 0D 06 43 75 33 06 0E 00 0C 09 08 GAMMA-P
    reg(0x00E1) 00 08 2B 2D 04 10 04 3E 24 4E 04 0F 0E 35 38 0F GAMMA-N
    reg(0x00EF) 00 03 80 02 02 02   ILI9327
    reg(0x00F2) 02 02 02 02 02 02 02 02 02 02 02 02 Adjust Control 2
    reg(0x00F6) 02 01 00 00 Interface Control
    
    Examining  : GLCD Device ID 
    Read       : GLCD Device ID = 0x9341
    Controller : GLCD ILI9341
    Completed  :
    
     
  • Boris Breuer

    Boris Breuer - 2021-08-12

    Here are the source-file for dthe discovery and the generated .asm.

     
    • Anobium

      Anobium - 2021-08-12

      My apologies. The source /asm for the code with the White screen.

      Discovery is working. So, we know the UNO/GLCD is ok. The difference in address is D3h is not important ( I have checked the datasheet).


      Also, I did think this was an under voltage issue. So, I tested here with an under voltage UNO/GLCD. Nope... the GLCD does not go to a white screen when under voltage. So, it is not this.

       
      • Boris Breuer

        Boris Breuer - 2021-08-12

        The only programs i tested with this glcd were the discovery ones. In both cases it shows a white screen. If this is working as intended - my apologies :) I thought it should show the behaviour like on foto (index).

        Then i could use a little help howto "translate" those spi-examples to a parallel one, please.

        The picture index shows what i naively expected and the other picture shows what i really got (and caught on my cam).

         

        Last edit: Boris Breuer 2021-08-12
1 2 3 > >> (Page 1 of 3)

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.