Start here: match the symptom
Symptom | Most likely cause | Go to |
|---|---|---|
Nothing at | Normal for this chip when nobody is touching it; otherwise power or reset | Step 1 |
Driver fails at start-up with a chip-ID or probe error | The driver reads the ID while the chip is not answering | Step 2 |
Chip is found, but no touch events arrive | Interrupt pin not wired, wrong edge, or the driver only reads on interrupt | Step 3 |
Touch works, then stops answering between touches | Auto sleep | Step 4 |
Touches land in the wrong place, mirrored or rotated | Axis swap or mirror settings, or a read that starts at the wrong register | Step 5 |
Chip ID is not what the driver expects | A different CST8xx variant on the board | Step 6 |
The register addresses and timings below come from four open drivers: the Linux hynitron-cst816x driver, Espressif's esp_lcd_touch_cst816s component, ESPHome's cst816 component and the fbiego CST816S Arduino library. Links are in the Sources section. For the register map itself see our CST816S page.
1. An empty I2C scan is often normal
The CST816S uses 7-bit I2C address 0x15. Unlike most touch controllers, it does not answer all the time. Espressif's README puts it this way: the chip "only responds to I2C commands after an event, such as a touch detection. Do not expect it to respond on init." After a touch it asserts its interrupt line and answers I2C reads for a short time.
So before changing any wiring:
- Run the I2C scanner again while a finger is on the glass.
- If
0x15appears only while touching, the chip, power and bus are fine. Go to Step 2. - If it never appears, check the supply at the display connector, the pull-ups on SDA and SCL, and the reset line. Reset is active low: a reset pin that is left low, or driven by the wrong GPIO, keeps the chip silent.
On boards where the touch controller shares the bus with another device, a scan that finds the other device proves the bus works. On the Waveshare ESP32-S3-Touch-LCD-1.28, for example, the IMU sits on the same SDA 6 / SCL 7 pair.
2. Start-up fails on the chip ID
Most drivers read the chip ID from register 0xA7 right after reset. If the chip is not answering at that moment, start-up fails even though the hardware is good. Each stack has a switch for this:
Stack | What it does at start-up | How to skip the ID read |
|---|---|---|
ESPHome | Reads | |
ESP-IDF | Reads | Set |
fbiego CST816S (Arduino) | Reads the version registers but does not check the result | Nothing to change |
Linux | Does not read an ID at probe | Nothing to change |
ESPHome's documentation says skip_probe "may be required for some variants (e.g. CST816S) that do not respond to i2c commands except after touches are registered". Espressif's README adds that for some chips reading the ID may cause initialization to fail.
Reset timing used by each driver
If your own code resets the chip, use timings at least as long as a driver that is known to work:
Driver | Reset low for | Wait after release |
|---|---|---|
Linux | 50 ms | 100 ms |
Espressif | 200 ms | 200 ms |
fbiego CST816S | 5 ms | 50 ms |
ESPHome | 5 ms | 30 ms |
The reset pin is optional in the Linux, Espressif and ESPHome drivers. If the board ties reset to another line, such as the LCD reset, leave it unset in the touch driver so the display is not reset a second time.
3. Found, but no touch events
Check the interrupt pin first
The four drivers treat the interrupt line differently, and this is the most common reason for "detected but dead":
Driver | Interrupt pin | Edge |
|---|---|---|
Linux | Required: probe fails with | From the device tree |
fbiego CST816S | Required in practice: | Passed to |
ESPHome | Optional; without it the component polls | Falling edge |
Espressif | Optional; falling edge when | Set by |
With the fbiego library, a wrong IRQ pin number gives exactly this symptom: begin() succeeds, and available() never returns true.
Polling has a catch
Because the chip only answers for a short time after a touch, a polling loop sees failed I2C reads between touches. That is expected. Do not treat one failed read as a fatal error, and do not re-initialise the bus on every failure.
Espressif's README notes a second effect: reading the data several times during one event returns the last sampled position. If you poll faster than the chip samples, you get repeated points, not new ones.
ESPHome writes one register after start-up
After the ID check, ESPHome writes 0x70 to register 0xFA, which its source names the interrupt control register with the "motion" bits enabled. If your own driver behaves differently from ESPHome on the same board, compare what you write to 0xFA with ESPHome's value.
4. Touch works, then the chip stops answering
The CST816S goes to sleep on its own. The fbiego library exposes the registers involved:
Register | Use in the fbiego library |
|---|---|
| Auto sleep: writing a non-zero value disables it, |
| Auto sleep time, in seconds |
| Writing |
ESPHome's source lists the same 0xFE register as "disable auto sleep" and a sleep register at 0xE5.
If you need to read registers at any time, for example to poll without an interrupt, write a non-zero value to 0xFE once the chip is awake. The write itself has to happen while the chip is answering: right after reset, or during a touch. The fbiego library's own sleep routine works the same way: it pulses reset first, then writes the register.
5. Touches land in the wrong place
Know which register your read starts at
The drivers start their read at different registers, and a hand-written driver that mixes two of them is off by one byte:
Driver | Read starts at | Bytes | Where X and Y are |
|---|---|---|---|
ESPHome | | 13 | Finger count at index 2, X at 3–4, Y at 5–6 |
Linux | | 6 | Gesture, finger count, then X and Y |
fbiego CST816S | | 6 | Same layout as Linux |
Espressif | | 5 | Finger count, then X and Y |
In every driver X and Y are 12-bit: the low 4 bits of the high byte, then the low byte. If your X jumps by 256 or 4096, the high-nibble mask is missing.
Swap and mirror
The chip reports coordinates in the panel's native orientation. When the display is rotated in software, the touch has to follow:
- ESP-IDF: set
swap_xy,mirror_xandmirror_yin theflagsofesp_lcd_touch_config_t, and setx_maxandy_maxto the panel resolution. - ESPHome: use the
transformoptions of the base touchscreen component. If you set no calibration, thecst816component takes the raw range from the display's native width and height. - Arduino with LVGL: apply the same rotation in the read callback that you applied to the display.
Change one setting at a time and test the four corners.
One finger only
The CST816S reports a single finger plus a gesture code. Espressif's driver caps the point count at 1. Pinch and two-finger gestures are not available with this controller.
6. Check which chip is actually fitted
Boards sold with "CST816" touch carry several different parts. ESPHome's source recognises these IDs from register 0xA7:
Chip | ID |
|---|---|
CST816S | |
CST816T | |
CST816D | |
CST820 | |
CST716 | |
CST826 (0x11) and CST836 (0x13) return 0 at 0xA7, and ESPHome reads their ID from 0xAA instead.
A driver that accepts only one ID rejects a board that works fine with another. Public configurations for the same board can also disagree: for the capacitive ESP32-2432S024, one project names the controller CST816S and another CST820, both at address 0x15. Read the ID during a touch and compare it with the table before deciding the board is faulty.
Touch pins on common boards
Board | SDA | SCL | INT | RST | Notes |
|---|---|---|---|---|---|
6 | 7 | 5 | 13 | Bus shared with the QMI8658 IMU | |
33 | 32 | 21 | 25 | CST816S or CST820, depending on the source | |
18 | 17 | 16 | 21 | CST816-series; early units used a CST328 at |
The sources for each row are on the linked board page.
Still stuck
- Run the board vendor's own touch demo. If it works, the hardware is good and the problem is in your configuration.
- If touches appear that nobody made, see the ghost-touch notes on our CST816S page.
- For a round 1.28″ display with this controller, our GC9A01 round display guide covers the display side.
Frequently asked questions
Why does my I2C scanner not find the CST816S?
The CST816S only answers on I2C for a short time after a touch event, so a scan at boot usually finds nothing at 0x15. Run the scan while touching the screen. If it still does not appear, check power, the SDA and SCL pull-ups and that the reset pin is not held low.
How do I fix “Failed to read chip ID” for the CST816S in ESPHome?
Add skip_probe: true to the cst816 touchscreen entry. ESPHome then skips reading the chip ID at start-up, which fails on variants that do not answer I2C until they are touched.
The CST816S is detected but I get no touch events. What should I check?
Check the interrupt pin. The Linux driver will not probe without one, and the fbiego Arduino library only reports a touch after its interrupt handler has run, so a wrong IRQ pin gives a driver that starts but never reports. ESPHome and Espressif's driver can poll without an interrupt.
Why does the CST816S stop responding between touches?
It goes to sleep automatically and only answers again after the next touch. Failed reads between touches are expected. To keep it awake, write a non-zero value to register 0xFE while the chip is answering, for example right after reset.
Sources
- Espressif ESP-BSP: esp_lcd_touch_cst816s README (commit fb5714e0)
- Espressif ESP-BSP: esp_lcd_touch_cst816s.c (commit fb5714e0)
- ESPHome: cst816_touchscreen.cpp (commit 0054041d)
- ESPHome: cst816_touchscreen.h, register and chip-ID constants (commit 0054041d)
- ESPHome documentation: CST816 touchscreen (skip_probe)
- Linux kernel: drivers/input/touchscreen/hynitron-cst816x.c (commit 666539ee)
- fbiego/CST816S Arduino library: CST816S.cpp (commit 11fe1fba)