Skip to content

Commit 92bf061

Browse files
add hardware wiki
1 parent e5fb987 commit 92bf061

11 files changed

Lines changed: 150 additions & 1 deletion

File tree

astro.sidebar.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,11 @@ export const sidebar = [
150150
{
151151
label: 'Developer Notes',
152152
autogenerate: { directory: 'dev' },
153+
},
154+
{
155+
label: 'Hardware',
156+
collapsed: true,
157+
autogenerate: { directory: 'hardware' },
153158
}
154159
]
155160
})
2.74 MB
Loading
181 KB
Loading
122 KB
Loading
190 KB
Loading
133 KB
Loading
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
title: Overclocking
3+
description: How to make the calculator faster
4+
---
5+
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
title: Repair Guide
3+
description: How to open and repair the classpad
4+
---
5+
6+
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
title: SD Card
3+
description: How to add SD-Card to the classpad
4+
---
5+
Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
---
2+
title: Serial Communication
3+
description: Connecting your Classpad to PCs and microcontrollers.
4+
sidebar:
5+
order: 3
6+
---
7+
8+
The 3-pin serial port (a 2.5mm jack) on your Classpad allows it to communicate with other devices, such as a PC for transferring programs or another microcontroller (like an ESP32 or Arduino) for custom hardware projects. This guide covers several methods for creating the necessary connection.
9+
10+
### Important Note on Voltage Levels
11+
12+
Before you begin, it's critical to understand the voltage levels of the serial interface.
13+
- **Modern Classpads (like the fx-CP400 / Classpad II) use 3.3V logic.**
14+
- **Many microcontrollers (like the Arduino Uno) use 5V logic.**
15+
- **Older calculators (like the Classpad 300) used a higher voltage (~4V).**
16+
17+
Connecting a 5V device's Transmit (TX) pin directly to a 3.3V calculator's Receive (RX) pin can damage the calculator. To safely connect them, you must use a **voltage divider** or a logic level shifter to step the 5V signal down to 3.3V.
18+
19+
A common voltage divider consists of two resistors (e.g., 10kΩ and 20kΩ) to reduce the voltage. The ESP32 and ESP8266 are 3.3V devices, so they can be connected directly without a voltage divider.
20+
21+
---
22+
23+
## Method 1: Building a PC-to-Calculator Cable (from Scratch)
24+
25+
This method uses common, inexpensive electronic components to build a USB-to-Serial cable for connecting your calculator to a PC.
26+
27+
> Thanks to [Calamari](https://www.planet-casio.com/Fr/compte/voir_profil.php?membre=calamari) for the original guide.
28+
29+
### Parts Required
30+
- CH340G USB to TTL Adapter
31+
- DuPont Cables (Male-to-Female)
32+
- 3.5mm Connector to Screw Terminal
33+
- 3.5mm Female to 2.5mm Male Stereo (TRS) Adapter
34+
- Recommended: USB 2.0 Extension Cable
35+
36+
![](/wiki/img/hardware/serial/build-PC-to-calculator.png)
37+
38+
### Tools Required
39+
- #0 Phillips Screwdriver
40+
- Knife for trimming plastic
41+
42+
:::caution[Knife Safety]
43+
- Ask an adult for help if you're unfamiliar with using a knife.
44+
- Be careful and take your time when trimming plastic.
45+
:::
46+
47+
### Assembly Instructions
48+
1. **Set Voltage Jumper**: On the CH340G adapter, move the jumper from the `5V - VCC` position to the `VCC - 3V3` position. This sets the logic level to 3.3V, which is safe for the calculator.
49+
2. **Connect DuPont Cables**: Connect three female DuPont cables to the `GND`, `TXD`, and `RXD` pins on the USB adapter.
50+
3. **Wire the Terminal**: Using the screwdriver, connect the male ends of the DuPont cables to the 3.5mm screw terminal:
51+
- `GND` pin (USB adapter) → `` (Ground) terminal.
52+
- `TXD` pin (USB adapter) → `R` (Ring) terminal.
53+
- `RXD` pin (USB adapter) → `L` (Tip) terminal.
54+
4. **Connect Adapters**: Plug the 3.5mm terminal into the 3.5mm-to-2.5mm adapter.
55+
56+
### Trimming the Adapter
57+
The 2.5mm port on the calculator is often recessed. The plastic housing on the adapter may be too wide to fit. Carefully use a knife to shave away the excess black plastic near the metal tip until it can be fully inserted into the calculator.
58+
59+
For a picture of the completed cable, see [this post on Planet-Casio](https://www.planet-casio.com/Fr/forums/topic17865-1-besoin-de-cables-usbserie-bon-marche-pour-calculatrices-casio.html#198410).
60+
61+
---
62+
63+
## Method 2: Modifying an Existing Casio Cable
64+
65+
If you have an official Casio SB-62 cable or another 2.5mm audio cable, you can cut it and wire it to a USB-to-TTL module.
66+
67+
> Thanks to **Lize** for this guide.
68+
69+
### Parts & Tools Required
70+
- An existing 2.5mm cable (like the SB-62 or a headphone cable)
71+
- A USB-to-TTL module (e.g., PL2303, CP2102, FT232)
72+
- Wire stripper (or scissors)
73+
- Soldering iron and solder
74+
- Heat shrink tubing or electrical tape
75+
- Three DuPont wires
76+
77+
### Assembly Steps
78+
1. **Cut the Cable**: Cut your 2.5mm cable, leaving enough length to work with.
79+
2. **Strip Wires**: Carefully strip the outer insulation to expose the inner wires. You should find a ground wire (often braided copper) and two insulated data wires (for Tip and Ring).
80+
3. **Prepare Wires**: Twist the ground wire into a single strand. Strip a small amount of insulation from the two data wires. "Tin" all three wires by applying a small amount of solder to them.
81+
4. **Solder Connections**: Solder the three prepared DuPont wires to the three wires from your 2.5mm cable. It's best to use different colored DuPont wires to keep track of them. Use heat shrink tubing or electrical tape to insulate each connection.
82+
5. **Connect to TTL Module**: Plug the DuPont wires into your USB-to-TTL module. The connections must be crossed over:
83+
- **Cable Ground**`GND` pin on the module.
84+
- **Cable Tip (Receive)**`TXD` (Transmit) pin on the module.
85+
- **Cable Ring (Transmit)**`RXD` (Receive) pin on the module.
86+
87+
**Note**: If the connection doesn't work, the most likely issue is that the TX/RX wires are swapped. Simply switch the two data wires on the TTL module's pins.
88+
89+
![](/wiki/img/hardware/serial/modified-cable.jpg)
90+
91+
---
92+
93+
## Method 3: Connecting to a Microcontroller (ESP32)
94+
95+
You can connect your calculator directly to a microcontroller like an ESP32 to send and receive data, creating custom hardware projects.
96+
97+
### Parts Required
98+
- ESP32 Development Board `ESP32-DEVKITC-32E`
99+
- 2.5mm 4-Conductor Cable Assembly `CA-254S`
100+
- 2x AA Battery Holder with Leads `23-BH2-3`
101+
102+
### Wiring Diagram
103+
104+
![](/wiki/public/img/hardware/serial/wiring-esp.png)
105+
106+
### Wiring Instructions
107+
1. **Power the ESP32**: Connect the battery holder to the ESP32.
108+
- **Red wire** (Battery Holder) → `VIN` pin on the ESP32.
109+
- **Black wire** (Battery Holder) → `GND` pin on the ESP32.
110+
2. **Connect ESP32 to 2.5mm Cable**: The 2.5mm cable has four wires. The principle is to **cross the transmit (TX) and receive (RX) lines**.
111+
- **Cable Black wire** (GND) → `GND` pin on the ESP32.
112+
- **Cable Yellow wire** (TX) → An **RX** pin on the ESP32 (e.g., `RX2`).
113+
- **Cable Green wire** (RX) → A **TX** pin on the ESP32 (e.g., `TX2`).
114+
- The red wire on the cable is unused in this setup.
115+
3. **Connect to Calculator**: Plug the 2.5mm jack into the calculator's serial port.
116+
117+
118+
---
119+
120+
## Communicating with Casio BASIC
121+
122+
Hollyhock gives you full, low-level control over the serial port. However, you can also communicate with a standard, unmodified calculator running a Casio BASIC program using the `SendVar38k` and `GetVar38k` commands.
123+
124+
This makes it possible for a Hollyhock program on one calculator to communicate with a Casio BASIC program on another.
125+
126+
For a detailed breakdown of the protocol and a sample BASIC chat program, see the full documentation here: **[SendVar38k Protocol Details](https://github.com/SnailMath/classpad/blob/main/3-pin/SendVar38k.md)**
127+
128+
![](/wiki/public/img/hardware/serial/older.jpg)

0 commit comments

Comments
 (0)