Skip to content

TM1638

Titan Micro TM1638 8-digit 7-segment + 8-LED driver ("LED&KEY" module), bit-banged on STB/CLK/DIO.

Live catalog

Prefer labwired_describe with the catalog id over guessing pins or addresses.

Status at a glance

Aspect Status
Catalog id tm1638
Bus 3-wire GPIO (STB, CLK, DIO), LSB first
Address —
Datasheet Titan Micro TM1638 V1.3: §V instructions (5.1–5.3), §VI display register, §IX serial format
Source configs/devices/tm1638.yaml (declarative, no Rust model)
Tier smoke-proven (register-level tests: crates/core/tests/parts_batch5.rs)

Pins / attachment

Pin / net Role
STB stb_pin
CLK clk_pin
DIO dio_pin
K1..K3 (keys) Not modelled

Support matrix

Behavior Status Notes
STB framing, LSB-first bits on CLK↑, no ACK ✅ STB↑ mid-byte abandons it
Data command (auto-increment / fixed), address command, display control ✅
Address ≥ 10H ignored ✅
Artifact: 8 digits (even addresses) + 8 LEDs (odd bit 0) ✅ tm1638_grid
Key reading (chip drives DIO), random power-on RAM, test mode ❌

Stimulus

None.

How to run

  1. Place the part and an MCU in Playground, or add it to a system YAML:
    external_devices:
      - id: "tm1638"
        type: "tm1638"
        connection: "gpio"
        config:
          stb_pin: "PA7"
          clk_pin: "PA8"
          dio_pin: "PA9"
    
  2. Agent: labwired_list → labwired_describe id=tm1638 → wire → labwired_validate → labwired_run / labwired_verify.
  3. Register-level smoke: cargo test -p labwired-core --test parts_batch5 — on an STM32F103 bus, a full LED&KEY write through BSRR reads back as digits "01234567", LEDs, display on and pulse width; the negative control runs the same check against a TM1637 on the same pins and a TM1638 on unused pads, and both must fail. The same file's negative control proves the check fails against a stand-in that answers only 0x00 or only 0xFF.

Limitations

  • Key reading is not modelled: the part drives nothing on DIO.

See the YAML header for the full datasheet trace and every named approximation.