Reset the Elecrow's GT911 the way Elecrow's own V3.0 example does (0.2.96, firmware 0.2.82)
The 2 ms reset of ESPHome's expander support (0.2.81) left the chip silent: "Calibration error" with the PCA9557 answering at 0x18. A component of smart_display's (elecrow_touch_reset.h, setup priority 700: after the I2C bus, before the GT911 driver) writes the expander as Elecrow's V3.0 ESPHome example does: every pin an output and low, 20 ms, the reset released, 100 ms, the interrupt line back to an input. The driver's reset and interrupt pins are gone.
This commit is contained in:
+7
-6
@@ -41,12 +41,13 @@ suits a screen that stands further away.
|
||||
|
||||
The GT911 is polled every 20 ms over I2C at 400 kHz. The **V3.0** has a PCA9557 I/O expander (I2C 0x18) on the
|
||||
GT911's reset (IO0) and interrupt (IO1) lines, and a unit tested here kept its GT911 in reset until something drove
|
||||
them (`touchscreen is marked FAILED: Calibration error` in the log, firmware 0.2.79 and 0.2.80). The board file
|
||||
(firmware 0.2.81) declares the expander as ESPHome's `pca9554` (the same register map) and hands the GT911 driver its
|
||||
reset and interrupt pins on it: the driver runs Elecrow's own sequence, reset low with the interrupt line low, reset
|
||||
high, then 56 ms, which also fixes the address at 0x5D. A V2.0 board without the expander boots its GT911 by the
|
||||
pull-up as before; the expander's setup fails there, harmlessly, and the driver tries 0x14 by itself when 0x5D does
|
||||
not answer, so no address override is ever needed.
|
||||
them (`touchscreen is marked FAILED: Calibration error` in the log, firmware 0.2.79 to 0.2.81; 0.2.81 tried ESPHome's
|
||||
own expander support, whose 2 ms reset pulse the chip ignored). `smart_display: elecrow_touch_reset` (firmware 0.2.82,
|
||||
`components/smart_display/elecrow_touch_reset.h`) runs the sequence of Elecrow's V3.0 ESPHome example before the
|
||||
driver looks for the chip: every expander pin an output and low (the reset held, the interrupt line low so the chip
|
||||
takes address 0x5D), 20 ms, the reset released, 100 ms, the interrupt line back to an input. The log says `GT911 reset
|
||||
through the PCA9557`. A V2.0 board without the expander boots its GT911 by the pull-up as before (the writes fail, the
|
||||
log says so), and the driver tries 0x14 by itself when 0x5D does not answer, so no address override is ever needed.
|
||||
|
||||
The bus is scanned at boot. For a diagnosis, give the screen `logger: level: DEBUG` in its Override YAML (Screen
|
||||
settings → Override YAML) and read its log: the scan lists 0x18 (the expander) and 0x5D or 0x14 (the GT911), and the
|
||||
|
||||
Reference in New Issue
Block a user