欧美极品高清xxxxhd,国产日产欧美最新,无码AV国产东京热AV无码,国产精品人与动性XXX,国产传媒亚洲综合一区二区,四库影院永久国产精品,毛片免费免费高清视频,福利所导航夜趣136

標(biāo)題: dsPIC33EP128GS706單片機調(diào)試環(huán)境搭建 [打印本頁]

作者: webohu    時間: 2024-5-15 14:11
標(biāo)題: dsPIC33EP128GS706單片機調(diào)試環(huán)境搭建
dsPIC33EP128GS706單片機調(diào)試環(huán)境搭建
1,    安裝MPLAB X IDE V5.10。
2,    安裝PIC33 16位單片機編譯器xc16。IDE對應(yīng)的是PICC編譯器。
3,    由于無法在X IDE中安裝mcc,需要單獨下載并安裝mcc。啟動腳本:C:\Program Files\Microchip\mcc\MccStandalone-5.5.1\startMcc.bat
4,    X IDE中File -> New Project,芯片選擇dsPIC33EP128GS706,調(diào)試工具選擇PICkit35,或者Simulator用于軟件仿真。后續(xù)可以雙擊項目修改。
5,    參考MFC電壓轉(zhuǎn)電流項目原理圖706.pdf,得知紅綠LED等配置如下,RED: RD0,GRN:RB5

6,    電路連接
PICkit3.5通過USB接電腦,通過以下接線連接板子。


板子上的P+/P-/PGND分別接開關(guān)電源的正負(fù)15v,V+/V-/COM。

否則X IDE可能會提示以下錯誤:
Target device was not found (could not detect target voltage VDD). You must connect to a target device to use PICkit 3.
7,    執(zhí)行mcc。
1)    在Pin Manager中,設(shè)置RD0和RB5為output。

2)    點擊Generate按鈕生成.c和.h文件,復(fù)制C:\Users\junha\.mcc目錄下的文件到步驟4中項目的目錄下,初始化入口system.c/SYSTEM_Initialize(),確保PIN_MANAGER_Initialize IO初始化正確。
TRISB = 0xFBDB;   
    TRISD = 0xFFFE;
8,    修改main.c,設(shè)置RED/GRN LED輸出。
void delay(int len)
{
    int i = 0;
    int d = 100;

    i = d * len;
    while(--i)
    {
    }
}
int main(void)
{
    // initialize the device
    SYSTEM_Initialize();
    while (1)
    {
        // Add your application code
        PORTB |= (1 << 5);               //滅燈
        PORTD &= ~(1 << 0);        //點亮
        delay(100000);
        
        PORTB &= ~(1 << 5);            //點亮
        PORTD |= (1 << 0);               //滅燈
        delay(100000);
    }
    return 1;
}
9,    編譯:Production -> Build Main Project
10,    軟件仿真。
1)    Debug Tool確保選擇Simulator。選擇這個模式后,燒錄按鈕灰掉了,不能燒錄。
2)    執(zhí)行Debug -> Debug Main Project,通過設(shè)置斷點,watch對應(yīng)的寄存器來調(diào)試。
11,    燒錄調(diào)試
執(zhí)行Make and Program Device Main Project. 日志如下:
****************************************************

Connecting to MPLAB PICkit 3...

Currently loaded firmware on PICkit 3
Firmware Suite Version.....01.54.00
Firmware type..............dsPIC33E/24E

Target voltage detected
Target device dsPIC33EP128GS706 found.
Device Revision ID = 4002
DEVSN0 = 00000000
DEVSN1 = 00000000
Device Erased...
Programming...
The following memory area(s) will be programmed:
program memory: start address = 0x0, end address = 0x7ff
Programming/Verify complete
12,    板子自動運行燒錄程序,分別點亮RED/GRN LED。



以上圖文的Word格式文檔下載(內(nèi)容和本網(wǎng)頁上的一模一樣,方便大家保存): dsPIC33EP128GS706單片機調(diào)試環(huán)境搭建0515.docx (904.82 KB, 下載次數(shù): 3)





歡迎光臨 (http://www.raoushi.com/bbs/) Powered by Discuz! X3.1