Custom PCB for ER-TFT028A2-4 IPS TFT Display (ILI9341)

sndsgd

Member
Hey folks, I've been working on a project for a few months now, and I'm trying to polish the hardware a bit in a new iteration.

Currently I'm using a Teensy 4.1 along with the Color 320x240 TFT Touchscreen, ILI9341 Controller Chip display purchased from PJRC. While the combo is performing well, I'd like to move to an IPS display to improve the viewing angle as I'm finding myself hunching over to stare down at the current display.

After realizing that the Dirtywave M8 is teensy powered, runs an ILI9341 display and has a much improved viewing angle, I popped it open to see what part it uses and I found the ER-TFT028A2-4. So I ended up ordering two from buydisplay.com, and had some time to look over the datasheet today. While I'm aiming to have a PCB similar to the one I currently have made (with the ER-TFT028A2-4 and minus the SD card + touch components), I think I'm probably going to make a few mistakes and I'm hoping I can get some guidance to reduce the number of times I need to design, order, wait, build, test, and repeat.

For starters, here are the pins that I'm currently using:
Code:
#define DISPLAY_PIN_CS         9
#define DISPLAY_PIN_RESET      6
#define DISPLAY_PIN_DC         10
#define DISPLAY_PIN_MOSI       11
#define DISPLAY_PIN_SCK        13
#define DISPLAY_PIN_BACKLIGHT  28
#define DISPLAY_PIN_MISO       12

Here is an example of what I'm doing to set the backlight intensity:
Code:
  void SetBacklightIntensity(uint8_t value) {
    value = ConstrainNumber<uint8_t>(value, 0, 100);
    uint8_t pinValue = 255 * value / 100;
    analogWrite(DISPLAY_PIN_BACKLIGHT, pinValue);
  }
pinMode(DISPLAY_PIN_BACKLIGHT, OUTPUT);
SetBacklightIntensity(15);

Here is the datasheet for the ER-TFT028A2-4.

Here are the pins that I am fairly confident need to be connected:
Code:
CS    -> CS (pin 38)
RESET -> RESET (pin 10)
DC    -> WRX(D/CX) (pin 36)
MOSI  -> SDI (pin 34)
SCK   -> D/CX(SCL) (pin 37)
MISO  -> SDO (pin 33)
GND   -> GND (pins 43, 48-50)
2024-02-28-222349-screenshot.png


I have zero confidence regarding power and backlight connections given that I'm pumping 5v into the display I currently have, and the datasheet for the ER-TFT028A2-4 indicates it's looking for 2.8v-3.3v for VCI/VDDI and 3.2v-3.4v for the backlight leds. Addressing this is my main concern at the moment. I would like to not fry the displays, and maintain the ability to change the backlight intensity using `analogWrite(DISPLAY_PIN_BACKLIGHT, ...)`.
2024-02-28-222458-screenshot.png


As for the interface mode, I believe that I want `4-wire 8-bit data Serial Interface II`, so...
Code:
IM0 -> GND
IM1 -> VCI
IM2 -> VCI
IM3 -> VCI
2024-02-28-222446-screenshot.png


And finally I think all unused pins should be connected to GND.

Hopefully that's not too much info 😰. I'm going to try to start getting something up and running in kicad after I decipher the details in another post on here that seems related: https://forum.pjrc.com/index.php?th...faders-are-moved-teensy-4-1.73803/post-333427. Thanks for taking a look!
 
After mucking around a bit and analyzing the components on the pcb for the non IPS display I already have, I think this schematic summarizes what I need to do:

2024-02-29-130113-screenshot.png


As mentioned before, I'd appreciate any input to confirm whether this looks correct.
 
I have the same displays, and have played a bit with different ways of driving the LEDs.

I have not built it this suggestion yet myself, but (KiCAD/ngspice) simulations show it should work fine at up to 10 kHz PWM.

The idea is to use a low-drop adjustable linear regulator like TLV75801P as a current regulator (cheap, good, and available at Mouser, LCSC, JLCPCB, etc.). The LEDs are connected between VOUT and FB. The current is set to 78.5mA by a single 0.55V/0.0785A ≃ 7Ω resistor between FB and ground. One 16V X7R 1µF ceramic capacitor is between VOUT and GND, and another between VIN and GND. EN pin has a pull-down resistor of say 10kΩ to ground, and is connected to the Teensy PWM output pin (so it defaults to backlight off, until Teensy enables it). VIN is connected to 5V input.

For practical purposes, I do recommend having two 0603/0805 sized resistor pads for the 7Ω resistor, so one can use two 14-15Ω to fine-tune it. It/they should drop 0.55V, and generate about 0.045W = 45mW of heat (not much). The regulator will dissipate between 44mW and 156mW of heat: 44mW at VIN=4.5V if the LED forward voltage is 3.4V, 156mW at VIN=5.5V if the LED forward voltage is only 3.0V. The total dissipated heat is between 90mW to 200mW. (The heat dissipated by the backlight LEDs is between 235mW and 267mW, depending on what their forward voltage happens to be. The total power draw is of course the 80mA at 4.5V to 5.5V, or 360mW to 440mW.

I don't like to drive the backlight that hard (even my computer displays stay under 25% brightness), so I'd prefer a 7.68Ω resistor instead (corresponds to 71.6mA backlight LED current). You could also use a 7Ω fixed resistor, followed by a 100Ω potentiometer (one end and wiper connected in series with the 7Ω resistor, to control the current between 78mA (7Ω) down to 5.1mA (107Ω). If you let the user fiddle with it, use a log or audio taper potentiometer. The maximum dissipation in these resistors is 45mW or 1/22th of a watt. (As the resistance grows, the regulator reduces the current, so that at 107Ω, the current is down to 5.1mA, and only 3mW is dissipated in the resistors.)

I really dislike flicker, so even though it will impact color reproduction (because these backlight LEDs are truly "white" only when driven near the nominal current), I'm leaning towards using a TI AD5821 current-sinking DAC. Basically, it is connected to the LEDK, and LEDA1-LEDA4 are connected to 5V, optionally via a 7Ω or smaller resistor. The DAC needs about 0.5V of headroom to control the voltage to up to 80mA, with minimum current around 3mA, but with a power-down feature. That is, the LEDs can be turned off, but brightness control is limited to 3mA – 80mA (although it can sink more). It is controlled via I²C, and can set the current in 120mA/1024 ≃ 0.117mA steps. It ought to work, but this too is still untested.
 
I have an update on this: the pcb I ordered from my first pass at the schematic appears to work correctly! I ended up adding some jumper pads for IM* pins in case I had chosen the incorrect interface mode, but it seemed to work when I soldered it up to match the schematic.

render-back.png
render-front.png


A couple of notes for anyone following this and attempting to replicate:
- the resistor value I chose for the LEDA* in the original schematic is too high. I chose the value based on the resistor I saw on the display I purchased from PJRC, but after crunching the numbers it looks like it should be 1.25Ω instead of 8.2Ω.
- by default the colors appear to be inverted. While I'm unsure if I've done something incorrectly, issuing the command to invert the display during initialization yields the correct colors.
- hand soldering the 50 pin zif connector was not a fun experience.
- it's worth making some space for the components on the connector cable by removing more of the pcb at the bottom:
render-front-cutout.png


Here is a picture the non ips display (left), and the ER-TFT028A2-4 on my pcb (right) running the dual display example from the ili9341_t4 library on a teensy 4.1:
2024-03-18-103357-screenshot.png


Here is the schematic one more time, with the reference designators assigned, and the pinout changed to simplify routing on the pcb:
2024-03-18-104342-screenshot.png


When I receive the new backlight resistor I'll report back to confirm whether it works as expected.
 
Back
Top