Skip to the content
PCBKitNew board
2 layers37 × 75 mmEmu6802, the printed circuit board in 3D

HEX ファイル emu6802.X.production.hex を PIC へ書き込みます(PIC18F47Q84 用です)。ソースコードは emu6802.X 以下を参照してください。プロジェクトは MPLAB X IDE で開きます。

Size
37 × 75 mm
Copper layers
2
Thickness
1.6 mm
Parts
14
Nets
46
Pads
108
Tracks, vias
467, 13
Pours
5
Routed
Yes
KiCad
KiCad 6 (file 20211014)
Created
11 Jul 2022
Updated
22 Sep 2022

Overview

Emu6802 is an open-source printed circuit board by ryu10, from the ryu10/emu6802 repository on GitHub. It is a 2-layer board of 37 × 75 mm with 14 parts on 46 nets, routed with 467 tracks and 13 vias.

Its parts include 5 connectors, 2 capacitors and 1 IC.

README

Readme.md

EMU6802

[v0.6]

(日本語 | EN)

電脳伝説様作の EMUZ80 を利用した PIC16F47Q84 + MC6802 コンピュータです。

TL;DR

機能と特徴

  • MC6802 用変換基板
  • RAM 12KB
  • Mikbug モニタ
  • Basic(フリーエリア 5.5KB)
  • PIC TU16A タイマモジュール(IRQ 割り込み可)

emu6802

構成方法

以下の部品が必要です。

  • EMUZ80 キット(Z80 を除く)
  • PIC16F47Q84
  • EMU6802 変換基板(Gerber)
  • MC6802 または互換チップ
  • DIP 40P ソケット
  • 20x1 ピンソケット x2
  • 20x1 ピンヘッダ x2(細ピンタイプ、秋月電子などで入手可)
  • (オプション)C1/C2 パスコン(0.1uF, 10uF)、J3/J4/J5 パッチベイ用ピンヘッダ(5x2, 1x1, 3x1)

上の画像では MC6802 互換の MB8870H を使用しています。

配線

変換基板の配線を下の回路図に示します(PDF 版)。標準でデータバス、アドレスバス、制御信号、IRQ が配線されています。

schematic

PIC プログラム

HEX ファイル emu6802.X.production.hex を PIC へ書き込みます(PIC18F47Q84 用です)。ソースコードは emu6802.X 以下を参照してください。プロジェクトは MPLAB X IDE で開きます。

BASIC 実行までの手順

  1. EMUZ80 を組み立てます。PIC18F47Q84 を使用します。Z80 は取り付けません。
  2. Z80 ソケットの外側のパターンに 20x1 ピンソケット 2 本をはんだ付けします。
  3. PIC に HEX ファイル emu6802.X.production.hex を書き込みます。なお PIC 書き込みの際は念のため 6802 または変換基板を取り外してください。
  4. 変換基板を組み立てて EMUZ80 基板のピンソケットに刺します。
  5. 電源投入すると EMUZ80 のシリアルポート(9600bps)から Mikbug を使用できます。
  6. 'G' コマンドが参照するジャンプベクタアドレスは $2F48-$2F49です。デフォルトでジャンプベクタ $0000 が設定されているので、電源投入後すぐに 'G' キーを押すと Basic が立ち上がります。起動時の質問には下記の画面のとおり順に「12160」「80」「Y」と答えると一般的な設定が選択されます。

startup-mikbug-altair

動作

EMUZ80 と同様に PIC が MPU バス信号を読み取って ROM、RAM、UART、タイマをエミュレートします。通常のハードウェアに比べてメモリ応答が遅くなるので、6802 の MR ピンを使ってシステムクロック E をストレッチしています。現状のコードでは、外部クロック入力 EXTAL に 2.3MHz を入力した場合に BASIC プログラムが最も高速に動作するようです。このとき 6802 のシステムクロック E は 387kHz 程度です。

timing2

(Ch1: EXTAL, Ch1: E, Ch3: MR)

PIC タイマと IRQ 割り込み

PIC タイマモジュール TU16A の出力が CLC の FF 回路を経由して 6802 の IRQ に接続されます。6802 メモリ空間の $A007 - $A00F で TU16A の設定レジスタにアクセスできます。アドレスとレジスタの対応は下表のとおりです。

6802 アドレスPIC レジスタ名
0xa007TU16ACON0
0xa008TU16ACON1
0xa009TU16AHLT
0xa00aTU16APS
0xa00bTU16ATMRH / TU16ACRH
0xa00cTU16ATMRL / TU16ACRL
0xa00dTU16APRH
0xa00eTU16APRL
0xa00fTU16ACLK
0xa01fIRQ フラグリセット

タイマ割り込みを応用した MC6802 時計表示プログラムが clock.a です。

clockapp

また PIC コードによって動く RTC がプログラムされており、RTC の時刻データを $B000 - $B003 で読み書きできるようにしてあります。$B010 への書き込みアクセスをしたタイミングで時刻がセットされます。この場合 IRQ 割り込みは不要です。これを利用した Basic 時計表示プログラムが clock.bas です。

なお PIC の内部発振は誤差 2% 程度なので、実用的な RTC としては精度が不十分です。

課題

  • PIC のメモリエミュレーションを最適化する。✅
  • Altair 680 Basic を走らせる。✅
  • 割り込みピンを配線する。✅
  • EMUZ80 基板に載せられるアダプタボードを作る。✅
  • MC6802 内蔵 128 Byte RAM を有効にする。✅(※本リリースのデフォルト設定では無効。リリース v0.33 を参照してください)

Parts

14
QtyValueFootprintReferences
2MountingHoleMountingHole:MountingHole_3.2mm_M3H1, H2
10.1uCapacitor_THT:C_Disc_D3.0mm_W2.0mm_P2.50mmC1
110uCapacitor_THT:CP_Radial_D4.0mm_P2.00mmC2
1EMUZ80-AmyLibrary:PinHeader_1x20_P2.54mm_NarrowJ1
1EMUZ80-BmyLibrary:PinHeader_1x20_P2.54mm_NarrowJ2
1J_REJumper:SolderJumper-2_P1.3mm_Bridged_RoundedPad1.0x1.5mmJP1
1J_~{HALT}Jumper:SolderJumper-2_P1.3mm_Bridged_RoundedPad1.0x1.5mmJP3
1J_~{IRQ}Jumper:SolderJumper-2_P1.3mm_Bridged_RoundedPad1.0x1.5mmJP4
1J_~{NMI}Jumper:SolderJumper-2_P1.3mm_Bridged_RoundedPad1.0x1.5mmJP2
1MC6802Package_DIP:DIP-40_W15.24mmU1
1PatchBay_RE_GNDConnector_PinHeader_2.54mm:PinHeader_1x01_P2.54mm_VerticalJ4
1Patchbay_MPUConnector_PinHeader_2.54mm:PinHeader_2x05_P2.54mm_VerticalJ5
1Patchbay_PICConnector_PinHeader_2.54mm:PinHeader_1x03_P2.54mm_VerticalJ3

Questions

How big is the Emu6802 PCB?

It measures 37 × 75 mm and has 2 copper layers, 1.6 mm thick.

What parts does the Emu6802 use?

14 parts. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.

Where can I download the Emu6802 KiCad files?

From the ryu10/emu6802 repository on GitHub, at the commit this page was made from: the board is emu6802_conv.kicad6/emu6802/emu6802.kicad_pcb and its schematic emu6802_conv.kicad6/emu6802/emu6802.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the Emu6802 design in my own project?

Its repository states no licence, so its author keeps all rights: ask ryu10 before reusing the design.

Similar boards

  • 2 layers116.8 × 30 mmType d, the printed circuit board in 3D

    Type d

    google/mozc-devices

    Circuit diagrams and firmware source code for Gboard DIY keyboards

    14 parts3kApache-2.0
  • 2 layers32 × 22 mmDiff driver, the printed circuit board in 3D

    Diff driver

    rene-dev/stmbl

    AC Servo Driver for STM32F4

    14 parts990GPL-3.0
  • 2 layers34 × 45 mm2032Charger, the printed circuit board in 3D

    2032Charger

    hackclub/OnBoard

    💡 Join 1,000 teenagers and make your first PCB with a $100 grant!

    14 parts915
  • 2 layers34 × 109.9 mmTdisplay s3, the printed circuit board in 3D

    Tdisplay s3

    landonr/homeThing

    Wifi Smart Home Remotes that run on ESPHome

    14 parts551GPL-3.0
  • 2 layers45.3 × 42.7 mmMainPcb, the printed circuit board in 3D

    MainPcb

    adamb314/ServoProject

    Getting the most out of your hobby servo

    14 parts545
  • 2 layers42.5 × 28.8 mmC5VRX JACK DIY, the printed circuit board in 3D

    C5VRX JACK DIY

    Twotoz/C5VRX

    Ultra-minimal, zero-CPU 5.8 GHz analog FPV video receiver using ESP32-C5 Wi-Fi 6 PHY MODEM_DIAG, BitScrambler WBFM demodulation & resistor DAC CVBS

    14 parts515GPL-3.0
  • 2 layers62 × 24 mmMai button, the printed circuit board in 3D

    Mai button

    whowechina/mai_pico

    Pico controller for Maimai

    14 parts475