david_prentice:
You have a Himax HX8347-I controller.
Make sure that you have library version v2.9.3 or newer.
If you have an old library, delete the existing MCUFRIEND_kbv folder in User libraries.
Install the current version from the IDE.
You should edit the mcufriend_kbv.cpp file:
#define SUPPORT_8347D
Please let me know how you get on.
David.
Hi David, adding "#define SUPPORT_8347D" did do the trick, to get the screen working. But i got some warnings. Just wondering how to fix these? Thank you.
The warnings are simply about anonymous string constants. You don't need to worry about them.
You can avoid most of them by adding the const keyword. e.g.
const char *aspectname[] = {
I intend to tidy up the graphictest_kbv sketch. If I can make it smaller, I can have more "SUPPORT_XXXX" models that work out of the box. Obviously it is important for the examples to run on a Uno. Better if the warnings disappear.
I doubt if I would ever enable the HX8347, HX8352, SSD1289 by default. But it would be nice if ILI9326, SPFD5420 worked by default.
I am pleased that your HX8347-I is working. Member "Governor" has had difficulty with a 16-bit HX8347-I. At least he knows that it is not a library problem now.
The Mcufriend Uno Shields plug into a Uno, Mega, Due, Zero, ... Maple, Nucleo
The Mcufriend Mega Shields only plug into a Mega or Due.
Why did you buy a Display Shield if you don't want to mate as Nature intended?
If you post your full wiring plan, I can advise. I might even write a SPECIAL for you.
David.
sometimes you feel like a nut and sometimes you dont.... i bought a UNO shield but when i was developing the rocket launcher for my drone i burned out quite a few of them (UNOs) when i got some time off to review another project i realized all i had left was a Mega2560, (so now using the UNO shield on a mega) i dont like the fact that the shield covers up what would otherwise be useable ports, and the display i got for the price i paid was cheaper than the bare display on a breakout, and really a shield is just a device specific break out. in either case, it would be wonderful and probably simple to specify the D0-D7 pins in the event that you did come across a plain lcd on a breakout bearing the same controller as these shields, I must admit after poking a round in the library for a few days it is an amazing thing of beauty. Well done seriously to you and any others who may have code in this tarball, i really didnt read the credits. that being said a plain screen on breakout would benefit from not absorbing all of my natural pwm outputs and instead using pure digital ports (22-42) with exception of course for the analog ports (2 i believe) for the touch screen. as it sits now this screen on a mega blocks up all the ad ports just about, sheild or not they are fast and handy screens that with a little dupont magic look great in any project. btw i have a 2.4 ILI9325
If you would care to run LCD_ID_readreg with the correct defines, I am sure that it would report sensible values. (Remove the microSD from the card holder first)
When you have posted the result, I will look at your "SPECIAL"
David.
The result with correct defines and without sdcard:
Read Registers on MCUFRIEND UNO shield
controllers either read as single 16-bit
e.g. the ID is at readReg(0)
or as a sequence of 8-bit values
in special locations (first is dummy)
david_prentice:
I am pleased that your HX8347-I is working. Member "Governor" has had difficulty with a 16-bit HX8347-I. At least he knows that it is not a library problem now.
As stated in the thread I was responding in, I've never really suspected your code to be faulty. C++ is not unknown to me, as my past profession was of a developer in a known antivirus company; however I have no previous experience with microcontrollers programming so I didn't really raise any objections to it yet.
Rather, after spending two full days trying my LCD board to get cracking, I've made a correct assumption of it being dead-on-arrival with nothing except the backlight being working on it - besides your amendments to the Adafruit TFT library/MCUFRIEND_kbv I've also tried different other libraries, including a fork of the UTFT library which was meant to support the Hirax HX8347-I and tested by a fellow from the Czech Republic. Since the board made me more woes with my attempt to plug in a SD card, only to be welcomed by the fact that from then on, it was unreadable, I've ruled out the software part of being the cause of the problems.
Nevertheless, after declaring the thing dead, I've bit the bullet and dismantled my whole board, including the panel and the actual liquid crystal display - and found no dedicated chip to drive the TFT LCD, to verify if there really had been a 8347i. I did take note of the AMS 3.3V regulator, the HR2046 touch screen controller and the SMD resistor packs on the PCB, and a few passive components soldered straight on the flex cable that lead to the LCD display itself -- which had, like, one hundred conductive traces on a micrometer scale. The driver might have been hiding under the black epoxy-rubber-gunk on the edge of the display... who knows. I expected it to be a separate surface-mount chip.
At least I've managed the display to make some cool graphics....... after a 20 kilovolt supply was connected straight to it Also the actual glass part of the LCD has an interesting filter glued on it: you can view through it, but all LCD screens appear as being completely black, even when turned on.
You have got two "whole" ports: PORTA on D22-D29, PORTC on D30-D37.
You are wasting PORTA by mixing bits. If D22 is cast in stone, you could put the data bus onto PORTC instead.
The result of sensible mapping is dramatic. You would also find it easier to understand.
Just look at the SPECIALS for MEGA_8BIT_SHIELDS.
David.
UT OH; that right there looks like we are getting outside of lazy arduino comfort zone and into the real deal atmega 2560 stuff. lol. i come from Microchip PICs just got so tired of the design process and needing custom pcbs every time to get something popping, actually resisted Arduino until last year when i finally wanted to see what the hype was all about, my 300$ Pic programmer hasnt seen use since the arduino clone arrived from china..lol ... but yes i know what you mean about port mapping, glad i talked to you before i sent this board order off to china, i moved all the atx stuff to PORTC.
Have you got the SPECIAL working correctly? i.e. was my 20 mins successful?
It would make life simpler and FASTER if you put the Data Bus onto PORTC (or PORTA)
Have you got it working on PORTC now?
God invented the Uno. The most important part being the Shield pluggability.
It means that anyone, anywhere in the world can know the wiring. And a library author does not need to worry about how the punter has connected it.
Arduino Uno, Mega, Due, ... have been very popular. And work pretty well.
I don't know whether the PIC ChipKit boards have sold many boards. And no one has ever asked me to support ChipKit.
If anyone wants to use non-shield wiring, it is their responsibility to write a SPECIAL for their specific project. I don't mind helping for ONE target. I certainly don't want to do it for multiple targets.
The LCD_ID_readreg sketch shows how to write the basic write_8(), read_8(), ... on ANY pins.
A Shield has FIXED wiring. You can achieve the "best" performance.
Clearly the ILI9326 is not enabled. The graphictest_kbv sketch is very tight for Flash memory on a Uno. Hence I have to make a decision about the "less common" controllers.
Several people own R61509V and ST7793 (I have R61509).
I doubt if more than one person owns ILI9326 or SPFD5420.
I suggest that you disable the R61509V and enable ILI9326.
The important lessons are:
Test any "special" wiring with the LCD_ID_readreg.ino sketch
Check whether readID() is detecting the controller. This verifies your wiring.
Check whether a "less common" device is actually enabled.
Look at my post #1059. And compare with other SPECIALs.
The driver for a particular special wiring is different for each target AVR.
I was surprised to see that your suppiler was using my library. If they are selling a commercial product, it would have been wise to ask me ( the author). Then I would have ensured that 9326 was enabled as default.
As you may have noticed, the Uno mapping for the OPENSMART works nicely.
Pin mapping for MEGA2560 (or DUE) is very fiddly.
Do you really want to use a Mega2560?
David.
Edit. I see that they had written SPECIAL macros for the MEGA2560. They "look" ok to me.
I have written them in my style and added to message #1059. Untested. Please tell me if both sets work.
Both work well, I had to forget a piece of the code when I copied it.
Here are screenshots and modified files thanks to you.
I was also surprised to see that it was your drivers that came with the lcd, really no respect. In addition the supplied sheet does not have the right wiring.
Yes, that is the correct way to add your SPECIALs. I suggest you save a copy somewhere. I will add it to the next Release (because it refers to a hardware Shield).
Where are you? It is pretty chilly in Wormshill, England today!!