rant: fun with a 2.4" ILI9341 LCD - Page 1
Forum section: electronics / general

author: madires
author_rank: Super Contributor
timestamp: July 11, 2020, 07:42:17 pm
content: For testing the 8-bit parallel bus mode of an ILI9341 driver I got one of those inexpensive 2.4" 320x240 Arduino LCD shields claiming to have an ILI9341. There was some ghostly output resembling characters, even at the correct location, but no luck with getting it to work properly. Then I tried my ILI9486 driver and - you can guess it - the display's output looked much better. Had to adjust the resolution down to 240x320 and everything was fine. Is that the Chinese LCD controller lottery? Anyone else with similar experiences?

author: RoGeorge
author_rank: Super Contributor
timestamp: July 11, 2020, 07:52:54 pm
content: Yes, I had the same experience twice with some Arduino displays from AliExpress, but in the end they were working, and they were very cheap, so I didn't complain about the different controller type. Had to try a few drivers before I found the right one, and it was from some other chip than it was advertise.Many AliExpress sellers just resell whatever product they find at the cheapest price, and some just copy/paste the same product picture and title without having the slightest idea what they are selling.

author: amyk
author_rank: Super Contributor
timestamp: July 12, 2020, 03:28:12 am
content: Perhaps sellers thinking that 320x240 and 240x320 are the same thing.In terms of number of pixels, yes. In terms of organisation, no.

author: Lindley
author_rank: Regular Contributor
timestamp: July 12, 2020, 08:42:26 am
content: Used several of the 2.4 and 2.8" SPI ( red pcb) versions of those 320x240 screen without any problems using the Adafruit librariesAlso use their touch screen which adds a new dimension to diy projects.SPI interface may be a bit slower than 8 bit, but when used on a more powerful micro like the ESP32 its hard to notice any real difference.Did try a 8 bit one , once, but seems many are fitted with the incorrect type of voltage converter chips, so you can get poor image problems like you describe. ( google for details)

author: madires
author_rank: Super Contributor
timestamp: July 12, 2020, 10:04:11 am
content: Quote from: amyk on July 12, 2020, 03:28:12 amThat's just a tiny nuisance. The ILI9341 is meant for 240x320 while the ILI9342 is for 320x240. When you buy an ILI9341 based LCD you can also get an ILI9342 instead, but it's very easy to rotate the output.

author: madires
author_rank: Super Contributor
timestamp: July 12, 2020, 10:34:10 am
content: Quote from: Lindley on July 12, 2020, 08:42:26 amIIRC, the Adafruit libs try to read the display ID to determine the controller. Because of the MCU's limited resources I need to optimize my display drivers and keep them rather small.Quote from: Lindley on July 12, 2020, 08:42:26 amMost of the Arduino display shields with touch screen don't have a touch screen controller and you have to do everything in software. Only a few come with an ADS7843 or XPT2046.Quote from: Lindley on July 12, 2020, 08:42:26 amAnd you need just two I/O pins more for an SPI touch screen controller.Quote from: Lindley on July 12, 2020, 08:42:26 amSo far I haven't had any problems with level shifters - I use conservative timing. But I know that several display controllers can go much faster than the datasheet states.

author: phil from seattle
author_rank: Super Contributor
timestamp: July 12, 2020, 02:24:00 pm
content: Quote from: Lindley on July 12, 2020, 08:42:26 amYes, I have too. Great little cheap LCD to add to projects. Font support makes for a nice presentation. I bought a bunch from ali-whatever for about $3 each, iirc. Though, I've found the touch screens to not be very good (resistive, kind of flakey). Plus, touch on a 2+" screen is kind of limited. And the SD Card interface seems problematic. But still, they fit a need.There is a lot of 9341 activity on the Teensy Forum. They've really improved the adafruit driver. There is a DMA based version with double buffered screens for the SPI interface that make parallel unnecessary. Rocks on a Teensy 4.x

author: madires
author_rank: Super Contributor
timestamp: July 12, 2020, 03:03:21 pm
content: Of course, you can't compare a simple resistive touch screen to one for a smartphone, but they work fine with a touch screen controller. From my experience a lot of the flakyness comes from using the touch screen directly. You have to sample the inputs every few ms to detect a touch event, and not every ADC in an MCU is fast and has sufficient resolution.

author: phil from seattle
author_rank: Super Contributor
timestamp: July 12, 2020, 04:34:08 pm
content: The one I have has an XPT2046. It does work but in my testing found it to not be consistent enough to add touch to my project and used a quad enc w/switch for input.

author: madires
author_rank: Super Contributor
timestamp: July 12, 2020, 04:45:53 pm
content: In my case a 2.6" LCD with touch screen and ADS7843/XPT2046 is good enough for up, down, left, right and center.

author: madires
author_rank: Super Contributor
timestamp: August 12, 2020, 02:56:09 pm
content: Update on the display module:After adding some debugging code to dump all the controller's registers there was one undocumented register reading "9340". But it was not possible to read ID4 to confirm that. The reason for that and the ghostly output with my ILI9341 driver is that the extended command set is disabled (EXTC pin low). After removing all commands related to the extended command set the display works fine with the ILI9341 driver.

author: strawberry
author_rank: Super Contributor
timestamp: August 14, 2020, 08:56:46 am
content: I got mine 2.8" HX8347D without even single backlight resistors. LED connected directly to 3.3V supply.