Lib for ILI9486 - 3.5 inch 480x320 touch TFT for RPi

Working libraries, libraries being ported and related hardware
zmemw16
Posts: 1150
Joined: Wed Jul 08, 2015 2:09 pm
Location: St Annes, Lancs,UK

Re: Lib for ILI9486 - 3.5 inch 480x320 touch TFT for RPi

Post by zmemw16 » Sun Mar 05, 2017 6:38 pm

http://www.waveshare.com/wiki/3.5inch_RPi_LCD_(A)

good news, bad news
good - not much, you can find the pinning details for the socket
bad - couldn't see / find a schematic - rather surprised, but given the following lines perhaps understandable
bad - some cloning of their products
bad - yours doesn't seem to match their picture
bad - doesn't seem to match the fakes

i suspect the easiest is to find a Raspberry Pi and if there's anything in the driver or boot messages.

stephen

david.prentice
Posts: 78
Joined: Wed Nov 16, 2016 8:52 am

Re: Lib for ILI9486 - 3.5 inch 480x320 touch TFT for RPi

Post by david.prentice » Mon Mar 06, 2017 10:32 am

The good news is that you have the WaveShare logo on your pcb. So it might be genuine.

You can always ask WaveShare for the schematic. Or simply work it out by yourself.

I do not own a RaspPi. I know nothing about them.

David.

fari
Posts: 19
Joined: Sun Feb 26, 2017 12:01 pm

Re: Lib for ILI9486 - 3.5 inch 480x320 touch TFT for RPi

Post by fari » Mon Mar 06, 2017 11:58 am

Thanks Steve, David and Stephen for your precious hints!

I will work through your hints. Hopefully one of them would work.

fari
Posts: 19
Joined: Sun Feb 26, 2017 12:01 pm

Re: Lib for ILI9486 - 3.5 inch 480x320 touch TFT for RPi

Post by fari » Tue Mar 07, 2017 4:56 pm

Thanks Steve, David and Stephen for your help!

Finally I have got it done! I have found out the right initialisation sequence. The SPI frequency is crucial. The display works only in the range between 12MHz and 32MHz only. Any frequency out of this range lead to white flashing on the screen!

stevestrong
Posts: 1126
Joined: Mon Oct 19, 2015 12:06 am
Location: Munich, Germany

Re: Lib for ILI9486 - 3.5 inch 480x320 touch TFT for RPi

Post by stevestrong » Tue Mar 07, 2017 8:40 pm

I think I have mentioned already the SPI clock limitation to 24MHz, but it is good that you also figured out.

fari
Posts: 19
Joined: Sun Feb 26, 2017 12:01 pm

Re: Lib for ILI9486 - 3.5 inch 480x320 touch TFT for RPi

Post by fari » Wed Mar 08, 2017 12:08 pm

Yes! You are right Steve! but I had several problems:
- The described pin out of the display on the site of the vender was wrong :x (I tried at this time to lower the frequency, but with the wrong wiring!!! :roll: ). This problem was fundamental
- The Init sequence had to be changed slightly ( I have got the right sequence of the init sequence of a raspberry pi, which was posted in the internet)
- The frequency e.g. 8MHz does not work. I could not understand till now, why lower frequencies did not work
After I have found out, that the pin out description was wrong, I managed to solve the problem very fast.
Thanks to all for the support!


If you might be interested, here is the right pin out of the display I am using (http://www.ebay.de/itm/252472008067?ul_noapp=true):
35Inch Display Pinout.jpg
35Inch Display Pinout.jpg (163.87 KiB) Viewed 315 times
Here is the best init sequence I had:
Command: 0xb0, Data: 0x0,
Command: 0x11,
DELAY 250ms
Command: 0x3A, Data: 0x55,
Command: 0xC2,Data: 0x44,
Command: 0xC5,Data: 0x00,0x00,0x00,0x00,
Command: 0xE0,Data: 0x0F,0x1F,0x1C,0x0C,0x0F,0x08,0x48,0x98,0x37,0x0A,0x13,0x04,0x11,0x0D,0x00,
Command: 0xE1,Data: 0x0F,0x32,0x2E,0x0B,0x0D,0x05,0x47,0x75,0x37,0x06,0x10,0x03,0x24,0x20,0x00,
Command: 0xE2,Data: 0x0F,0x32,0x2E,0x0B,0x0D,0x05,0x47,0x75,0x37,0x06,0x10,0x03,0x24,0x20,0x00,
Command: 0x36,Data: 0x48,
Command: 0x11,
DELAY 250 ms
Command: 0x29

The display works only in the range between 12MHz and 32MHz .

Good luck!

stevestrong
Posts: 1126
Joined: Mon Oct 19, 2015 12:06 am
Location: Munich, Germany

Re: Lib for ILI9486 - 3.5 inch 480x320 touch TFT for RPi

Post by stevestrong » Fri May 19, 2017 3:49 pm

Back again after a long time just to inform you about an update.

I modified my ILI9486 - SPI board for 16bit parallel access. The reason was to obtain higher write speed.
The files can be found here: https://github.com/stevstrong/Adafruit_ ... 6bit_STM32
I tested it with my black F4 board.
The current benchmark:

Code: Select all

Benchmark                Time (microseconds)
Screen fill              104767
Text                     10386
Lines                    185635
Horiz/Vert Lines         9400
Rectangles (outline)     5971
Rectangles (filled)      255546
Circles (filled)         95452
Circles (outline)        78896
Triangles (outline)      51741
Triangles (filled)       112147
Rounded rects (outline)  26409
Rounded rects (filled)   295197
This shows a clear improvement in most of the cases compared to SPI access benchmark, but not that impressive for triangles (outline) test.
The critical point by parallel access is the minimum low time for the WR pulse, it must be at least 100ns. This is achieved using F4 with the normal digitalWrite() function. Any further speed optimization using register direct access leads to corrupted display in case of F4.
Maybe for F1 it would make sense, but I did not try it at the moment.

ag123
Posts: 624
Joined: Thu Jul 21, 2016 4:24 pm

Re: Lib for ILI9486 - 3.5 inch 480x320 touch TFT for RPi

Post by ag123 » Fri May 19, 2017 4:47 pm

seem like the f4 is *too fast* for the lcd, the limit it seemed is not the number of parallel wires, it is how fast that mcu on the lcd can work :lol:

stevestrong
Posts: 1126
Joined: Mon Oct 19, 2015 12:06 am
Location: Munich, Germany

Re: Lib for ILI9486 - 3.5 inch 480x320 touch TFT for RPi

Post by stevestrong » Sat May 20, 2017 3:09 pm

Indeed, F4 is unbelievable fast!

Here the bench using FSMC:

Code: Select all

Benchmark                Time (microseconds)
Screen fill              48091
Text                     5683
Lines                    83850
Horiz/Vert Lines         4258
Rectangles (outline)     2655
Rectangles (filled)      117322
Circles (filled)         39360
Circles (outline)        35190
Triangles (outline)      23373
Triangles (filled)       50048
Rounded rects (outline)  12160
Rounded rects (filled)   134562
I think, this is incredibly good performance for a 320*480 display.
Last edited by stevestrong on Thu Jun 15, 2017 7:17 pm, edited 1 time in total.

magflip
Posts: 6
Joined: Sat May 20, 2017 3:22 pm

Re: Lib for ILI9486 - 3.5 inch 480x320 touch TFT for RPi

Post by magflip » Sat May 20, 2017 3:35 pm

stevestrong wrote:Back again after a long time just to inform you about an update.

I modified my ILI9486 - SPI board for 16bit parallel access. The reason was to obtain higher write speed.
The files can be found here: https://github.com/stevstrong/Adafruit_ ... 6bit_STM32
I tested it with my black F4 board.
The current benchmark:

Code: Select all

Benchmark                Time (microseconds)
Screen fill              104767
Text                     10386
Lines                    185635
Horiz/Vert Lines         9400
Rectangles (outline)     5971
Rectangles (filled)      255546
Circles (filled)         95452
Circles (outline)        78896
Triangles (outline)      51741
Triangles (filled)       112147
Rounded rects (outline)  26409
Rounded rects (filled)   295197
This shows a clear improvement in most of the cases compared to SPI access benchmark, but not that impressive for triangles (outline) test.
The critical point by parallel access is the minimum low time for the WR pulse, it must be at least 100ns. This is achieved using F4 with the normal digitalWrite() function. Any further speed optimization using register direct access leads to corrupted display in case of F4.
Maybe for F1 it would make sense, but I did not try it at the moment.
I've been trying for a week to make my ILI9486 works with a Generic STM32F103C (blue pill) but unfortunately, I still have not been able to get it to work. Using this library, how can I wiring both (ILI9486 shield for uno and Blue pill)? I can't understand how can I do it.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest