David, unfortunately, I need the speed and memory of the stm32's for my project. Now if somebody produced a board with an stm32F103 with a 64 pin chip and a MEGA2560 form factor, Id be all over it. As it is, I'm trying to design my own board which will have headers etc but I need to prove that I can drive the screen etc before I commit to having them printed.
BTW, would it take much to change the SPECIAL to work with the following pins
Data on PA0 .. PA7
Control on PortB from 5..9
LCD_RST PB9
LCD_CS PB8
LCD_RS PB7
LCD_WR PB6
LCD_RD PB5
I read somewhere about problems using PB4 and these pins certainly work with your lcd_id_readreg sketch?
Your photo shows a write-only mega2560 Shield with an 8-bit interface. (4 resistor packs RP1-RP4)
It is the wrong shape for 400x320. It is probably 480x320.
As far as I know, the only library that will work is MCUFRIEND_kbv that you can install from Library Manager.
However, it is rather complex to configure it to work with your SPECIAL board.
Edit utility/mcufriend_shield.h to define USE_SPECIAL
Edit utility/mcufriend_special.h to define USE_MEGA_8BIT_SHIELD
Edit every sketch to force tft.begin(0x9488)
Plug the shield into the Mega making sure that all the male pins mate with female sockets.
It is possible that your Shield has a different controller. If 0x9488 is not 100% perfect, try 0x9481, 0x9486, 0x1581, ...
Please let me know how you get on. The library is intended for Uno Shields. It is fiddly to enable SPECIALs for unusual hardware.
" 3.95 inch LCD touch screen for arduino mega2560, Arduino due...
Resolution: 480x320
Controller: ili9488
LCD IC specifications, ili9488 MCU arm driver
Size: 9.7 cm x 6.9 cm "
copied from the Seller Page.
I will try your suggestions on weekend when I have some time free.
David, can I interest you in a free (FREE) TFT shield adapter and STM32 mini board (see photos)
I have just recieved 10 boards from the PCB fab house in China. Unfortunately, I have cocked up the top silk so there is no info printed on the actual board but basically on the top side of the board is a 'blue pill' with two rows of connectors for each pin on the board (except 5V which is O/C) there is two additional digital in and analog in pins and a row of 8 connectors each of 0V, 3V3 and 5V for connecting sensors etc. There is a 5V regulator and a 3V3 regulator and it can also accept LiPo battery by removing links and connecting to the pins.
On the back, is a standard Arduino UNO form factor connector for all the TFT's which are on the market.
The Eagle and Gerber files are available for anyone who wants to make their own boards. I can supply a link to the PCB shop and first orders (10 boards) are free - delivery to UK by TNT cost me about £15 so each board was about £1.50 + parts, so under £2.50.
I would simply ask that you try it out, and make any TFT drivers you get working with it available to anyone who can make use of them.
1 - Holes for standoff pillars.
2 - 5V connected through so TFT etc. powered up when on USB power. Just remember to NOT use boards own power supply at the same time as USB or magic smoke may ensue.
Please PM me with additional ideas. Lets make this the go-to design to interface the blue pill with UNO type TFT shields for prototyping.
Remember, I'm not selling anything, I'm making the design freely available.
david_prentice:
Your photo shows a write-only mega2560 Shield with an 8-bit interface. (4 resistor packs RP1-RP4)
It is the wrong shape for 400x320. It is probably 480x320.
As far as I know, the only library that will work is MCUFRIEND_kbv that you can install from Library Manager.
However, it is rather complex to configure it to work with your SPECIAL board.
Edit utility/mcufriend_shield.h to define USE_SPECIAL
Edit utility/mcufriend_special.h to define USE_MEGA_8BIT_SHIELD
Edit every sketch to force tft.begin(0x9488)
Plug the shield into the Mega making sure that all the male pins mate with female sockets.
It is possible that your Shield has a different controller. If 0x9488 is not 100% perfect, try 0x9481, 0x9486, 0x1581, ...
Please let me know how you get on. The library is intended for Uno Shields. It is fiddly to enable SPECIALs for unusual hardware.
David.
David, I tried your solution using same mega2560 Shield on a Due. When i run graphicstest it works ok for a bit then it gets distorted {lines wrong color, black pixels, etc.). Checked that shield was securely plugged in the due. Just thought I'd give you some feedback and thanks for your great library!
I don't often use a Due. And even less often with a write-only shield.
The Due is a lot faster than a Mega. However there is a lot of bit-mangling to match the Mega Shield.
So it might be necessary to slow down a little for your USE_MEGA_8BIT_SHIELD on a Due.
Do you get glitches on the testRectangles() or the testCircles() ?
Thanks for fast reply, yes, get distortion on all tests.
Just tried your latest library on Nucleo board using mcufriend 9488 uno shield. Works like a charm!
First time i have nucleo running any tft. Thanks a bunch!
edit:
I will look at your library later and try to slow down for Due, if i can figure out how.
After using David Prentice's latest Mcufriend_kbv library, a Mega 2560 TFT ILI9488 Shield works on a Due! The time on graphics test is about one second slower, but I'm guessing that's from slowing down strobe calls for the Due.
From #163 it appears that you have a Mega2560 Shield with 8-bit interface.
It should work just fine on the Due.
I only have an HX8357-D Mega2560 Shield with 8-bit interface. This works on the Mega and Due.
Your ILI9488 might be slightly different. Note that these shields have 10k series resistors. So you can imagine all sorts of propagation problems.
What have you done? What time do you get for the "Adafruit Tests"?
On an overclocked Xmega, I can get 1.70 seconds for a 320x480 screen.
You should be happy with 3 seconds or so.
Sorry but work has kept me away for a while.
Strangely, it seems, running graphicstest.ino example from your library I'm getting 7.97 seconds. Any ideas why?
Are you using Nucleo or Due? Both have random PORT pins for the data bus. Mangling all the bits slows things down.
The Mega Shields are designed for a Mega2560. The Shield wiring is mapped nicely to PORTA, PORTC. So a Mega shield works quite fast on a Mega2560.
8 seconds is not unreasonable for the Adafruit Tests. The display should give a reasonable response to most Arduino projects. Have pity on those punters that run a Uno Shield on a Mega. It works but is far slower than a Uno shield on a Uno.
"8 seconds is not unreasonable for the Adafruit Tests"
That's kinda what i thought too.
Using the Mega2560 with same setup (mcufriend.kbv library, and ILI9488 mega 8-bit shield), adafruit tests run at 8.47 seconds, so the Due is still faster.
In an earlier post i mentioned using a Nucleo nucleo board, mcufriend.kbv library, and ILI9488 uno shield.
(to be more specific it's a Nucleo f103rb 64mhz). The adafruit tests run just a little slower than Due with same setup.