docs: what the 6850 is doing in this machine, and what to buy instead
ci / linux-arm64 (push) Successful in 4m45s
ci / linux-arm64 (push) Successful in 4m45s
It is the UART. The 6850 turns parallel bytes into asynchronous frames and back, and in this machine it is exactly the physical end of two instructions: comma waits for RDRF and reads the data register into the current cell, dot waits for TDRE and writes the current cell out. Without it there is nowhere for input and output to land, so the calculator cannot talk to a terminal and hello prints nothing. Wiring notes now recorded: two registers selected by RS, the usual read/write and chip select lines, RxD and TxD through a MAX232 to the DE-9, and a separate 2.4576 MHz crystal divided by sixteen to get the 153.6 kHz baud clock -- 1 MHz cannot be divided into it. At 9600 a byte takes 1.04 ms, so comma and dot block, and the panel lamps pausing for a millisecond is normal. Alternatives priced in effort: another makers 6850 or a 65C50 is a straight swap, an i8251 needs different microcode, a 16550 is cheap but PC flavoured, plain TTL shift registers are the most period correct and the most painful, and no serial at all leaves a pure trainer that cannot run the calculator. The stale panel section went too: the four digit displays, the ip and dp LED rows and the three button set were still described there.
This commit is contained in:
1 parent
87a60d64ec
commit
695d4537fe
1 file changed
+44
-8
@@ -129,14 +129,50 @@
|
||||
|
||||
## 9. 串口与面板
|
||||
|
||||
* **6850**:`RxD/TxD` 走 MAX232 或直接用 USB-TTL;`RS`/`R/~W` 选寄存器;`RDRF` 就是 `,`
|
||||
的"有字符"信号,`TDRE` 就是 `.` 的"可以发"信号。波特率 9600(74LS4060 分频)。
|
||||
* **面板**:
|
||||
* 4 位数码管(74LS47 驱动):默认显示当前格(十六进制),一个拨动开关切到 `ip` / `dp`;
|
||||
* 8 个 LED 显示操作码(`>` `<` `+` `-` `[` `]` `.` `,`),当前指令亮;
|
||||
* 8 个 LED 显示 `ip` 低 8 位,6 个 LED 显示 `dp`;
|
||||
* RUN / STEP / RESET 三个按钮(带灯);
|
||||
* 8 位拨码 + "发送"按钮 → 直接往 ACIA 的 TDR 写一个字节(当"键盘"用)。
|
||||
### 9.1 6850 ACIA 是什么、为什么有它
|
||||
|
||||
**一片串行接口芯片**(Asynchronous Communications Interface Adapter,Motorola 1974):把
|
||||
8 位并行数据 ↔ **异步串行帧**(起始位 + 8 数据位 + 停止位,即 9600 8N1)互相转换。它就是这台
|
||||
机器的 **UART**。
|
||||
|
||||
在这台机器上它只干两件事,正好对应两条指令:
|
||||
|
||||
| 指令 | 对 6850 做什么 |
|
||||
|---|---|
|
||||
| `,`(INP) | 等状态寄存器的 **RDRF**(收到一个字节),然后读数据寄存器 → 写进当前格 |
|
||||
| `.`(OUT) | 等状态寄存器的 **TDRE**(可以发),然后把当前格写进数据寄存器 → 芯片自己串出去 |
|
||||
|
||||
没有它,`. `和 `,` 就没有落点:计算器不能跟终端对话,`hello` 也打不出字符。**它是"控制台"
|
||||
这一侧的物理实现** —— 软件里 `machine_options::input` / `output` 那套语义,到板子上就是这片芯片。
|
||||
|
||||
**接线要点**
|
||||
|
||||
* 数据总线 `D0..D7`;`RS` 选寄存器(0 = 状态/控制,1 = 数据);`R/~W`、三根片选;`IRQ` 不用(轮询)。
|
||||
* `RxD`/`TxD` → MAX232 → DE-9,或直接 USB-TTL。
|
||||
* **波特率时钟**:6850 要 **16 × 波特率** 的时钟。9600 需要 **153.6 kHz** —— 从 1 MHz 分不出来
|
||||
(1 MHz / 153.6 kHz = 6.51 ✗),所以串口那一路单独用 **2.4576 MHz** 晶体(÷16 = 153.6 kHz,
|
||||
这是当年的"UART 晶振"标准值),74LS4060 分频。
|
||||
* 一个字节要 10 位 = 1.04 ms @ 9600,所以 `,`/`.` 是**阻塞**的:微码在 `RDRF`/`TDRE` 上等,
|
||||
面板上的灯会停一下 —— 这是正常的,不是卡死。
|
||||
|
||||
**买不到怎么办**(6850 ¥20/片,越来越难买)
|
||||
|
||||
| 替代 | 代价 |
|
||||
|---|---|
|
||||
| **SY6850 / MC6850P / 65C50**(同型不同厂) | 基本无损 ✓ 优先找这个 |
|
||||
| **i8251 USART**(Intel,同年代) | 寄存器不同,微码要改;一样有年代感 ✓ |
|
||||
| **16550** | 便宜好买,但寄存器多、要地址译码,且是 PC 味 ✗ |
|
||||
| **纯 TTL 位拼接**(74LS164/165 + 分频) | 极复古,但帧同步和采样要自己搭,调试痛苦 |
|
||||
| **不要串口** | 输入只剩 8 位拨码、输出只能看灯环 —— 那它就是纯训练机,**跑不了计算器** ✗ |
|
||||
|
||||
**面板**(以 `panel.md` 为准,早先那版 4 位数码管已删):
|
||||
|
||||
* **CELL** 灯环:8 颗氖灯 = 当前格(LSB 有楔形标 `0`);
|
||||
* **INSTRUCTION**:8 颗氖灯 = 当前操作码;
|
||||
* **DATA POINTER**:6 颗氖灯 = `dp` 的二进制;
|
||||
* 8 位拨码 + **SEND** 按钮;**STEP / START / HALT / RESET** 四个按钮;
|
||||
* 氖灯驱动用 MPSA42(ULN2803 只耐 50 V ✗),见 `panel.md` §4。
|
||||
|
||||
|
||||
## 10. 上电与调试顺序
|
||||
|
||||
|
||||
Reference in new issue
Block a user