Skip to content

How to wire a 5 inch 1080x1080 round display to a microcontroller?

By admin· · GazBming

How to Wire a 5 Inch 1080x1080 Round Display to a Microcontroller

To wire a 5 inch 1080x1080 round display to a microcontroller, you need to handle a MIPI DSI interface with a resolution of 1080x1080 pixels, which is non-standard for most hobbyist microcontrollers like Arduino or ESP32. The display in question, typically driven by an HX8399 controller, requires a minimum of 4-lane MIPI DSI, a backlight driver, and a touch controller if included. The physical wiring involves connecting 24 to 30 pins, depending on the exact model, and you must use a microcontroller that supports MIPI DSI natively, such as the Raspberry Pi Compute Module 4, the STM32MP1 series, or a high-end FPGA board. For a practical start, you can use a Raspberry Pi 4 or 5, which has a 2-lane MIPI DSI interface, but for 1080x1080 at 60 Hz, you need 4 lanes, so you will need to adapt using a DSI bridge chip like the TC358870XBG or use a custom board like the Waveshare RP2040-based MIPI driver. The key is to match the voltage levels: the display logic runs at 1.8V, while the backlight and touch typically run at 3.3V or 5V. You will need a level shifter for any 5V logic signals. The connector is usually a 0.5mm pitch FPC, so you need a breakout board or a custom PCB. I recommend using a pre-assembled module like the 5 inch 1080x1080 round tft display from DisplayModule, which includes a 40-pin FPC with a known pinout. Let me break down the wiring step by step with specific data.

Understanding the Display Interface
This round display uses a 4-lane MIPI DSI interface, which is common in smartphones but rare in DIY microcontrollers. The HX8399 driver IC supports up to 1080x1080 resolution at 60 FPS with 24-bit color depth. The MIPI DSI standard requires differential pairs for clock and data lanes, so you need to route these as 100-ohm differential impedance traces. The pinout typically includes: 4 data lanes (D0P, D0N, D1P, D1N, D2P, D2N, D3P, D3N), one clock lane (CLKP, CLKN), plus power (VDD 1.8V, VDDIO 3.3V), backlight (LEDA, LEDK), reset (RST), and touch (if I2C). The total pins are around 30 to 40. For the DisplayModule version, the FPC pinout is documented: pin 1 is GND, pin 2 is D0P, pin 3 is D0N, and so on. You can find the exact mapping in their datasheet. The backlight requires 6 to 8 LEDs in series, each with a forward voltage of 3.0V to 3.2V, so you need a constant current driver of 20mA to 30mA, typically driven by a 12V boost converter. The touch controller uses I2C at 3.3V, with addresses 0x38 or 0x41 depending on the chip.

Microcontroller Selection
Most Arduino boards lack MIPI DSI support. The Arduino Due or Portenta H7 can handle some parallel RGB, but not MIPI. The ESP32-S3 has a parallel interface but no MIPI. The Raspberry Pi 4 has a 2-lane MIPI DSI, which can run 1080x1080 at 30 Hz, but for 60 Hz, you need 4 lanes. The Raspberry Pi 5 has a 4-lane DSI, but it uses a different connector (15-pin FPC). The STM32MP157 has a 4-lane DSI, and you can use the STM32MP157F-DK2 board. The NXP i.MX8M Mini also has 4-lane DSI. For a low-cost option, use a Raspberry Pi 4 with a DSI to HDMI bridge, but that adds latency. The best bet is the Waveshare RP2040-based MIPI display driver board, which has a 40-pin FPC connector and runs MicroPython. It supports 4-lane DSI at 1080x1080. The wiring is straightforward: connect the FPC to the board, then power the board with 5V USB-C. The RP2040 handles the MIPI timing via a custom PIO state machine, but it requires careful configuration. The datasheet for the RP2040 shows that the PIO can generate DSI signals at 500 Mbps per lane, sufficient for 1080x1080 at 60 Hz (which needs about 1.2 Gbps total).

Wiring Diagram and Pin Mapping
Here is a table for the typical wiring between the display and a Raspberry Pi 4 (using a 2-lane DSI adapter, but you can extend to 4 lanes with a custom board). Note that the Raspberry Pi 4 only has 2 lanes, so you will only get 30 Hz refresh. For 4 lanes, use the Raspberry Pi 5 or a custom board.

Display Pin Function Raspberry Pi 4 Pin (DSI Connector) Voltage
1 GND GND 0V
2 D0P (Data Lane 0 Positive) DSI_D0P (GPIO 10) 1.8V differential
3 D0N (Data Lane 0 Negative) DSI_D0N (GPIO 11) 1.8V differential
4 D1P (Data Lane 1 Positive) DSI_D1P (GPIO 12) 1.8V differential
5 D1N (Data Lane 1 Negative) DSI_D1N (GPIO 13) 1.8V differential
6 CLKP (Clock Positive) DSI_CLKP (GPIO 14) 1.8V differential
7 CLKN (Clock Negative) DSI_CLKN (GPIO 15) 1.8V differential
8 VDD (1.8V) 3.3V via level shifter 1.8V
9 VDDIO (3.3V) 3.3V 3.3V
10 RST (Reset) GPIO 17 (3.3V) 3.3V
11 LEDA (Backlight Anode) 12V boost converter 12V, 20mA
12 LEDK (Backlight Cathode) GND via current sense 0V
13 Touch SDA GPIO 2 (I2C1 SDA) 3.3V
14 Touch SCL GPIO 3 (I2C1 SCL) 3.3V
15 Touch INT GPIO 4 3.3V
16 Touch RST GPIO 5 3.3V

Note: The Raspberry Pi 4 DSI connector is a 15-pin FPC, but the display uses a 40-pin FPC. You need a breakout board or a custom cable. The DisplayModule board includes a 40-pin to 15-pin adapter for Raspberry Pi. For 4-lane operation, you need a Raspberry Pi 5, which has a 22-pin DSI connector with 4 lanes. The pinout is similar but with additional lanes D2 and D3. The Raspberry Pi 5 DSI pinout: D0P (GPIO 10), D0N (GPIO 11), D1P (GPIO 12), D1N (GPIO 13), D2P (GPIO 14), D2N (GPIO 15), D3P (GPIO 16), D3N (GPIO 17), CLKP (GPIO 18), CLKN (GPIO 19). You must enable the DSI overlay in config.txt: dtoverlay=vc4-kms-dsi-4lane. The backlight driver is critical: the display LEDs have a total forward voltage of 18V to 24V (6-8 LEDs in series), so you need a boost converter like the TPS61165 or a simple constant current LED driver. Set the current to 20mA via a sense resistor. For example, using a 12V supply, the resistor value is 0.6V / 0.02A = 30 ohms. The touch controller is typically a FT6336 or GT911, which uses I2C at 400 kHz. The I2C address is 0x38 for FT6336, and you can read touch data by sending a read command to register 0x02. The touch interrupt pin goes low when a touch is detected, so you can connect it to an interrupt-capable GPIO.

Power Supply Requirements
The display consumes about 250mA at 3.3V for the logic, plus 20mA at 12V for the backlight, total about 1.5W. The microcontroller needs its own power. For a Raspberry Pi 4, use a 5V 3A supply. The backlight boost converter should be powered from the 5V rail, but it will step up to 12V. The efficiency is about 85%, so the 5V current draw for the backlight is 20mA * 12V / 5V / 0.85 = 56mA. Total current from the 5V supply is about 2.5A for the Pi plus 56mA, so a 5V 3A supply is sufficient. For the 1.8V rail, you can use a linear regulator like the AMS1117-1.8 from the 3.3V supply. The 1.8V rail draws about 50mA, so the regulator dissipates (3.3V - 1.8V) * 0.05A = 0.075W, which is fine. The touch controller draws 10mA at 3.3V. The total power is low, but the wiring must be clean to avoid noise on the MIPI lines. Use twisted pairs for the differential signals, or route them on a PCB with a ground plane. The FPC cable should be as short as possible, ideally under 10cm, to reduce signal degradation. The MIPI DSI specification requires a maximum trace length of 20cm for 1 Gbps signals, but longer cables can cause reflections. Use a 0.5mm pitch FPC with 0.3mm trace width for the differential pairs, and maintain a 100-ohm differential impedance. You can calculate the impedance using a PCB calculator like Saturn PCB Toolkit. For a 4-layer PCB, the stackup should be: top layer (signals), ground plane, power plane, bottom layer. The differential pairs should be routed on the top layer with a ground plane underneath. The spacing between the pairs should be at least 3 times the trace width to reduce crosstalk. The clock lane should be shielded by ground traces on both sides.

Software Configuration
Once wired, you need to initialize the display via MIPI DSI commands. The HX8399 controller uses a set of initialization commands sent over the DSI bus. For a Raspberry Pi, you can use the Linux kernel DRM driver with a custom device tree overlay. The overlay should define the display timings: 1080x1080 at 60 Hz, with a pixel clock of 1080 * 1080 * 60 * 1.2 = 84 MHz (including blanking). The HX8399 datasheet specifies the register settings for the round display, including the gamma correction and the round shape. You need to set the display to round mode by writing to register 0xB0 with value 0x00, then 0xB1 with 0x10, etc. The exact sequence is available in the display module's datasheet. For the RP2040, you can use the Pico DVI library, but it is not optimized for MIPI. A better approach is to use the Waveshare RP2040 MIPI board, which comes with a MicroPython library. The library includes a function to send the initialization sequence: display.init(). The touch controller also needs initialization: touch.init() sets the I2C address and enables touch reporting. The touch data is read via I2C: touch.read() returns a list of touch points with x, y coordinates. The x and y range from 0 to 1080, but the round display has a circular active area, so you need to clip the coordinates to a circle. The center of the display is at (540, 540), and the radius is 540 pixels. You can calculate the distance from the center: sqrt((x-540)^2 + (y-540)^2). If the distance is greater than 540, the touch is outside the active area and should be ignored. The touch controller may report ghost touches at the edges, so you need to implement a debounce filter. The typical touch report rate is 60 Hz, so you can poll the touch at 60 Hz. The display refresh rate is also 60 Hz, so you can synchronize the touch and display updates. The frame buffer is 1080 * 1080 * 3 bytes = 3.5 MB, which is large for a microcontroller. The RP2040 has only 264 KB of RAM, so you need to use a double-buffer approach with the MIPI DSI controller's internal buffer. The HX8399 has a 1080x1080x24-bit frame buffer, so you can write to it directly via DSI write commands. The RP2040 can send data in chunks of 512 bytes, so you need to split the frame into 1080 * 1080 * 3 / 512 = 6836 chunks. At 500 Mbps per lane, the total transfer time for one frame is 3.5 MB * 8 bits / (4 lanes * 500 Mbps) = 14 ms, well within the 16.7 ms frame time. The bottleneck is the RP2040's CPU, which needs to generate the data. For a simple image, you can use a lookup table or a precomputed bitmap. For a round display, you can draw a circle by setting pixels inside the circle. The formula for a circle is x^2 + y^2 <= r^2. You can iterate over x from 0 to 1079, and for each x, calculate the y range: y = sqrt(r^2 - (x-540)^2). Then set the pixels in that range to the desired color. This is computationally intensive, so you may want to use a precomputed mask. The mask is a 1080x1080 bitmap with 1 bit per pixel, which is 1080 * 1080 / 8 = 145 KB. This fits in the RP2040's flash memory. You can store the mask in a const array and use it to enable or disable pixels. The mask can be generated by a script on a PC and then compiled into the firmware. The display's round shape also requires a gamma correction for the LED backlight to avoid uneven brightness. The HX8399 has a gamma register that can be adjusted to compensate for the round shape. The typical gamma curve is a power function with exponent 2.2. You can set the gamma values in the initialization sequence. The datasheet provides the default gamma values, but you may need to fine-tune them based on the display's actual brightness. The backlight brightness is controlled by PWM on the LEDA pin. The Raspberry Pi has a PWM output on GPIO 18, which can be used to dim the

Have a drawing ready?

Drop your STEP or IGES file. We'll respond with a DFM-checked quote in under 6 hours — signed off by a named senior machinist, not an algorithm.

Get a Same-Day Quote