Skip to content

Commit b803769

Browse files
JeuneseRPimudge
authored andcommitted
Added 5-inch info and updated structure and content of the Touch Display 2 page.
1 parent a08e5b9 commit b803769

File tree

2 files changed

+157
-69
lines changed

2 files changed

+157
-69
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ build-pico-sdk-docs
55
documentation/html
66
documentation/asciidoc/pico-sdk
77
.venv
8+
.env
Lines changed: 156 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -1,136 +1,223 @@
1-
== About
2-
3-
The https://www.raspberrypi.com/products/touch-display-2/[Raspberry Pi Touch Display 2] is a portrait orientation touchscreen LCD display designed for interactive projects like tablets, entertainment systems, and information dashboards.
1+
The https://www.raspberrypi.com/products/touch-display-2/[Raspberry Pi Touch Display 2] is a portrait orientation (with rotation options) touchscreen LCD designed for interactive projects like tablets, entertainment systems, and information dashboards.
42

53
.The Raspberry Pi Touch Display 2
64
image::images/touch-display-2-hero.jpg[width="80%"]
75

8-
The Touch Display 2 connects to a Raspberry Pi using a DSI connector and GPIO connector. Raspberry Pi OS provides touchscreen drivers with support for five-finger multitouch and an on-screen keyboard, providing full functionality without the need to connect a keyboard or mouse.
9-
106
== Specifications
117

12-
* 1280×720px resolution, 24-bit RGB display
13-
* 155×88mm active area
14-
* 7" diagonal
15-
* powered directly by the host Raspberry Pi, requiring no separate power supply
16-
* supports up to five points of simultaneous multi-touch
8+
The Touch Display 2 comes in two sizes, and supports five-point multitouch and an on-screen keyboard, providing full input functionality without the need to connect a keyboard or mouse. This section describes the physical characteristics and capabilities of Touch Display 2, including dimensions, features, and hardware.
179

18-
The Touch Display 2 is compatible with all models of Raspberry Pi from Raspberry Pi 1B+ onwards, except the Zero series and Keyboard series, which lack a DSI connector.
10+
=== Dimensions
11+
12+
The Touch Display 2 comes in two sizes: 5-inch and 7-inch (measured diagonally). Aside from the physical size, these two displays have identical features and functionality. The following table summarises the dimensions of these two displays:
13+
14+
[cols="1,1,1"]
15+
|===
16+
|
17+
|*5-inch display*
18+
|*7-inch display*
19+
20+
|*Depth*
21+
|15 mm
22+
|16 mm
23+
24+
|*Viewing area*
25+
|111 x 63 mm
26+
|155 x 88 mm
27+
28+
|*Active area*
29+
|110 x 62 mm
30+
|155 x 87 mm
31+
|===
32+
33+
=== Features
34+
The Touch Display 2 (both 5-inch and 7-inch) includes the following features:
35+
36+
* **Resolution.** 720 x 1280 pixel resolution.
37+
* **Colour depth.** 24-bit RGB display, capable of showing over 16 million colours.
38+
* **Multitouch.** Supports up to five simultaneous touch points and an on-screen keyboard.
39+
* **Mouse-equivalence.** Supports full desktop control without a physical mouse, for example, selecting, dragging, scrolling, and long-pressing for menus.
40+
* **On-screen keyboard.** Supports a visual keyboard in place of a physical keyboard.
41+
* **Integrated power.** Powered directly by the host Raspberry Pi, requiring no separate power supply.
1942

20-
The Touch Display 2 box contains the following parts (in left to right, top to bottom order in the image below):
43+
=== Hardware
2144

22-
* Touch Display 2
23-
* eight M2.5 screws
24-
* 15-way to 15-way FFC
25-
* 22-way to 15-way FFC for Raspberry Pi 5
26-
* GPIO connector cable
45+
The Touch Display 2 box contains the following parts:
46+
47+
- A Touch Display 2
48+
- Eight M2.5 screws
49+
- A 15-way to 15-way FFC
50+
- A 22-way to 15-way FFC for Raspberry Pi 5
51+
- A GPIO connector cable
52+
53+
The following image shows these items from top to bottom, left to right.
2754

2855
.Parts included in the Touch Display 2 box
2956
image::images/touch-display-2-whats-in-the-booooox.jpg["Parts included in the Touch Display 2 box", width="80%"]
3057

31-
== Install
58+
=== Connectors
59+
60+
The Touch Display 2 connects to a Raspberry Pi using:
61+
62+
- A **DSI connector** for video and touch data.
63+
- The **GPIO header** for power.
64+
65+
To make the DSI connection, use a **Flat Flexible Cable (FFC)** included with your display. The type of FFC you need depends on your Raspberry Pi model:
66+
67+
- For **Raspberry Pi 5**, use the **22-way to 15-way FFC**.
68+
- For all other Raspberry Pi models, use the **15-way to 15-way FFC**.
69+
70+
The Touch Display 2 is compatible with all models of Raspberry Pi from Raspberry Pi 1B+ onwards, except the Zero series and Keyboard series, which lack a DSI connector.
71+
72+
== Connect to Raspberry Pi
73+
74+
After determining the correct FFC for your Raspberry Pi model, you can connect your Touch Display 2 to your Raspberry Pi. After completing the following steps, you can reconnect your Raspberry Pi to power. It can take up to one minute to initialise the Touch Display 2 connection and begin displaying to the screen.
3275

3376
.A Raspberry Pi 5 connected and mounted to the Touch Display 2
3477
image::images/touch-display-2-installation-diagram.png["A Raspberry Pi 5 connected and mounted to the Touch Display 2", width="80%"]
3578

36-
To connect a Touch Display 2 to a Raspberry Pi, use a Flat Flexible Cable (FFC) and a GPIO connector. The FFC you'll use depends upon your Raspberry Pi model:
37-
38-
* for Raspberry Pi 5, use the included 22-way to 15-way FFC
39-
* for any other Raspberry Pi model, use the included 15-way to 15-way FFC
79+
IMPORTANT: Disconnect your Raspberry Pi from power before completing the following steps.
4080

41-
Once you have determined the correct FFC for your Raspberry Pi model, complete the following steps to connect your Touch Display 2 to your Raspberry Pi:
81+
=== Step 1. Connect FFC to Touch Display 2
4282

43-
. Disconnect your Raspberry Pi from power.
44-
. Lift the retaining clips on either side of the FFC connector on the Touch Display 2.
83+
. Slide the retaining clip outwards from both sides of the FFC connector on the Touch Display 2 to secure the cable.
4584
. Insert one 15-way end of your FFC into the Touch Display 2 FFC connector, with the metal contacts facing upwards, away from the Touch Display 2.
46-
+
47-
TIP: If you use the 22-way to 15-way FFC, the 22-way end is the _smaller_ end of the cable. Insert the _larger_ end of the cable into the Touch Display 2.
48-
. While holding the FFC firmly in place, simultaneously push both retaining clips down on the FFC connector of the Touch Display 2.
49-
. Lift the retaining clips on either side of the DSI connector of your Raspberry Pi. This port should be marked with some variation of the term `DISPLAY` or `DISP`. If your Raspberry Pi has multiple DSI connectors, prefer the port labelled `1`.
50-
. Insert the other end of your FFC into the Raspberry Pi DSI connector, with the metal contacts facing towards the Ethernet and USB-A ports.
51-
. While holding the FFC firmly in place, simultaneously push both retaining clips down on the DSI connector of the Raspberry Pi.
52-
. Plug the GPIO connector cable into the port marked `J1` on the Touch Display 2.
53-
. Connect the other (three-pin) end of the GPIO connector cable to pins 2, 4, and 6 of the xref:../computers/raspberry-pi.adoc#gpio[Raspberry Pi's GPIO]. Connect the red cable (5V power) to pin 2, and the black cable (ground) to pin 6. Viewed from above, with the Ethernet and USB-A ports facing down, these pins are located at the top right of the board, with pin 2 in the top right-most position.
54-
+
85+
- If you're connecting to a Raspberry Pi 5, and therefore using the **22-way to 15-way FFC**, the 22-way end is the smaller end of the cable. Insert the larger end of the cable into the Touch Display 2.
86+
- If you're using the **15-way to 15-way FFC**, insert either end of the cable into the Touch Display 2 FFC connector.
87+
. Hold the FFC firmly in place and simultaneously push the retaining clip back in to the Touch Display 2 FFC connector from both sides.
88+
89+
=== Step 2. Connect FFC to Raspberry Pi
90+
91+
. Slide the retaining clip upwards from both sides of the DSI connector of your Raspberry Pi.
92+
- This port should be marked with some variation of the term **DISPLAY** or **DISP**.
93+
- If your Raspberry Pi has multiple DSI connectors, we recommend using the port labelled **1**.
94+
. Insert the other end of your FFC into the Raspberry Pi DSI connector, with the metal contacts facing the Ethernet and USB-A ports.
95+
. Hold the FFC firmly in place and simultaneously push the retaining clip back in on the FFC connector of the Raspberry Pi to secure the cable.
96+
97+
=== Step 3. Connect the GPIO power cable
98+
99+
. Plug the smaller end of the GPIO power cable into the **J1** port on the Touch Display 2.
100+
. Connect the three-pin end of the GPIO power cable to your xref:../computers/raspberry-pi.adoc#gpio[Raspberry Pi's GPIO].
101+
102+
This connects the red cable (5 V power) to pin 2 and the black cable (ground) to pin 6. Viewed from above, with the Ethernet and USB-A ports facing down, these pins are located in the top-right corner of the board, with pin 2 in the top right-most position.
103+
55104
.The GPIO connection to the Touch Display 2
56105
image::images/touch-display-2-gpio-connection.png[The GPIO connection to the Touch Display 2, width="40%"]
57-
+
58-
TIP: If pin 6 isn't available, you can use any other open `GND` pin to connect the black wire. If pin 2 isn't available, you can use any other 5V pin to connect the red wire, such as pin 4.
59-
. Optionally, use the included M2.5 screws to mount your Raspberry Pi to the back of the Touch Display 2.
60-
.. Align the four corner stand-offs of your Raspberry Pi with the four mount points that surround the FFC connector and `J1` port on the back of the Touch Display 2, taking special care not to pinch the FFC.
61-
.. Insert the screws into the four corner stand-offs and tighten until your Raspberry Pi is secure.
62-
. Reconnect your Raspberry Pi to power. It may take up to one minute to initialise the Touch Display 2 connection and begin displaying to the screen.
63106

64-
=== Use an on-screen keyboard
107+
=== Step 4. Mount your Touch Display 2 (optional)
108+
109+
Optionally, use the included M2.5 screws to mount your Raspberry Pi to the back of your Touch Display 2.
110+
111+
. Align the four corner stand-offs of your Raspberry Pi with the four mount points that surround the FFC connector and J1 port on the back of the Touch Display 2.
112+
. Insert the M2.5 screws (included) into the four corner stand-offs and tighten until your Raspberry Pi is secure.
113+
114+
Take care not to pinch the FFC.
115+
116+
== Use an on-screen keyboard
117+
118+
A Raspberry Pi with OS **Bookworm** or later already includes the **Squeakboard on-screen keyboard**. With a Touch Display 2 is attached, the keyboard automatically appears when you can enter text, and automatically disappears when you can't.
65119

66-
Raspberry Pi OS _Bookworm_ and later include the Squeekboard on-screen keyboard by default. When a touch display is attached, the on-screen keyboard should automatically show when it is possible to enter text and automatically hide when it is not possible to enter text.
120+
For applications that don't support text entry detection, you can manually show or hide the keyboard using the keyboard icon at the right side of the taskbar. You can also permanently show or hide the on-screen keyboard using the Raspberry Pi graphical interface or the command line:
67121

68-
For applications which do not support text entry detection, use the keyboard icon at the right end of the taskbar to manually show and hide the keyboard.
122+
- **Raspberry Pi desktop interface.** From the Raspberry Pi menu, go to **Preferences > Raspberry Pi Configuration > Display** and choose your on-screen keyboard setting.
123+
- **Command line.** Open a terminal and enter `sudo raspi-config`. Navigate to the **Display** section or `raspi-config` and then choose your keyboard setting.
69124

70-
You can also permanently show or hide the on-screen keyboard in the Display tab of Raspberry Pi Configuration or the `Display` section of `raspi-config`.
125+
== Change screen orientation
71126

72-
TIP: In Raspberry Pi OS releases prior to _Bookworm_, use `matchbox-keyboard` instead. If you use the wayfire desktop compositor, use `wvkbd` instead.
127+
You can change the orientation and coordinate behaviour of the Touch Display 2, both in a desktop environment and without a desktop (“headless”). This is useful if you want to physically rotate the screen or mount it in a landscape position.
128+
You have four rotation options:
73129

74-
=== Change screen orientation
130+
- **0** maintains the default display position, which is a portrait orientation.
131+
- **90** rotates the display 90 degrees to the right (clockwise), making it a landscape orientation.
132+
- **180** rotates the display 180 degrees to the right (clockwise), which flips the display upside down.
133+
- **270** rotates the display 270 degrees to the right (clockwise), which is the same as rotating the display 90 degrees to the left (counterclockwise), making it a landscape orientation.
75134

76-
If you want to physically rotate the display, or mount it in a specific position, select **Screen Configuration** from the **Preferences** menu. Right-click on the touch display rectangle (likely DSI-1) in the layout editor, select **Orientation**, then pick the best option to fit your needs.
135+
=== In a desktop environment
77136

78-
==== Rotate screen without a desktop
137+
If you have the Raspberry Pi OS desktop running, you can rotate the display through the **Screen Configuration** tool:
79138

80-
To set the screen orientation on a device that lacks a desktop environment, edit the `/boot/firmware/cmdline.txt` configuration file to pass an orientation to the system. Add the following entry to the end of `cmdline.txt`:
139+
. Go to **Preferences > Screen Configuration**. This opens the layout editor where you can see your connected displays.
140+
. Right-click the rectangle in the layout editor that represents your Touch Display 2 (likely labelled `DSI-1`).
141+
. Select **Orientation**.
142+
. Choose a rotation: *0°*, *90°*, *180°*, or *270°*. This rotates the display by the specified degrees to the right.
143+
144+
=== In a headless environment
145+
146+
To rotate the display without a desktop, edit the `/boot/firmware/cmdline.txt` file, which contains parameters that the system reads when it boots. Add the following to the end of `cmdline.txt`, replacing `<rotation-value>` with a degree of rotation (`0`, `90`, `180`, or `270`):
81147

82148
[source,ini]
83149
----
84150
video=DSI-1:720x1280@60,rotate=<rotation-value>
85151
----
86152

87-
Replace the `<rotation-value>` placeholder with one of the following values, which correspond to the degree of rotation relative to the default on your display:
153+
You can replace `DSI-1` with the appropriate label if using a different DSI connector.
154+
155+
You can't rotate the DSI display separately from the HDMI display with `cmdline.txt`. When you use DSI and HDMI simultaneously, they share the same rotation value.
156+
157+
== Customise settings
158+
159+
You can use the Device Tree overlay to tell Raspberry Pi how to configure the Touch Display 2 at boot.
160+
161+
- For the 5-inch display, the overlay is called `vc4-kms-dsi-ili9881-5inch`.
162+
- For the 7-inch display, the overlay is called `vc4-kms-dsi-ili9881-7inch`.
88163

89-
* `0`
90-
* `90`
91-
* `180`
92-
* `270`
164+
You can modify the device tree overlay in the boot configuration file (`/boot/firmware/configuration.txt`). This is a more flexible way to control rotation, resolution, and touch behaviour, compared to editing `cmdline.txt`` alone.
93165

94-
For example, a rotation value of `90` rotates the display 90 degrees to the right. `180` rotates the display 180 degrees, or upside-down.
166+
Open `/boot/firmware/configuration.txt` and then add the required device tree parameters to the `dtverlay` line, separated by commas.
95167

96-
NOTE: It is not possible to rotate the DSI display separately from the HDMI display with `cmdline.txt`. When you use DSI and HDMI simultaneously, they share the same rotation value.
168+
- Booleans (`invx`, `invy`, `swapxy`, and `disable_touch`) default to true if present, but you can set them to false using the suffix `=0`.
169+
- Integers (`sizex` and `sizey`) require a number, for example, `sizey=240`.
97170

98-
==== Touch Display 2 device tree option reference
171+
See the table below for details.
99172

100-
The `vc4-kms-dsi-ili9881-7inch` overlay supports the following options:
173+
=== Device Tree options
101174

102175
|===
103-
| DT parameter | Action
176+
| Parameter | Action
104177

105178
| `sizex`
106-
| Sets X resolution (default 720)
179+
| Sets the horizontal resolution (default 720)
107180

108181
| `sizey`
109-
| Sets Y resolution (default 1280)
182+
| Sets the vertical resolution (default 1280)
110183

111184
| `invx`
112-
| Invert X coordinates
185+
| Inverts the X-axis (left/right)
113186

114187
| `invy`
115-
| Invert Y coordinates
188+
| Inverts the Y-axis (up/down)
116189

117190
| `swapxy`
118-
| Swap X and Y coordinates
191+
| Swaps the X and Y axes (rotate 90° logically)
119192

120193
| `disable_touch`
121-
| Disables the touch overlay totally
194+
| Turns off the touchscreen functionality
122195
|===
123196

124-
To specify these options, add them, separated by commas, to your `dtoverlay` line in `/boot/firmware/config.txt`. Boolean values default to true when present, but you can set them to false using the suffix "=0". Integer values require a value, e.g. `sizey=240`. For instance, to set the X resolution to 400 pixels and invert both X and Y coordinates, use the following line:
197+
=== Example
198+
199+
To set X resolution to 400 and invert both axes:
125200

126201
[source,ini]
127202
----
128203
dtoverlay=vc4-kms-dsi-ili9881-7inch,sizex=400,invx,invy
129204
----
130205

131-
=== Installation and software setup on Compute Module based devices.
206+
In the above example:
207+
- `sizex=400` sets the horizontal resolution to 400.
208+
- `invx` flips the X axis.
209+
- `invy` flips the Y axis.
210+
211+
== Connect to a Compute Module
212+
213+
Unlike Raspberry Pi single board computers (SBC), which automatically detect the official Raspberry Pi Touch displays, Raspberry Pi Compute Modules don't automatically detect connected devices; you must tell it what display is attached.
214+
215+
This is because the DSI connector on a Raspberry Pi is fixed and the system knows what hardware is connected; auto-detection ensures that the correct Device Tree settings are passed to the Linux kernel, so the display works without additional configuration.
216+
217+
Compute Modules, intended for industrial and custom applications, expose all GPIOs and interfaces. This provides greater flexibility for connecting hardware, but means that a Compute Module can't automatically detect devices like the Touch Display 2. This means that, for Compute Modules, the Device Tree fragments, which tell the kernel how to interact with the display, must be manually specified. You can do this in three ways:
132218

133-
All Raspberry Pi SBCs auto-detect the official Touch Displays as the circuitry connected to the DSI connector on the Raspberry Pi board is fixed; this autodetection ensures the correct Device Tree entries are passed to the kernel. However, Compute Modules are intended for industrial applications where the integrator can use any and all GPIOs and interfaces for whatever purposes they require. Autodetection is therefore not feasible, and hence is disabled on Compute Module devices. This means that the Device Tree fragments required to set up the display need to be loaded via some other mechanism, which can be either with a dtoverlay entry in config.txt, via a custom base DT file, or if present, a HAT EEPROM.
219+
- By adding an overlay entry in `config.txt`. This is the simplest option. For configuration instructions, see the xref:../computers/compute-module.adoc#attaching-the-touch-display-2-lcd-panel[Compute Module hardware documentation].
220+
- Using a custom base device tree file. This is an advanced method not covered in this online documentation.
221+
- Using a HAT EEPROM (if present).
134222

135-
Creating a custom base Device tree file is beyond the scope of this documentation, however, it is simple to add an appropriate device tree entry via `config.txt`. See this xref:../computers/compute-module.adoc#attaching-the-touch-display-2-lcd-panel[page] for configuration details.
136223

0 commit comments

Comments
 (0)