CMD-R-REFILL
AI

The **CMD-R-REFILL** (Command-R Refill) is typically associated with the open-source hardware community, specifically within the "Cyberdeck" or portable terminal subculture. It refers to a specific PCB (Printed Circuit Board) design intended to replace or upgrade the internal components of vintage 1980s calculators (like the Texas Instruments TI-59 or similar form factors) to turn them into modern Linux terminals or macro pads.
Below is an explanation of the core electronic parts involved in such a build.
---
## 1. Core Logic & Control
The brain of the device is usually a microcontroller or a Single Board Computer (SBC) that fits within the slim profile of the calculator shell.
| Component | Function | Common Choice |
| :--- | :--- | :--- |
| **Microcontroller** | Handles keyboard scanning and USB communication. | RP2040 (Raspberry Pi Pico) or ATMega32U4. |
| **SBC Host** | Provides the operating system (Linux). | Raspberry Pi Zero 2W or Radxa Zero. |
| **Logic Level Shifter** | Converts signals between different voltages (e.g., 5V to 3.3V). | TXS0108E or simple MOSFET circuits. |
---
## 2. Display Interface
Modern refills replace the old LED/VFD bubble displays with high-resolution LCDs or OLEDs.
* **OLED Modules:** Usually 128x32 or 128x64 pixels using the **SSD1306** driver. They are preferred for their thin profile.
* **TFT LCDs:** 1.3" to 2.0" screens using the **ST7789** driver for color terminal output.
* **FPC Connector:** Flexible Printed Circuit connectors are used to link the screen to the PCB to save vertical space.
---
## 3. Keyboard Matrix
The CMD-R-REFILL utilizes the original physical buttons of the calculator but replaces the underlying circuitry.
* **Tactile Switches:** 6mm x 6mm low-profile switches are often soldered to the new PCB to align with the original plastic keys.
* **Diodes:** (1N4148 or similar) arranged in a matrix to prevent "ghosting" when multiple keys are pressed simultaneously.
* **Shift Registers:** If the microcontroller has limited I/O pins, chips like the **74HC165** are used to read all buttons.
---
## 4. Power Management
Since these devices are meant to be portable, they require a modern power delivery system.
### Key Components:
1. **LiPo Battery:** Typically a flat 500mAh to 1000mAh cell.
2. **Charging IC:** Usually a **TP4056** or **MCP73831** for safe USB charging.
3. **Boost Converter:** (e.g., MT3608) to step up the battery voltage (3.7V) to a stable 5V for the Raspberry Pi or Display.
4. **USB-C Port:** Modern standard for both charging and data/programming.
---
## 5. Storage and Connectivity
* **MicroSD Slot:** Required if using a Raspberry Pi Zero to host the OS.
* **Expansion Headers:** Broken-out GPIO pins for connecting external sensors or modules (I2C, SPI, UART).
---
### Basic Block Diagram
```mermaid
graph LR
A[USB-C Power] --> B[TP4056 Charger]
B --> C[LiPo Battery]
C --> D[5V Boost Converter]
D --> E[Main Controller/Pi Zero]
E --> F[Display]
E --> G[Key Matrix]
```
- ⤷
Which specific microcontroller is most compatible with the CMD-R-REFILL PCB?
- ⤷ How do you map the original calculator keycaps to a modern GPIO matrix?
- ⤷ What are the power consumption concerns when using a Pi Zero in this form factor?