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.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I didn't know your display was so different.
If ebay search shows this as cheapest/most popular, I could send one.
The ones I have use XPT2046 chip.
touch lines are IRQ,DO,DIN,CS,CLK
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.
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.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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'PinmappingsforSPI-thisGLCDdriversupportsHardwareSPIandSoftwareSPIdirportb.0outdirportb.4outdirportb.5outdirportc.3outdirportc.5out;#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;#defineILI9341_HardwareSPI'remove/commentoutifyouwanttousesoftwareSPI.
Last edit: stan cartwright 2019-01-29
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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
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
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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.
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.
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.
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.
I have read this a few times, but, I am not sure if this is a statement or a question.
Do clarify.
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.
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.
I didn't know your display was so different.
If ebay search shows this as cheapest/most popular, I could send one.
The ones I have use XPT2046 chip.
touch lines are IRQ,DO,DIN,CS,CLK
there's different boards under ili9341 looking at cheapest
https://www.ebay.co.uk/itm/2-4-TFT-LCD-Display-Shield-Touch-Panel-ILI9341-240X320-for-Arduino-UNO-ZH6/192724472478?hash=item2cdf46129e:g:Fb4AAOSwqnVcCi-~:rk:3:pf:0
uses 2 chips-maybe different
this is like mine
https://www.ebay.co.uk/itm/2-4-240x320-SPI-TFT-LCD-Touch-Panel-Serial-Port-Module-with-PBC-ILI9341-5V-3-3V/400759773616?epid=2115967452&hash=item5d4f24d9b0:g:E1EAAOSwxH1T7tYB:rk:33:pf:0
which is cheap
Last edit: stan cartwright 2018-12-26
The XPT2046 library should support. Anything missing?
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.
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
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.
I have it working - a video.
https://1drv.ms/v/s!Ase-PX_n_4cvgq1G8t5Wd7RI2as9hQ
Last edit: Anobium 2018-12-28
Another ....
Last edit: 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:
I have created a demonstration that enable you to calibrate the GLCD and the Touch.
Email me please for the test code.
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
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
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.
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?
Last edit: stan cartwright 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.
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
no difference
Last edit: stan cartwright 2019-01-30
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
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.
I changed glcd_simple_demonstation_18f26k22_for_ili9341 to use 18f25k22,64 and used portc 0-5 but #define ILI9341_hardwarespi doesn't work.
I will power up a board and device here. If there is a demo. It was tested and it worked... so, puzzled.
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
I will power up a board and device here. If there is a demo. It was tested and it worked... so, puzzled.
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.
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?
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.