Author Topic: ILI9341 LCD driver, max SPI clock speed?  (Read 18634 times)

0 Members and 1 Guest are viewing this topic.

Offline Chris C

  • Frequent Contributor
  • **
  • Posts: 259
  • Country: us
ILI9341 LCD driver, max SPI clock speed?
« on: August 16, 2015, 05:03:26 pm »
I'm using an ILI9341-based LCD module, and the 4-wire SPI interface to communicate with it.  According to the datasheet's spec for this interface, I should be able to write at up to 1s/100ns(twc)=10Mhz, and read at up to 1s/150ns(trc)=6.66Mhz.

However, I am successfully writing and reading at 24Mhz!  Not just for a simple test case, either.  I'm doing complex graphics, mixed reads/writes for alpha blends, both 16-bit and 24-bit pixel writes, and so on - yet haven't seen a single glitch.  (Except those caused when I bump my dodgy old breadboard or jumper wires.  That I'm using such poor connections, and it's still working at this speed when not physically disturbed, make this even more amazing.  The signal integrity must be horrible.)

In the past I've tried communicating with other complex SPI devices at speeds past their ratings, just to see what would happen.  All started showing issues with modest increases, even when run at max Vdd.  Yet I'm reading from this at 360% of its max rated speed!  And I know of cases of others doing the same with their ILI9341-based LCD, as well.

All of which really makes me question whether I've read the spec and converted from ns to Mhz properly.  Did I simply make a stupid mistake?  Here's the relevant page from the datasheet:

 
The following users thanked this post: thm_w

Offline madires

  • Super Contributor
  • ***
  • Posts: 6915
  • Country: de
  • A qualified hobbyist ;)
Re: ILI9341 LCD driver, max SPI clock speed?
« Reply #1 on: August 16, 2015, 05:57:09 pm »
I'm reading the ILI9341's datasheet right now (going to add support to the Transistortester) and I think your calculations are correct. A quick web search lists some blog postings claiming that a 24, 36 and even 48 MHz SPI clock runs fine.
 

Offline Chris C

  • Frequent Contributor
  • **
  • Posts: 259
  • Country: us
Re: ILI9341 LCD driver, max SPI clock speed?
« Reply #2 on: August 16, 2015, 11:53:34 pm »
Hmm, odd.  I wonder why they underrated it so much.  Or if individual variation between ICs is incredibly large.

Or perhaps that rating applies only at the lowest core voltage.  In looking over the initial register setup provided with the module, I noticed what appears to be an option to change that voltage, and that it's being set one step short of max.

BTW, if you're talking about the same Transistortester that I think you are, that's an amazing project!  And one I will be benefiting from shortly, if my package ever shows up. :)  I'm familiar with most of the ILI9341, having written my own PIC-based driver for the ILI9341 for it.  Should you run into any difficulties, I may be able to help, and will certainly be willing to try.
 

Offline DavidMenting

  • Contributor
  • Posts: 45
  • Country: nl
    • Nut & Bolt interaction design
Re: ILI9341 LCD driver, max SPI clock speed?
« Reply #3 on: August 17, 2015, 01:55:36 pm »
I was pleasantly surprised by this fact as well. I'm running 16 of them at the same time at a bit over 30 MHz in this art installation:
 

Offline Chris C

  • Frequent Contributor
  • **
  • Posts: 259
  • Country: us
Re: ILI9341 LCD driver, max SPI clock speed?
« Reply #4 on: August 17, 2015, 05:23:15 pm »
That's a wonderful zoetrope!  Thanks for sharing it.
 

Offline bastelWastel

  • Newbie
  • Posts: 1
  • Country: de
Re: ILI9341 LCD driver, max SPI clock speed?
« Reply #5 on: May 13, 2020, 10:20:08 am »
I ended at SCLK=78.75 (315M/4) these days. Thanks for the Timing Chart posted above. For 2 weeks I was looking for this information despite I have the ILI datasheet! But seemingly I always stopped searching at the signal charts in chapter #7.  |O

 

Offline madires

  • Super Contributor
  • ***
  • Posts: 6915
  • Country: de
  • A qualified hobbyist ;)
Re: ILI9341 LCD driver, max SPI clock speed?
« Reply #6 on: May 13, 2020, 01:07:48 pm »
Welcome to the display overclockers! ;D
 

Offline soFPG

  • Frequent Contributor
  • **
  • Posts: 283
  • Country: de
Re: ILI9341 LCD driver, max SPI clock speed?
« Reply #7 on: May 15, 2020, 01:20:07 pm »
Which controller does 80MHz SPI? ESP8266?
8-Bit parallel would probably be easier in case you don't have an 80MHz SPI capable µC
 

Offline madires

  • Super Contributor
  • ***
  • Posts: 6915
  • Country: de
  • A qualified hobbyist ;)
Re: ILI9341 LCD driver, max SPI clock speed?
« Reply #8 on: May 15, 2020, 01:59:10 pm »
You should be able to find ARM based MCUs with a sufficient clock rate. I have no idea about the ESP8266 which runs at 80 or 160MHz. A quick search shows that the SPI clock is derived from the system bus which runs at 80MHz and the smallest divider is 1. So it should be able to do 80MHz SPI.
 

Offline Theboel

  • Frequent Contributor
  • **
  • Posts: 277
  • Country: id
Re: ILI9341 LCD driver, max SPI clock speed?
« Reply #9 on: May 15, 2020, 02:01:12 pm »
I use ILI9341 with arduino nano my problem is the graphic look in slow motion/ slow update I really apreciate if someone can help me to solve this problem based from this "OC discussion" :palm: :palm: :palm: :palm:
 

Offline TK

  • Super Contributor
  • ***
  • Posts: 1687
  • Country: us
  • I am a Systems Analyst who plays with Electronics
Re: ILI9341 LCD driver, max SPI clock speed?
« Reply #10 on: May 15, 2020, 02:04:04 pm »
STM32 @ 180MHz can do 45MHz SPI.  The Teensy 4.0 runs an NXP cortex-m7 micro @ 600MHz, I have not tested SPI but I estimate it can go over 100MHz.
 

Offline TK

  • Super Contributor
  • ***
  • Posts: 1687
  • Country: us
  • I am a Systems Analyst who plays with Electronics
Re: ILI9341 LCD driver, max SPI clock speed?
« Reply #11 on: May 15, 2020, 02:05:26 pm »
The spec posted by OP says MIN 100ns, so it is minimum 10MHz.  Am I missing something?
 

Offline madires

  • Super Contributor
  • ***
  • Posts: 6915
  • Country: de
  • A qualified hobbyist ;)
Re: ILI9341 LCD driver, max SPI clock speed?
« Reply #12 on: May 15, 2020, 02:16:54 pm »
I use ILI9341 with arduino nano my problem is the graphic look in slow motion/ slow update I really apreciate if someone can help me to solve this problem based from this "OC discussion" :palm: :palm: :palm: :palm:

Max SPI clock rate for an ATmega328 running at 16MHz is clk/2 = 8MHz when using the hardware SPI. Bit-bang SPI is way to slow.
 

Offline madires

  • Super Contributor
  • ***
  • Posts: 6915
  • Country: de
  • A qualified hobbyist ;)
Re: ILI9341 LCD driver, max SPI clock speed?
« Reply #13 on: May 15, 2020, 02:20:36 pm »
The spec posted by OP says MIN 100ns, so it is minimum 10MHz.  Am I missing something?

Yep, that's what the datasheets states. But several people tried higher SPI clock rates and the ILI9341/9342 was still happy. So we wonder what the real maximum is.
 

Offline TK

  • Super Contributor
  • ***
  • Posts: 1687
  • Country: us
  • I am a Systems Analyst who plays with Electronics
Re: ILI9341 LCD driver, max SPI clock speed?
« Reply #14 on: May 15, 2020, 03:27:40 pm »
There is an interesting discussion on the Teensy forum about running ILI9341 @ 80MHz with a Teensy 4.0 board

https://forum.pjrc.com/threads/57652-Teensy-4-SPI-bus-gt-38mhz-possible
 

Offline ajb

  • Super Contributor
  • ***
  • Posts: 2285
  • Country: us
Re: ILI9341 LCD driver, max SPI clock speed?
« Reply #15 on: May 15, 2020, 06:10:29 pm »
The spec posted by OP says MIN 100ns, so it is minimum 10MHz.  Am I missing something?

Time and frequency are inverse of each other, so minimum time determines maximum frequency and vice versa.  As frequency goes up, period goes down, so anything above 10MHz will have <100ns period, and therefore violates the minimum time specification.

I wonder if this means that the parallel interface can also be run faster than spec.  Being able to write 16bits @ >15MHz would be nice.
« Last Edit: May 15, 2020, 06:14:47 pm by ajb »
 

Offline TK

  • Super Contributor
  • ***
  • Posts: 1687
  • Country: us
  • I am a Systems Analyst who plays with Electronics
Re: ILI9341 LCD driver, max SPI clock speed?
« Reply #16 on: May 15, 2020, 06:29:26 pm »
The spec posted by OP says MIN 100ns, so it is minimum 10MHz.  Am I missing something?

Time and frequency are inverse of each other, so minimum time determines maximum frequency and vice versa.  As frequency goes up, period goes down, so anything above 10MHz will have <100ns period, and therefore violates the minimum time specification.

I wonder if this means that the parallel interface can also be run faster than spec.  Being able to write 16bits @ >15MHz would be nice.
You are totally right... I had my senior moment...   :palm:
 

Offline newbrain

  • Super Contributor
  • ***
  • Posts: 1440
  • Country: se
Re: ILI9341 LCD driver, max SPI clock speed?
« Reply #17 on: May 19, 2020, 09:19:02 am »
Just a single data point, but with a different controller: The HX8357-D, in a 3.5" Adafruit display.

I'm running it with the SPI (from an i.MX RT1021 evaluation board) at 45MHz: three times the maximum write clock frequency in the datasheet.
No glitches or crashes.

These controller chips seem to take a lot more than they are specified for.
Nandemo wa shiranai wa yo, shitteru koto dake.
 
The following users thanked this post: thm_w

Offline T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 19772
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: ILI9341 LCD driver, max SPI clock speed?
« Reply #18 on: May 19, 2020, 09:30:37 am »
FYI, the ST7735 and RM68050 do seem to run out of poop, near their rated timings.

It's been a few years since I was actively developing with them so I don't remember exactly what or how much.  My platform only has powers of 2 SPI clock control (prescalers) so I wasn't able to push very close to ratings.

Tim
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 

Offline MulattoKid

  • Newbie
  • Posts: 3
  • Country: no
Re: ILI9341 LCD driver, max SPI clock speed?
« Reply #19 on: July 01, 2022, 01:12:06 pm »
@newbrain - I'm curious if you had to do anything special to get the SPI clock to run at 45MHz? If I go above the specified 15.15MHz (66ns as in the spec for DBI Type-C WRX_SLC) the output on the screen is corrupted. I'm driving it from an ESP32-S3, but not sure if that matters...
 

Offline ajb

  • Super Contributor
  • ***
  • Posts: 2285
  • Country: us
Re: ILI9341 LCD driver, max SPI clock speed?
« Reply #20 on: July 01, 2022, 03:43:54 pm »
@newbrain - I'm curious if you had to do anything special to get the SPI clock to run at 45MHz? If I go above the specified 15.15MHz (66ns as in the spec for DBI Type-C WRX_SLC) the output on the screen is corrupted. I'm driving it from an ESP32-S3, but not sure if that matters...

How do you have this hooked up?  Can you share a photo of the setup or layout if it's on a PCB?

How fast you can run SPI depends on connections and wiring as well.  If you have flying leads on a breadboard or something you will start seeing signal integrity issues sooner than on a nicely laid out PCB, and those issues will eat into whatever margin you might have for exceeding the data rate spec.  Another complication is pin drive strength, I don't know if the ESP32 has a setting for that, but if it's set too high or too low you can also have issues.  Insufficient drive strength will round over edges, and excessive drive strength will cause ringing and reflections, especially with non-ideal layout/wiring.
 

Offline newbrain

  • Super Contributor
  • ***
  • Posts: 1440
  • Country: se
Re: ILI9341 LCD driver, max SPI clock speed?
« Reply #21 on: July 01, 2022, 07:44:53 pm »
@newbrain - I'm curious if you had to do anything special to get the SPI clock to run at 45MHz? If I go above the specified 15.15MHz (66ns as in the spec for DBI Type-C WRX_SLC) the output on the screen is corrupted. I'm driving it from an ESP32-S3, but not sure if that matters...

How do you have this hooked up?  Can you share a photo of the setup or layout if it's on a PCB?
Signal integrity is overrated.  :-DD (joking, of course, but read below!)

I'm honestly too ashamed to post a picture - it's the perfect example of how not to do these things  :-[
My setup is just a bunch of 20 cm Dupont wires from the Arduino like connector of an iMX RT1021 evaluation board to this display.
The display board has some mods (to use I2C on the touch screen controller instead of SPI), and I'm never reading back from the display (max SPI clock frequency is lower when reading for that controller, IIRC).

Apart from that, nothing special, so the worst possible setup you could imagine, also taking into account that the 1021 lpspi peripheral needed to be overclocked to get to 45 MHz.

A friend of mine has a slightly better setup (it's an SDR receiver project we share), he soldered some IDC cable.
I need to dismantle the thing to carry it with me when I go back and forth with Italy, so never bothered doing a better job.

I raised the SPI frequency until artefacts started appearing, then backed off a bit - that's it.

The SW is extremely stable (FreeRTOS+CMSIS DSP based), and we never observed any glitches on the display - it has been left running for days on end - the display is updated every 100 ms with a 426×128 FFT and waterfall (plus as needed for other fields).

Funny as it might seem, I'm instead having 100 kHz I2C signal integrity problems (adding the touch screen controller was the straw that broke the camel's back - Audio codec, RTC, Si5351, 24C16 EEPROM - all flying Duponts, too).

« Last Edit: July 01, 2022, 08:10:11 pm by newbrain »
Nandemo wa shiranai wa yo, shitteru koto dake.
 

Offline DavidAlfa

  • Super Contributor
  • ***
  • Posts: 2875
  • Country: es
Re: ILI9341 LCD driver, max SPI clock speed?
« Reply #22 on: July 02, 2022, 02:15:54 pm »
Yes, you usually can do that, I've ran 75MHz SPI without issues, but works only for for writing, reading you'll get garbage, you'll have to lower the speed.
You're playing with tolerances and limits, you might find 10mm longer traces no longer work.
Also you might be getting small errors, but not noticiable by human eyes.
Hantek DSO2x1x            Drive        FAQ          DON'T BUY HANTEK! (Aka HALF-MADE)
Stm32 Soldering FW      Forum      Github      Donate
 
The following users thanked this post: newbrain

Offline MulattoKid

  • Newbie
  • Posts: 3
  • Country: no
Re: ILI9341 LCD driver, max SPI clock speed?
« Reply #23 on: July 27, 2022, 06:38:43 am »
Thanks for the replies (I'm a bit late as I was away on vacation for a few weeks)  :)

I'm afraid I can't share pictures, but the ESP32-S3 is on an in-house development PCB, and I have 20cm breadboard jumper wires connected from it to the Adafruit PiTFT 3.5" Touch Screen (HX8357-D controller). I'm only writing to the display, and I'm using the ESP's libraries for setting up the SPI bus etc.

Quote
also taking into account that the 1021 lpspi peripheral needed to be overclocked to get to 45 MHz.
Sorry, what peripheral is this?

 

Offline newbrain

  • Super Contributor
  • ***
  • Posts: 1440
  • Country: se
Re: ILI9341 LCD driver, max SPI clock speed?
« Reply #24 on: July 27, 2022, 08:55:47 am »
Quote
also taking into account that the 1021 lpspi peripheral needed to be overclocked to get to 45 MHz.
Sorry, what peripheral is this?
It's just the name of the NXP iMX RT10xx series SPI peripherals, low power SPI - there is also a different one based on the FlexIO.
IIRC, lpspi maximum frequency is 33 MHz, so I'm out of specs on both MCU and display sides.

It started just for fun as an experiment, but since it's perfectly stable (as said, on two boards+display), I left it alone and enjoyed the increased speed.

Of course, not recommended in any non-hobby application.
Nandemo wa shiranai wa yo, shitteru koto dake.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf