[HOME]

1chipMSXとBLKIT

Jun Mizutani 2006/12/13

BLKIT

ヒューマンデータ https://www.hdl.co.jp/home.htmlのダウンロードケーブル自作キット(BLKIT) を購入して組み立て、ダウンロードケーブルの動作確認のため 1chipMSX のFPGAを書き換えてみました。1chipMSXのコネクタとケーブルの接続の向きが分からなかったのですが、下の写真の向きに接続して正解でした。

BLKIT

LEDの点滅を変更

ダウンロードケーブルの動作確認のためVHDLのソースを書き換えて動作が変わるか確認する必要があります。回路図とVHDLのソースを見比べてLEDをいじるのが簡単で安全そうなので、LEDの点滅をという動きからのようなLEDの点滅が交差するように変更しました。


ESEMSX3\pld\src\emsx_top.vhd の810行目から次のように変更して、QuartusII 6.0sp1 でコンパイルしました。( コンパイル手順 )

      if (cnt = "000000000000000000000") then	-- 21.48MHz / 2^21(approx:2M) => 10Hz
        case seq is
          when "0010"  => pLed <= "1Z0000Z1";  iDipLed(2) <= not pDip(2);
          when "0011"  => pLed <= "Z100001Z";  iDipLed(1) <= not pDip(1);
          when "0100"  => pLed <= "0Z1001Z0";  iDipLed(0) <= not pDip(0);
          when "0101"  => pLed <= "00Z11Z00";  iDipLed(1) <= not pDip(1);
          when "0110"  => pLed <= "00011000";  iDipLed(2) <= not pDip(2);
          when "0111"  => pLed <= "001ZZ100";  iDipLed(3) <= not pDip(3);
          when "1000"  => pLed <= "01Z00Z10";  iDipLed(4) <= not pDip(4);
          when "1001"  => pLed <= "1Z0000Z1";  iDipLed(5) <= not pDip(5);
          when "1010"  => pLed <= "Z100001Z";  iDipLed(6) <= not pDip(6);
          when "1011"  => pLed <= "0Z1001Z0";  iDipLed(7) <= not pDip(7);
          when "1100"  => pLed <= "00Z11Z00";  iDipLed(6) <= not pDip(6);
          when "1101"  => pLed <= "00011000";  iDipLed(5) <= not pDip(5);
          when "1110"  => pLed <= "001ZZ100";  iDipLed(4) <= not pDip(4);
          when "1111"  => pLed <= "01Z00Z10";  iDipLed(3) <= not pDip(3);
          when others  => pLed <= "ZZZZZZZZ";  iDipLed    <= not pDip   ;
        end case;
      end if;

コンパイル結果

+------------------------------------------------------------------------+
; Flow Summary                                                           ;
+-------------------------+----------------------------------------------+
; Flow Status             ; Successful - Wed Dec 13 22:10:17 2006        ;
; Quartus II Version      ; 6.0 Build 202 06/20/2006 SP 1 SJ Web Edition ;
; Revision Name           ; emsx_top                                     ;
; Top-level Entity Name   ; emsx_top                                     ;
; Family                  ; Cyclone                                      ;
; Device                  ; EP1C12Q240C8                                 ;
; Timing Models           ; Final                                        ;
; Met timing requirements ; No                                           ;
; Total logic elements    ; 10,029 / 12,060 ( 83 % )                     ;
; Total pins              ; 171 / 173 ( 99 % )                           ;
; Total virtual pins      ; 0                                            ;
; Total memory bits       ; 73,966 / 239,616 ( 31 % )                    ;
; Total PLLs              ; 1 / 2 ( 50 % )                               ;
+-------------------------+----------------------------------------------+

+-------------------------------------+
; Flow Elapsed Time                   ;
+----------------------+--------------+
; Module Name          ; Elapsed Time ;
+----------------------+--------------+
; Analysis & Synthesis ; 00:16:07     ;
; Fitter               ; 00:09:07     ;
; Assembler            ; 00:00:14     ;
; Timing Analyzer      ; 00:01:35     ;
; Total                ; 00:27:03     ;
+----------------------+--------------+

Total logic elements が10026から10029に増えています。コンパイル時間が倍以上かかりましたが不明。


1chipMSXにダウンロードケーブル経由で書き換えて、無事に変更した通りにLEDが点滅。ちゃんとハンダ付けできているようです。これで安心してFPGAの書き換えができます。VHDLはこれから勉強します。

と思ったら、ビデオ出力が表示されなくなってしまいました。ダウンロードケーブルでCD-ROM の emsx_top.pof を書き戻して復活。やはり、よく分からないままVHDLを触るにはダウンロードケーブル必須ですね。


と思ったら、BIOSを書き込んでいないことに気づきました。BIOSを書いたら問題なく動作しました。

オリジナルのソース

      if (cnt = "000000000000000000000") then	-- 21.48MHz / 2^21(approx:2M) => 10Hz
        case seq is
          when "0010"  => pLed <= "000000Z1";  iDipLed(2) <= not pDip(2);
          when "0011"  => pLed <= "0000001Z";  iDipLed(1) <= not pDip(1);
          when "0100"  => pLed <= "000001Z0";  iDipLed(0) <= not pDip(0);
          when "0101"  => pLed <= "00001Z00";  iDipLed(1) <= not pDip(1);
          when "0110"  => pLed <= "0001Z000";  iDipLed(2) <= not pDip(2);
          when "0111"  => pLed <= "001Z0000";  iDipLed(3) <= not pDip(3);
          when "1000"  => pLed <= "01Z00000";  iDipLed(4) <= not pDip(4);
          when "1001"  => pLed <= "1Z000000";  iDipLed(5) <= not pDip(5);
          when "1010"  => pLed <= "Z1000000";  iDipLed(6) <= not pDip(6);
          when "1011"  => pLed <= "0Z100000";  iDipLed(7) <= not pDip(7);
          when "1100"  => pLed <= "00Z10000";  iDipLed(6) <= not pDip(6);
          when "1101"  => pLed <= "000Z1000";  iDipLed(5) <= not pDip(5);
          when "1110"  => pLed <= "0000Z100";  iDipLed(4) <= not pDip(4);
          when "1111"  => pLed <= "00000Z10";  iDipLed(3) <= not pDip(3);
          when others  => pLed <= "ZZZZZZZZ";  iDipLed    <= not pDip   ;
        end case;
      end if;

コンパイル結果

+------------------------------------------------------------------------+
; Flow Summary                                                           ;
+-------------------------+----------------------------------------------+
; Flow Status             ; Successful - Sun Dec 10 16:42:00 2006        ;
; Quartus II Version      ; 6.0 Build 202 06/20/2006 SP 1 SJ Web Edition ;
; Revision Name           ; emsx_top                                     ;
; Top-level Entity Name   ; emsx_top                                     ;
; Family                  ; Cyclone                                      ;
; Device                  ; EP1C12Q240C8                                 ;
; Timing Models           ; Final                                        ;
; Met timing requirements ; No                                           ;
; Total logic elements    ; 10,026 / 12,060 ( 83 % )                     ;
; Total pins              ; 171 / 173 ( 99 % )                           ;
; Total virtual pins      ; 0                                            ;
; Total memory bits       ; 74,014 / 239,616 ( 31 % )                    ;
; Total PLLs              ; 1 / 2 ( 50 % )                               ;
+-------------------------+----------------------------------------------+
+-------------------------------------+
; Flow Elapsed Time                   ;
+----------------------+--------------+
; Module Name          ; Elapsed Time ;
+----------------------+--------------+
; Analysis & Synthesis ; 00:06:50     ;
; Fitter               ; 00:03:53     ;
; Assembler            ; 00:00:06     ;
; Timing Analyzer      ; 00:00:40     ;
; Total                ; 00:11:29     ;
+----------------------+--------------+