8-bit|16-bit parallell ILI9341

External hardware connected to the STM32 board
konczakp
Posts: 191
Joined: Thu Jul 14, 2016 4:17 pm

Re: 8-bit|16-bit parallell ILI9341

Post by konczakp » Sat Oct 08, 2016 7:03 pm

Because there is not such a thing described over the internet (or I couldn't find it) I will write what I have accomplished. I have sacrificed 8-) 2 of my screens to check how can I connect the led control. I've checked one cheaper and one more expensive. Both were bought on the ebay. First about the cheaper. It was KeDei as I mentioned before. Desoldering the voltage regulator and supplying 3.3v instead didn't change anything. It was even worse. I think this is because voltage regulator on board can give more current then directly connected 3.3v from the maple mini. This screen in my opinion has inappropriate designed connections and that is why it is blinking. Screen should have three +3.3v wires connected only for powering the screen but in this case it has only two. I'm not counting led power supply. I'm deducting this from the other screen which is not blinking and which is similar to this one and it has 3 power supply. Blinking will be not noticeable if there is no sd card used. There is also something messed up with other connections because without supplying +5v to the screen it should not be working because it lack main power supply and it saturates power from other pins somehow. But it works and this is weird.
Let's get back to LED on/off. With this screen I would have to cut the bold path (see magnified section) and solder a tiny wire to make a control via PNP transistor. In way that was described before. This will allow me to switch on/off backlight leds but it will still be blinking because of the sd card. Second problem is not to break the screen while disassembly :D They have used a lot of tape to connect the screen with the board. So do it on Your own risk
TFT.jpg
TFT.jpg (134.31 KiB) Viewed 578 times
Now the expensive one :D I have disassembled it also and I discovered that this screen is easy to drive the led on/off. It has build in resistor connecting the leds to the ground. And there is no need to disassembly it from the board. Simply remove the the resistor and add NPN transistor to it. To the right pad not the left because the left is a gnd pad (It's easy to check of course) . And that's it. Screen is working without blinking ( as I mentioned before this screen has connected 3 power supply and is not working without +5 power supply on the breadboard pin). Both screen has no connection to the 3.3v power supply on the breadboard. This screen is not marked by any vendor in this case. But search for the screen with this pin traces as showed on the screen. Moreover the more expensive one is really better because black color is really black and it has wider angle of view.
I hope this will help someone with the same problem which I had.
tft2.jpg
tft2.jpg (214.57 KiB) Viewed 578 times
And now there is still one more question. Can some one provide properly working circuit for the NPN transistor to drive the led on/off? Is it possible to drive the NPN transistor with PWM to change brightness of the led?
Thanks

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

Re: 8-bit|16-bit parallell ILI9341

Post by stevestrong » Sat Oct 08, 2016 8:21 pm

I have exactly the same display as your expensive one (second picture). It has ili9328 driver chip.
Thanks for dicovering the backlight control possibilty, i may use it later some time.

User avatar
Pito
Posts: 1739
Joined: Sat Mar 26, 2016 3:26 pm
Location: Rapa Nui

Re: 8-bit|16-bit parallell ILI9341

Post by Pito » Sat Oct 08, 2016 8:59 pm

Can some one provide properly working circuit for the NPN transistor to drive the led on/off? Is it possible to drive the NPN transistor with PWM to change brightness of the led?
..for example the NPN low side switch in the schematics below. There is no other better circuit, afaik..
http://www.stm32duino.com/viewtopic.php ... 220#p18680
Low at PC12 switches LEDs off, 3.3V High switches LEDs on. Simply cut off the gnd side trace of the LED's resistor on the board, and wire the gnd side of the resistor to the collector of the NPN transistor. What value of the resistor they use on the board?
If you want to use fast PWM you may decrease the R1 and R2 to say 3k3.
Pukao Hats Cleaning Services Ltd.

konczakp
Posts: 191
Joined: Thu Jul 14, 2016 4:17 pm

Re: 8-bit|16-bit parallell ILI9341

Post by konczakp » Mon Oct 10, 2016 6:52 pm

8-) It's working!
TFT screen had 2.2 Ω but I've changed it to 5 Ω so in this circuit instead 100 Ω I gave 5 Ω and it's working perfectly!

User avatar
ahull
Posts: 1729
Joined: Mon Apr 27, 2015 11:04 pm
Location: Sunny Scotland
Contact:

Re: 8-bit|16-bit parallell ILI9341

Post by ahull » Mon Oct 10, 2016 7:24 pm

I suspect that 2.2 Ω is far too high for your voltage regulator to cope with, it would allow a maximum current of around 1.5A to flow through the LEDs, assuming white LEDs that drop nearly the full 3.3V which (assuming there are 4 LEDs) may allow 375mA per LED (or even more through an individual LED if they are not well matched).

Even 5 Ω sounds a little excessive, have you tried measuring the current through your 5 Ω resistor, I suspect it will be of the order of 660 mA. All of this assumes there is no other current limiting resistor of course, which seems likely given the boards tendency to brown out the PSU. I would think that 22 Ω might be a more sane value as this would limit the per LED current to around 40mA and a potential maximum of around 165mA if things go a little pear shaped and one LED fails short circuit.

If you cannot measure the current through the resistor directly, measure the voltage drop across it, and fire it through Ohms law (I=V/R)

EDIT: In all of the above, I am assuming a perfect transistor, and the driver transistor turns fully on, and that the LED voltage is typical of a white LED, somewhere between 3.0 and 3.3V.

There are issues with these assumptions, and with driving four LEDs in parallel from one resistor. It will normally work, but there is a much higher risk of popping one, or all of them (due to thermal runaway of one over driven LED), if you drive them hard, than there would be if there were a current limiting resistor per LED.

Even if you are driving them with PWM, if the resistor value is too low, you still risk brown out of your PSU thus causing the LEDs to flicker and/or the CPU to crash. Also if you drive the voltage regulator too hard or cause the LEDs to start to break down by overheating you may release the magic smoke from both the LEDs and the regulator.

If you drive the LEDs without the transistor (using short On, long Off PWM pulses and a suitable single resistor), this may work, but you risk blowing up the GPIO pin if your chosen resistor allows more than the maximum GPIO current if the LED fails short circuit. :( You wont be able to drive them as hard, without the transistor of course.
I am also assuming four LEDs, there may only be two, in which case... we need to do the maths for two. :roll:

EDIT2: I have just spotted that whoever designed the actual display knew what they were doing, as they have brought out all four LED cathodes, to allow for four current limiting resistors. A much saner option than paralleling up all four LEDs, but the shield designer has cheaped out by wiring the cathodes together, thus limiting your option to only one current limiting resistor.
- Andy Hull -

User avatar
ahull
Posts: 1729
Joined: Mon Apr 27, 2015 11:04 pm
Location: Sunny Scotland
Contact:

Re: 8-bit|16-bit parallell ILI9341

Post by ahull » Tue Oct 11, 2016 9:35 am

Interestingly that first screen with the display flipped over has a 2013 date code on it, I wonder what devices these are recovered from. I guess they could be "surplus" stock, but its more likely they come from a particularly popular consumer device, most probably a previous generation phone. Maybe I should ask my local phone repair shop if they recognise the screen. :D
- Andy Hull -

konczakp
Posts: 191
Joined: Thu Jul 14, 2016 4:17 pm

Re: 8-bit|16-bit parallell ILI9341

Post by konczakp » Tue Oct 11, 2016 5:18 pm

I've just measured the current between resistor and tft led. Highest current I have seen is 25,33mA. Is that okey?

User avatar
ahull
Posts: 1729
Joined: Mon Apr 27, 2015 11:04 pm
Location: Sunny Scotland
Contact:

Re: 8-bit|16-bit parallell ILI9341

Post by ahull » Wed Oct 12, 2016 12:19 am

konczakp wrote:I've just measured the current between resistor and tft led. Highest current I have seen is 25,33mA. Is that okey?
That sounds pretty reasonable to me. How bright is the display? If the thing is bright and clear, then there is no point in driving it any harder. Increasing current through the LEDs may not proportionally increase brightness there is usually a sweet spot where the LED is running at its most efficient in terms of brightness vs energy wasted as heat, Heat is produced both by the LEDs and the current limiting resistor. Light producing efficiency tends to peak then drop off as the LED junction temperature increases, so the LED gets brighter, as current increases, but not in a linear manner. Once you push things beyond the LED's rated limit, things tend to go south pretty quickly and the magic smoke appears.

I would think that the LEDS can probably comfortably handle 20mA to 30mA per LED, so since they are in parallel, I would think that 100mA to 120mA total would be fairly typical for full brightness.

However there is no point in driving the LEDS at full toot, unless you have to, since they will last a lot longer if driven well with their spec, rather than at their maximum.

When running projects on battery, lowering the LCD backlight brightness is one of the simplest ways to extend battery life, this is why most mobile phones dim, then switch off the backlight as soon as they can.

100mA is roughly what the STM32 is drawing at full speed, so a backlight can be at least as big a current hog as the CPU if you are not careful.
- Andy Hull -

konczakp
Posts: 191
Joined: Thu Jul 14, 2016 4:17 pm

Re: 8-bit|16-bit parallell ILI9341

Post by konczakp » Wed Oct 12, 2016 7:05 am

Screen is bright enough so I will stick to this 5 Ω. Thank You for Your help. I really appreciate that :)

User avatar
Pito
Posts: 1739
Joined: Sat Mar 26, 2016 3:26 pm
Location: Rapa Nui

Re: 8-bit|16-bit parallell ILI9341

Post by Pito » Wed Oct 12, 2016 8:47 am

Increasing current through the LEDs may not proportionally increase brightness
As the first LEDs appeared in seventies the rule was 20mA. They were all red, with Vf something like 1.6V and with 5V all used 150 to 200ohm.
Interestingly, the majority of designers especially of cheapo boards are following this 200ohm paradigm (or 10-20mA per LED), even today.
I did a measurement on about 20 various LEDs (mostly smd ones, all colors) from my junkbox to see how much current you need today in order to have an LED as "the indicator" of ON/OFF. The most LEDs are fine with 0.1mA for normal usage as indicator of a state. That leads to resistors of many kiloohms value. The clever designers adopted 1k resistors recently, but still the brightness is so high that in the ambient conditions you cannot see the buttons because of the brightness of the LEDs on the pcb :)
The LEDs differ significantly in the Vf and in If/brightness so the measurement is the only way to have an idea on the current vs. required brightness. If OP would experiment he sees the display works fine with maybe 10mA or less :)
Pukao Hats Cleaning Services Ltd.

Post Reply