Menu

ili9341 touch

Help
2018-12-25
2019-02-02
1 2 > >> (Page 1 of 2)
  • stan cartwright

    stan cartwright - 2018-12-25

    Hi. I have a few ili9341 glcds that are cheap and are nice to use with gcb.
    I've looked at the data sheet and it's too compicated for me...I would never have got the thing to display graphics without gcb....ok there's an arduino sketch thingy but I don't do c++ or I wouldn't be using gcb.
    The glcd is usually on a breakout board https://www.hotmcu.com/24-touch-screen-tft-lcd-with-spi-interface-240x320-p-317.html and has touch co-ords sent serial but how to implement in gcb is beyond me.
    These are much cheaper than nextion displays that gcb and touch works.

     
    • Anobium

      Anobium - 2018-12-26

      I have read this a few times, but, I am not sure if this is a statement or a question.

      Do clarify.

       
  • stan cartwright

    stan cartwright - 2018-12-26

    Gcb supports ILI9341 certain graphics mode. The devices come on a breakout board like the link I posted, mine are 3.3V logic, yours is 5V logic, from a post year ago.
    The boards have touch out but not implemented in gcb. How to read touch co-ords with gcb.
    They also have sd card slots that might be useful.
    If I could convert c++ code for this device to gcb I would post it but makes my head hurt.
    So a plea for a gcb routine to read ili9341 touch co-ords.

     
    • Anobium

      Anobium - 2018-12-26

      What is the chip for the touch? My ILI9341 (I have two) do not have the touch chip installed - so, you need to tell us.

       
  • Anobium

    Anobium - 2018-12-28

    The XPT2046 library should support. Anything missing?

    init_XPT2046 ( not a public method ) 
    GetXY_XPT2046
    setCalibration_XPT2046
    isTouched_XPT2046
    powerDown_XPT2046
    

    The library will have to handle rotation of the screen and scaling.


    I have reviewed the datasheet and I think this is best summary I found on the internet.
    To quote.

    Having had the chance to review the spec - this Touch Screen Controller is (very) near the top - if not the MOST COMPLEX, Resistive Touch Controller I've encountered. I'd judge this one as demanding (unblinking) "Attention to Detail" - nothing less. And possibly - not the best choice for an "early or first" project.

    This Controller promises - beyond returning 12 bit, "touch coordinates" from each axis - to (additionally) provide measures of: Temperature, System Low Voltage, and (even) Touch Pressure! (I'm bit doubtful on the latter) In this user's case - those "extra features" come with a cost - that being added complexity.


    Anyway, some progress.....

    The driver is currently only software SPI. Needs to be hardware SPI for speed and portability.

     

    Last edit: Anobium 2018-12-28
  • stan cartwright

    stan cartwright - 2018-12-28

    There's c++ and python code but I've not found any basic code yet.
    https://github.com/spapadim/XPT2046
    You can use 8bit sampling said somewhere which would be accurate enough for buttons.
    I'm happy using Nextion displays.. it's just they're 5 times the price of Chinese ili9341.

     
    • Anobium

      Anobium - 2018-12-28
       

      Last edit: Anobium 2018-12-28
  • Anobium

    Anobium - 2018-12-28

    Another ....

     

    Last edit: Anobium 2018-12-28
  • Anobium

    Anobium - 2018-12-28

    @Stan. I have a prototype ready for you. You will need to update a few files as this new library needs to work across a number of GLCDs.

    Implemented are:

    init_XPT2046 ( not a public method ) 
    GetXY_XPT2046
    setCalibration_XPT2046
    isTouched_XPT2046
    

    I have created a demonstration that enable you to calibrate the GLCD and the Touch.

    Email me please for the test code.

     
  • stan cartwright

    stan cartwright - 2019-01-24

    Hi. A new ili9341 glcd arrived. https://www.banggood.com/2_8-Inch-ILI9341-240x320-SPI-TFT-LCD-Display-Touch-Panel-SPI-Serial-Port-Module-p-1206782.html?rmmds=search&cur_warehouse=CN
    It says 3.3-5v compatable...but it isn't. It only works through bi-directional logic level converter.
    There's a display but touch does nothing. There's a red box.
    I'll put something in the program to see it's not frozen but maybe it's another rip-off.
    edit how to test if touch controller is working.... or how did Anobium know the display I sent him didn't work? I have a poor usb scope to test glcd.

     

    Last edit: stan cartwright 2019-01-24
    • Anobium

      Anobium - 2019-01-25

      Run the IRQ direct from the GLCD to the UNO. See if that helps.

      Red box means... no irq (event) is being detected.

       

      Last edit: Anobium 2019-01-25
  • stan cartwright

    stan cartwright - 2019-01-25

    It is.See photo. I tried IRQ through the logic level converter first but thought it's an analogue signal not just on-off.
    It didn't work at all connecting all lines straight to uno. Supposed to be 3-5v logic compatable. If that's bogus then maybe the touch feature is to.

     
  • stan cartwright

    stan cartwright - 2019-01-29

    As the devices I have are 3.3V logic I tried to run a display from a pic running at 3.3V
    The display works with software spi but not #define ILI9341_HardwareSPI.
    I've used the display with the same pic running at 5V but using a logic level converter. I THINK I used hardware spi.
    I tried using #define GLCD_DO portc.5 ;SDO1 incase but no difference.
    Do I need to use SPIMode ( Mode [, SPIClockMode]) as it's a pic?

    #chip 18f25k22,64
    #option explicit
    #include <glcd.h>
    ;
        #define GLCD_TYPE GLCD_TYPE_ILI9341
        'Pin mappings for SPI - this GLCD driver supports Hardware SPI and Software SPI
    dir portb.0 out
    dir portb.4 out
    dir portb.5 out
    dir portc.3 out
    dir portc.5 out
    ;
        #define GLCD_DC   portb.5 ;         ' Data command line DC
        #define GLCD_CS   portb.4 ;              ' Chip select line CS
        #define GLCD_RESET   portb.0
        #define GLCD_DO   portc.4 ;SDI1
        #define GLCD_SCK   portc.3 ;SCK1 SCL1      ' Clock Line SCK
    
    ;   #define ILI9341_HardwareSPI    ' remove/comment out if you want to use software SPI.
    
     

    Last edit: stan cartwright 2019-01-29
    • Anobium

      Anobium - 2019-01-29

      Over to the datasheet Stan as you need to understand and setup the Hardware SPI ports for this specifici chip.

      They are not on the ports you have shown above. Look at page 6 of the datasheet. Then, hardware SPI will bust into life.

       
  • stan cartwright

    stan cartwright - 2019-01-29

    Thanks but I used that page 6 and I'm using a 28 pin dip so used pins in far left headed 28-SSOP, SOIC , 28-SPDIP
    pin 14 RC3 - SCK1
    pin 15 RC4 - SDI1
    pin 15 RC5 - SDO1
    must be right as chip programs and prog works apart from hardware spi.
    Does hardware spi work at 3.3V? ie pic running at 3.3V to glcd that only works at 3.3V logic
    I added

     #define ILI9341_HardwareSPI
    SPIMode Master
    

    no difference

     

    Last edit: stan cartwright 2019-01-30
  • stan cartwright

    stan cartwright - 2019-01-29

    using software spi is visually quick I think. trying mega 328 programs I wrote. a good driver. Is hardware spi visually faster?
    edit I should have tried when I had a uno connected... I will try.. and comment hardware spi line

     

    Last edit: stan cartwright 2019-01-30
    • Anobium

      Anobium - 2019-01-30

      Software SPI is much slower than Hardware SPI - visually and physically.

      Stan - look at the demo glcd_simple_demonstation_18f26k22_for_ili9341@16.gcb. Same part family using hardware SPI. Always search the demos... I do.

       
  • stan cartwright

    stan cartwright - 2019-01-31

    I changed glcd_simple_demonstation_18f26k22_for_ili9341 to use 18f25k22,64 and used portc 0-5 but #define ILI9341_hardwarespi doesn't work.

     
    • Anobium

      Anobium - 2019-01-31

      I will power up a board and device here. If there is a demo. It was tested and it worked... so, puzzled.

       
  • stan cartwright

    stan cartwright - 2019-01-31

    I can't find any errors my end. The glcd_simple_demonstation_18f26k22_for_ili9341 is working with the #define ILI9341_hardwarespi commented.
    I use pk2plus. The board is powered at 3.3V when programmed. no 5V from the pickit2.
    edit I replaced the 18f25k22 and the ili9341 glcd but same problem.

     

    Last edit: stan cartwright 2019-01-31
    • Anobium

      Anobium - 2019-02-01

      I will power up a board and device here. If there is a demo. It was tested and it worked... so, puzzled.

       
      • Anobium

        Anobium - 2019-02-01

        ILI9341 works here. See attached. To prove it - it changed the date on the demo, the date on the file.

        Harware and software SPI works.

        So, these things are highly sensitve. Do not put more than 4.1v into these displays .. more and you will get no action. On my board here I can simple change the operating voltage to cope - operating at 3.81v today - works well.

         
        • Anobium

          Anobium - 2019-02-01

          Look at the photos... why are your colors different?

          Red box v White Box
          Silver circle v Blue Circle

          What version of the glcd_ili9341.h you on. The last change date please is?

           
  • stan cartwright

    stan cartwright - 2019-02-01

    Thanks for testing.
    I'm using version last update 16/11/2017 Revised to support faster CLS for AVR.
    The colours are red box, "silver" circle...it's an artifact of the camera and the screens viewing angle.
    I'm using 5V to display vdd as there's a 3.3V reg on the display. It won't power running from 3.3V...you have to bridge a link to bypass the reg.
    I'm connecting the display to pic directly ..no resistors
    The pic is running at 3.3V.

     
1 2 > >> (Page 1 of 2)

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.