In this article4 sections
- 01 / INPUTA key changes state
- 02 / CONTROLLERThe scanner records an event
- 03 / BUSThe processor reads the event
- 04 / SOFTWAREThe application interprets it
A conceptual event path, not a measured timing diagram or wiring guide.
A small keyboard is a small system
M5Stack's Cardputer-Adv puts a keyboard, display and processor into a compact programmable device. Its documentation identifies a 56-key keyboard, an ESP32-S3-based Stamp-S3A module and a separate TCA8418 keyboard controller. That last component is easy to miss because the reader sees keys and a screen, not the electronics between them.
The controller helps the main processor learn about key activity. Texas Instruments describes the TCA8418 as a keypad scanner with an event buffer and an interrupt output. Those are component capabilities. They are not a measurement of typing speed, battery life, or the behavior of every application running on the handheld.
This article follows the manufacturer's component description and a named library release. We have not operated the device, measured key response or tested a particular firmware image. Treat the diagrams as a model for understanding the roles, not as an electrical wiring plan.
A notification and the data are different things
When a physical key changes state, the scanner can record a key event. An interrupt is a notification that tells the processor something needs attention. It does not have to contain the full explanation by itself; the processor can then communicate with the controller and read the relevant information.
M5Stack's pin map places the keyboard controller on the same I2C data and clock lines used by the audio codec and motion sensor, with a separate interrupt connection. A shared bus is a communication path for several components, not evidence that a keyboard sends audio or motion data as keystrokes.
In the public M5Cardputer 1.2.0 source, the library selects a controller-specific reader when it recognizes Cardputer-Adv. The earlier Cardputer uses a different reader in that code. A familiar product name therefore does not guarantee that a low-level keyboard routine written for one revision will be appropriate for another.
An event log is not the same as a snapshot
Imagine one snapshot with key A held and a later snapshot with key B held. Each snapshot has a count of one, although the identity of the held key is different. An event history could describe the release and the new press, provided the program reads and handles those events. The example is illustrative; it is not a captured test from Cardputer-Adv.
The 1.2.0 library's isChange helper compares the number of currently held keys with the previously recorded count. That is a useful, narrow question. It is not a complete record of everything that happened between checks. Whether a particular application notices a transition depends on how it updates and reads state; static code inspection alone does not demonstrate a missed-key defect.
The same library has separate handling for modifier keys and an Fn layer. That software stage interprets key information after it has been collected. A different firmware or application may use different mappings, so do not treat a library example as proof of what is installed on a device you have never inspected.
Use the distinction in an educational project
A simple project can display the current set of held keys. A different project may need a list of individual presses and releases. Decide which question you want to answer before selecting an API. Record the board model, library version and application version so a later reader can reproduce the same software context.
For any future hands-on comparison, use an owned device and a small, documented example. Note the order in which the application updates the keyboard and reads its state. Treat observed timing or rollover as results of that particular setup, not as specifications established by this article.
- The key, scanner, communication bus and application have different roles.
- An interrupt signals attention; an event supplies information to interpret.
- A held-key count is narrower than a history of key changes.
- Pin the board and library version before comparing behavior.
Continue exploring the Hardware Field Lab →
Sources & further reading
Sources checked .
This is a source-based explainer, prepared with AI assistance and checked against the references above. It is not a hands-on product test. Read our editorial approach.
