diff --git a/hardware/panel-mockup-vintage.png b/hardware/panel-mockup-vintage.png index 52cba2f..46eab9a 100644 Binary files a/hardware/panel-mockup-vintage.png and b/hardware/panel-mockup-vintage.png differ diff --git a/hardware/panel.md b/hardware/panel.md index 05a4c42..2365435 100644 --- a/hardware/panel.md +++ b/hardware/panel.md @@ -20,7 +20,7 @@ | **CELL** | 列一 / 上行 | 8 颗灯泡成一圈:**bit 0 在 9 点带楔形、刻 `0`**,其余顺时针标 `1..7` | | **INSTRUCTION** | 列二 / 上行 | 8 颗灯 + 符号 `> < + - [ ] . ,`,当前那条亮 | | **INPUT BYTE** | 列二 / 上行偏下 | **8 个拨动开关**,下面刻 `7 6 5 4 3 2 1 0`;右边红色 **SEND** 按钮 | -| **DATA 64** | 列三 / 上行 | **8 × 8 灯泡矩阵**,一格一颗;指针那颗用红圈闪(光标) | +| **DATA POINTER** | 列三 / 上行 | **6 颗红氖泡**,二进制显示 `dp`(bit 5 在左,bit 0 在右) | | **PROGRAM CARTRIDGE** | 列一 / 下行 | 卡边槽,插 27C512 卡带 | | **SERIAL / 6850** | 列三 / 下行 | DE-9 | | 按钮排 | 列二 / 下行 | **STEP · START · HALT · RESET**(见 §5 的待定项) | @@ -32,15 +32,15 @@ | 信息 | 表示 | |---|---| -| 指针位置 | 矩阵下方的 **6 颗红氖泡(二进制 `dp`)** | -| 64 格的 LSB | 矩阵灯的亮/灭(`biz`/`rnz` 唯一看的那一位) | +| 指针位置 | **6 颗红氖泡**(二进制 `dp`) | + | 当前格整字节 | CELL 灯环 | | 当前指令 | INSTRUCTION 灯 | | 结果 / 步数 / 调试 | **串口** | -### 3.1 指针怎么标(重要) +### 3.1 为什么面板上没有 64 格点阵(重要) -**灯泡不能变色**,而且在灯泡矩阵里**单独点亮某一格是做不到的**:矩阵按行/列驱动,动一条线会亮一整排(8 格)。所以指针不能靠"那一格变色/闪烁"。 +原先打算用 **8 × 8 灯泡矩阵**显示 64 格的 LSB,但那套东西**没法标出指针**:灯泡不会变色,而在矩阵里动一条行/列线会亮一整排(8 格),"只让指针那一格变红"要么 64 路独立驱动,要么根本做不到。一个连"我在哪"都答不了的点阵,占着三分之一面板不值得 —— **删掉**。 **定案:`dp` 单独用 6 颗红色氖泡按二进制显示**,放在矩阵下方,左边是 bit 5、右边是 bit 0: @@ -56,10 +56,10 @@ |---|---| | 灯环 | 8 × 6 V 灯丝灯泡,ULN2803 驱动(8 路),一个 74LS273 锁存当前格 | | 指令灯 | 8 × 6 V,另一片 ULN2803 + 74LS138 译码 | -| 矩阵 | 8 行 + 8 列扫描,**16 路驱动**(灯泡矩阵无需每格独立驱动) | + | **`dp` 显示** | 6 颗红氖泡,直接接计数器 `Q` 输出(74LS07/ULN2803 缓冲),见 §3.1 | | 拨码 | 8 位 → 74LS244 → 输入字节总线;SEND = 一个按钮 → `,` 的握手 | -| 按钮 | STEP/START/HALT/RESET 各一个,74LS14 去抖 | +| 按钮 | **STEP · START · HALT · RESET** 四个,74LS14 去抖 | | 电源 | 5 V(TTL)· 6 V(灯)· 12 V(可选),外置 5 V 2 A 适配器 | ## 5. 待定 / 注意 diff --git a/hardware/panel_mockup_vintage.py b/hardware/panel_mockup_vintage.py index fdcb3b1..5999ad8 100644 --- a/hardware/panel_mockup_vintage.py +++ b/hardware/panel_mockup_vintage.py @@ -150,7 +150,7 @@ def main(): # ---- CELL: eight lamps on a dial, LSB at nine o'clock ------------------- section(d, COL[0], 24.6, "CELL", 44) - ccx, ccy, cr = COL[0] + 26.0, 47.0, 11.0 + ccx, ccy, cr = COL[0] + 26.0, 40.4, 10.4 d.ellipse([p(ccx - cr), p(ccy - cr), p(ccx + cr), p(ccy + cr)], outline=(178, 172, 160), width=p(0.25)) bits = [1, 0, 0, 1, 1, 0, 1, 0] # bit 0 .. bit 7 @@ -188,27 +188,27 @@ def main(): d.ellipse([p(COL[1] + 45.4), p(49.0), p(COL[1] + 52.6), p(56.2)], fill=RED_BUTTON, outline=(70, 24, 20), width=p(0.25)) - # ---- DATA 64: the 64 cells, and dp in binary --------------------------- - # The matrix shows one bit per cell (the LSB, the only bit biz and rnz test). - # A single cell cannot be lit specially in a matrix -- a row or column line - # drives eight cells -- so where the pointer is gets its own six red neons, - # straight off the dp counter: no decoder, and no ambiguity. - section(d, COL[2], 24.6, "DATA 64", 56) - mx, my, pitch, lrad = COL[2] + 8.2, 30.6, 3.7, 1.25 - pattern = [0x9C, 0x71, 0x23, 0xC8, 0x4E, 0x96, 0x3B, 0xA5] - for row in range(8): - for col in range(8): - x = mx + col * pitch - y = my + row * pitch - lamp(d, g, x, y, lrad, bool((pattern[row] >> (7 - col)) & 1)) - - d.text((p(COL[2] + 1.0), p(59.4)), "DP", font=font(1.4), fill=INK_DIM) + # ---- DP: six red neons, binary, straight off the counter ---------------- + # A lamp matrix would need a decoder and could not mark one cell specially; + # six lamps show the pointer exactly, with no logic at all. + section(d, COL[2], 24.6, "DATA POINTER", 56) dp = 33 for i in range(6): - x = COL[2] + 7.6 + (5 - i) * 6.4 # bit 5 on the left, bit 0 right - lamp(d, g, x, 60.6, 1.7, bool((dp >> (5 - i)) & 1), CURSOR) - d.text((p(x - 0.6), p(62.8)), str(5 - i), font=font(1.1), fill=INK_DIM) + x = COL[2] + 6.0 + (5 - i) * 8.6 # bit 5 left, bit 0 right + lamp(d, g, x, 33.4, 2.3, bool((dp >> (5 - i)) & 1), CURSOR) + d.text((p(x - 0.7), p(37.0)), str(5 - i), font=font(1.3), fill=INK_DIM) + # ---- buttons: STEP START HALT RESET ------------------------------------ + for cx_, colour, label in ((17.0, RED_BUTTON, "STEP"), + (30.0, (52, 92, 58), "START"), + (43.0, (146, 60, 44), "HALT"), + (56.0, (58, 56, 52), "RESET")): + d.ellipse([p(cx_ - 4.0), p(59.2 - 4.0), p(cx_ + 4.0), p(59.2 + 4.0)], + fill=STEEL, outline=(104, 100, 94), width=p(0.22)) + d.ellipse([p(cx_ - 3.2), p(59.2 - 3.2), p(cx_ + 3.2), p(59.2 + 3.2)], + fill=colour, outline=(66, 60, 54), width=p(0.22)) + tw = d.textlength(label, font=font(1.15)) + d.text((p(cx_) - tw / 2, p(64.0)), label, font=font(1.15), fill=INK_DIM) # ---- lower row --------------------------------------------------------- d.line([p(12), p(65.4), p(RIGHT), p(65.4)], fill=ORANGE, width=max(1, p(0.3))) d.text((p(COL[0]), p(ROW_B)), "PROGRAM / 27C512", font=font(1.6), fill=INK)