簡易檢索 / 詳目顯示

研究生: 方勝弘
論文名稱: 微處理機系統模擬
A Microcomputer System Simulator
指導教授: 吳榮根
學位類別: 碩士
Master
系所名稱: 資訊教育研究所
Graduate Institute of Information and Computer Education
論文出版年: 2004
畢業學年度: 92
語文別: 中文
論文頁數: 86
中文關鍵詞: 微處理機模擬8051單晶片
英文關鍵詞: microcomputer, simulate, 8051, single chip
論文種類: 學術論文
相關次數: 點閱:252下載:6
分享至:
查詢本校圖書館目錄 查詢臺灣博碩士論文知識加值系統 勘誤回報
  • 在微電腦系統設計開發過程中,若能先在個人電腦上以軟體模擬,並利用軟體偵錯來輔助發展,則可節省很多開發的時程與材料而加速研發。並且可以做為人員教育訓練節省成本。據此,本研究為研究微處理機與介面之間的溝通與整合並使用軟體模擬出結果。
    本研究是以8051單晶片為主,設計一個微電腦發展系統。在本系統中提供視覺化元件如RAM 2Kx8、ROM 32Kx8、AND、OR、接地、LED等各式元件計33種,應用視窗圖形化介面,直接於視窗上將元件進行電路連接而完成類似電路圖的元件配置圖。而此元件配置圖可以進行儲存以方便日後進行修改與使用。進行模擬時再載入8051 HEX程式檔,使用本系統提供的模擬執行功能—反組譯HEX檔案、執行、單步執行、中斷點、修改程式、修改隨機記憶體資料等功能,即可於線上發展系統。甚至也可以於線上直接編寫程式而不需由外界載入。
    而所發展完成的系統因為已經將8051與其他元件全部以軟體模擬,且在系統中硬體線路與元件配置又都以視覺化表示,所以執行結果也就能以視覺化的方式展示,如LED就可以點亮,7段顯示器就可以顯示0到9的數字等。使得微電腦系統的硬體設計與軟體設計都得以在本系統上得到良好的整合與發展。

    In designing a microcomputer-controlled system, if we can use computer software to simulate the work of components and the control program, we can save time in wiring the prototype circuit and speed up the process. This study focuses on using software to simulate the communication between the microcomputer and interface.
    Our system integrates the hardware and software designing processes of the microcomputer-controlled system. We use computer software to simulate the work of an 8051 single chip microcomputer and other interface circuits in a microcomputer-controlled system. The system offers a total of 33 visual components, including RAM 2Kx 8, ROM 32Kx8, AND gate, OR gate, ground, LED and so on, as interface circuits. The system uses window graphic user interface, so that it connects components directly to design the circuit diagram. This circuit diagram can be saved for later use.
    This system provides the function of writing and executing assembly programs. During the debugging process, assembly codes are shown, and single step execution and break-point setting are allowed. Results of the circuit operation are visually presented, so that the hardware/software designers can see how the circuit works just like that of a real circuit.

    目 錄 附表目錄....................................................................................................................iii 附圖目錄....................................................................................................................iv 第一章 緒論..............................................................................................................1 1-1 研究背景與動機................................................................................................1 1-2研究架構.............................................................................................................3 1-3論文內容介紹.....................................................................................................4 第二章 相關研究....................................................................................................5 2-1 線上電路模擬系統(ICE)...................................................................................5 2-2 益眾科技SIM51模擬器....................................................................................8 第三章 系統設計....................................................................................11 3-1 系統基本設定..................................................................................................12 3-2 基本類別與結構..............................................................................................12 3-3 元件介紹..........................................................................................................16 3-4 8051指令分類................................................................................................36 3-5 反組譯..............................................................................................................42 3-6 組譯..................................................................................................................43 3-7 8051 HEX檔案結構......................................................................................44 3-8 PIN腳連線.....................................................................................................45 第四章 使用方法....................................................................................69 4-1 基本設定..........................................................................................................69 4-2 使用流程..........................................................................................................70 4-3 設計元件配置圖..............................................................................................72 4-4 載入8051HEX檔............................................................................................75 4-5 模擬執行..........................................................................................................75 4-6 儲存結果..........................................................................................................76 第五章 實際測試....................................................................................78 5-1 廣告燈..............................................................................................................78 5-2 文字型LCD實驗...........................................................................................79 第六章 結論............................................................................................85 附錄一 廣告燈程式..............................................................................................87 附錄二 文字型LCD實驗程式.........................................................................88 參考文獻..................................................................................................92 附表目錄 表2-1 元件代碼與預設連接位置................................................................................9 表3-1 PIN的屬性.....................................................................................................14 表3-2 互動結構的屬性..............................................................................................15 表3-3 基本類別重要屬性表......................................................................................15 表3-4 JK flip-flop輸出入關係表(特徵表)..............................................................33 表3-5 D flip-flop 輸出入關係表(特徵表)..............................................................34 表3-6 8051指令分類表...........................................................................................37 表3-7 連接A、B元件中間點的座標(Pm)..............................................................46 表3-8 連接A、B元件中間點的座標(Pm)..............................................................47 表3-9 連接A、B元件中間點的座標(Pm).............................................................48 表3-10 連接A、B元件中間點的座標(Pm)...........................................................48 表3-11 連接A、B元件中間點的座標(Pm)..............................................................50 表3-12 連接A、B元件中間點的座標(Pm)..............................................................50 表3-13 連接A、B元件中間點的座標(Pm)...............................................................51 表3-14 連接A、B元件中間點的座標(Pm)..............................................................52 表3-15 連接A、B元件中間點的座標(Pm)..............................................................53 表3-16 連接A、B元件中間點的座標(Pm).............................................................54 表3-17 連接A、B元件中間點的座標(Pm).............................................................55 表3-18 連接A、B元件中間點的座標(Pm).............................................................56 表3-19 連接A、B元件中間點的座標(Pm)..............................................................57 表3-20 連接A、B元件中間點的座標(Pm)..............................................................57 表3-21 連接A、B元件中間點的座標(Pm).............................................................58 表3-22 連接A、B元件中間點的座標(Pm).............................................................59 表3-23 連接A、B元件中間點的座標(Pm).............................................................60 表3-24 連接A、B元件中間點的座標(Pm)...............................................................61 表3-25 連接A、B元件中間點的座標(Pm)...............................................................61 表3-26 連接A、B元件中間點的座標(Pm)..............................................................62 表3-27 連接A、B元件中間點的座標(Pm)...............................................................63 表3-28 連接A、B元件中間點的座標(Pm)...............................................................64 表3-29 連接A、B元件中間點的座標(Pm)...............................................................65 表3-30 連接A、B元件中間點的座標(Pm)...............................................................66 表3-31 連接A、B元件中間點的座標(Pm)...............................................................66 表3-32 連接A、B元件中間點的座標(Pm)...............................................................67 表3-33 連接A、B元件中間點的座標(Pm)...............................................................68 附圖目錄 圖1-1 系統執行架構圖...............................................................................................3 圖2-1 ICE連接圖......................................................................................................6 圖2-2 新華公司 WinICE軟體....................................................................................6 圖2-3 SIM 51模擬器執行畫面....................................................................................8 圖2-4 8個七節顯示器連線.......................................................................................9 圖3-1 PIN結構圖.....................................................................................................13 圖3-2 PIN腳與物件關係.........................................................................................13 圖3-3 互動結構圖......................................................................................................14 圖3-4 基本類別與各單元類別關係圖......................................................................15 圖3-5 VCC圖示.......................................................................................................16 圖3-6 接地元件形狀..................................................................................................17 圖3-7 七段顯示器圖示..............................................................................................17 圖3-8 連接線與亮點的位置圖..................................................................................18 圖3-9 LED於程式中的圖示...................................................................................18 圖3-10 開關打開狀態................................................................................................19 圖3-11開關關閉狀態.................................................................................................19 圖3-12 開關的互動結構............................................................................................19 圖3-13 74LS373圖示...............................................................................................20 圖3-14 ROM32K*8..................................................................................................20 圖3-15 ROM64K*8..................................................................................................21 圖3-16 RAM 2K*8...................................................................................................22 圖3-17 RAM8K*8....................................................................................................22 圖3-18 RAM 32K*8.................................................................................................23 圖 3-19 8253............................................................................................................24 圖 3-20 8255............................................................................................................24 圖3-21 AND 2輸入1輸出.....................................................................................25 圖3-22 AND3輸入1輸出......................................................................................25 圖3-23 AND 4輸入1輸出......................................................................................26 圖3-24 OR 2個輸入1個輸出.................................................................................26 圖3-25 OR 3個輸入1個輸出................................................................................27 圖3-26 OR 4個輸入1個輸出................................................................................27 圖3-27 EOR 2個輸入1個輸出..............................................................................28 圖3-28 EOR 3個輸入1個輸出...............................................................................28 圖3-29 EOR 4個輸入1個輸出..............................................................................29 圖3-30 NAND 2輸入1個輸出...............................................................................29 圖3-31 NAND 3個輸入1個輸出............................................................................30 圖3-32 NAND 4個輸入1個輸出............................................................................30 圖3-33 NOR 2 個輸入1個輸出............................................................................31 圖3-34 NOR 3個輸入1個輸出.............................................................................31 圖3-35 NOR 4個輸入1個輸出.............................................................................32 圖3-36 NOT 元件圖................................................................................................32 圖3-37 3態buffer元件圖........................................................................................33 圖3-38 JK flip-flop...................................................................................................33 圖3-39 D flip-flop....................................................................................................34 圖3-40 LCD-32*2 文字型......................................................................................35 圖3-41 1行80*1 顯示位址與記憶體編號對照圖................................................35 圖3-42 2行40*2 顯示位址與記憶體編號對照圖................................................35 圖3-43 反組譯流程圖................................................................................................42 圖3-44 組譯流程圖....................................................................................................43 圖3-45 HEX範例.....................................................................................................44 圖3-46 IC的PIN位置............................................................................................45 圖3-47 B在A的左上方,或B在A的左方且Pb在A的上方..........................46 圖3-48 Pb在A的左下方或B在A右下或下方...................................................47 圖3-49 B在A右方,Pb在A元件上下範圍內.......................................................47 圖3-50 B在A左方,Pb在A元件上下範圍內........................................................48 圖3-51 B在A下或右下方,或B在A右方且B在A上下範圍內...................49 圖3-52 B在A上或右上方......................................................................................50 圖3-53 B在A的左方..............................................................................................51 圖3-54 B在A上方,且Pb在A左右範圍內......................................................52 圖3-55 B在A右、右下、下、左下方.................................................................53 圖3-56 B在A右、右上方......................................................................................53 圖3-57 B在A右、右上方、右下方......................................................................54 圖3-57 (A)為Pa在A的中間以上,3-57(B)為Pa在A的中間以下..................55 圖3-59 B在A右、右下方.....................................................................................56 圖3-60 B在A左、左下方.....................................................................................57 圖3-61 B在A上、右上、左上方.........................................................................58 圖3-62 Pb在Pa右上方..........................................................................................59 圖3-63 B在A左下、下方......................................................................................60 圖3-64 B在A右下方..............................................................................................60 圖3-65 B在A左上、上方.....................................................................................61 圖3-66 B在A右上、右、右下方..........................................................................62 圖3-67 B在A下、左下、左、左上、上方..........................................................63 圖3-68 B在A上、右方..........................................................................................64 圖3-69 B在A右下方.............................................................................................65 圖3-70 Pb在Pa左下方...........................................................................................65 圖3-71 Pb在Pa左方..............................................................................................66 圖3-72 B在A左上、左、左下、右下方、下、右、右上方..............................67 圖 3-73 B在A上方.................................................................................................68 圖4-1 基本目錄設定..................................................................................................70 圖4-2 8051目錄結構圖...........................................................................................70 圖4-3 模擬流程圖......................................................................................................71 圖4-4 程式執行外觀..................................................................................................72 圖4-5 元件圖..............................................................................................................73 圖4-6 選取物件圖......................................................................................................73 圖4-7 8051與七段顯示器線路連接圖...................................................................74 圖4-8 反組譯視窗......................................................................................................75 圖4-9 模擬執行功能選單..........................................................................................75 圖4-10 檔案功能選單................................................................................................77 圖5-1 廣告燈實驗電路連接圖..................................................................................78 圖5-2 廣告燈模擬執行畫面......................................................................................79 圖5-3 LCD顯示字串實驗電路連接圖....................................................................80 圖5-4 LCD模擬結果................................................................................................80 圖5-5 修改ROM記憶體內容...................................................................................81 圖5-6 修改LCD ROM內容後執行結果圖...............................................................81 圖5-7 修改ROM 0x63指令與內容...........................................................................81 圖5-8 修改0xb位址內容...........................................................................................82 圖5-9 修改0x19記憶體內容....................................................................................82 圖5-10 修改ROM後LCD執行結果.........................................................................83 圖5-11 將修改過的程式放入WinICE中執行結果.................................................83 圖5-12 LCD執行結果放大圖.................................................................................84

    [1]. 吳榮根(1990),微電腦系統與介面實驗,格致圖書公司。
    [2]. 陳龍三(1996),8051入門與介面控制,松崗電腦圖書公司。
    [3]. 吳一農(1999),單晶片8051實務(增修版) ,松崗電腦圖書公司。
    [4]. 吳金戌、沈慶陽、郭庭吉(1995),8051單晶片微電腦實習與應用,松崗電腦圖書公司。
    [5]. win ice 51/52使用手冊 windows 1.1,新華科技。
    [6]. 8XC51RA/RB/RC Hardware Description(1995),Intel Corporation。
    [7]. Mcs@51 Microcontroller Family User’s Manual(1994),Intel Corporation。
    [8]. HD 44780U(LCD-II) Dot Matrix LCD Controller and Driver,HITACHI。
    [9]. NT3881D Dot Matrix LCD Controller and Driver(1999),NOVATEK。
    [10]. Ivor Horton’s (1998),Beginning Visual C++ 6,Wrox Press。
    [11]. Stanley B. Lippamn & Jossée Lajoie(1998), C++ Primer ,Prentice Hall。

    QR CODE