Now coding the Stack Touch Panel Driver for Apache RTOS 😬 ... Same I2C Touch Panel as PineTime

github.com/lupyuen/cst816s-nut

Driver for Cypress MBR3108 Touch Controller looks structurally similar to Stack's CST816S ... So we copy-n-paste into our CST816S Driver

github.com/lupyuen/cst816s-nut

Show thread

Stack's CST816S Touch Panel is a peculiar I2C Device ... It won't respond to I2C Scan unless we tap the screen and wake it up!

github.com/lupyuen/cst816s-nut

Show thread

Stack's Touch Panel triggers a GPIO Interrupt when we tap the screen ... Here's how we handle the GPIO Interrupt in

github.com/lupyuen/cst816s-nut

Show thread
Follow

Driver for Stack 's Touch Panel responds correctly to touch! 🎉 The touched coordinates are rotated sideways ... But we can fix that later in the ST7789 Display

github.com/lupyuen/cst816s-nut

Touch Screen for Stack feels laggy on Apache RTOS right now ... 2 things we can fix: 1️⃣ Increase SPI Frequency 2️⃣ Switch to SPI DMA eventually

youtube.com/shorts/2Nzjrlp5lcE

Show thread

LVGL Test App calls read() repeatedly on Stack's Touch Panel Driver to get Touch Data ... But it should call poll() instead to block on Touch Data 🤔

github.com/lupyuen/cst816s-nut

Show thread

Touch Coordinates read over I2C from Stack Touch Panel ... Are returned unchanged to the LVGL Test App as a Touch Down Event

github.com/lupyuen/cst816s-nut

Show thread

But for Touch Up Events the Touch Coordinates are invalid ... Our Stack driver patches the Touch Coordinates with the data from the last Touch Down Event

github.com/lupyuen/cst816s-nut

Show thread

Our Driver for Stack Touch Panel won't return any valid Touch Data unless we enable I2C Logging ... Could be an I2C Timing Issue or Race Condition 🤔

github.com/lupyuen/cst816s-nut

Show thread

Stack's Touch Panel will trigger a GPIO Interrupt when touched ... Here's how we handle the interrupt on Apache RTOS

lupyuen.github.io/articles/tou

Show thread
Show more
@lupyuen you need to instrument the board with a low speed oscilloscope, you'll be able to observe timing errors
@lupyuen it could be a bit of a problem if it's intermittent but if you get fancy with triggers you might be able to observe the problem. Like you could enable recording and also use a gpio to send a pulse to the oscilloscope's trigger input when the system detects a problem maybe
Sign in to participate in the conversation
Qoto Mastodon

QOTO: Question Others to Teach Ourselves. A STEM-oriented instance.

An inclusive free speech instance.
All cultures and opinions welcome.
Explicit hate speech and harassment strictly forbidden.
We federate with all servers: we don't block any servers.