建立Project時,路徑不可以有中文命名,因此要特別小心。
path:Project>Project Wizard
2) Setting Up Language Tools
選擇正確的assembler (MPASM assembler) 、linker for PIC MCU devices
path: Project>Set Language Tool Locations
Project> Select Language Toolsuite
3) Adding Files to the Project
- A source file has not yet been selected, so we will use an MPLAB IDE template file. The template files are simple files that can be used to start a project. They have the essential sections for any source file, and contain information that will help you write and organize your code.
- Next, add the second file for your project, the linker script. There is a linker script for each device. These files define the memory configuration and register names for the various parts.
4) Building the Project
path:Project>Build All
5)選擇build output window輸出訊息
patjProject>Build Options>Project
→MPASM Assembler tab
→Categories→Select "Output"
→Diagnostic level→Select "Errors only" or ...
6)Testing Code with the Simulator
要測試 code 時,軟體或是硬體需要去執行PIC MCU指令。
MPLAB IDE 提供三個debug tool。
Hardware tools有MPLAB ICE、MPLAB ICD 2,可以真正將 code在實際的device執行。
如果沒有device可使用,Software tool的 MPLAB SIM simulator 可以用來測試。
Path:Debugger>Select Tool
7) Processor Reset
會出現綠色箭頭show出程式開始的地方
path:Debugger>Reset>Processor Reset
沒有留言:
張貼留言