1. 程式人生 > >PIC常見錯誤(持續更新)

PIC常見錯誤(持續更新)

1. Error - processor types do not agree across all input files.

    Solution
This error typically occurs when you have selected the wrong linker script file.
Double click on the linker script in the Project Tree and make sure you are using the correct linker script for the device you have selected under Configure>Select Device.

      建工程時的Device ( Configure>Select Device設定 ) 與 Linker Script資料夾下面包含的 .lkr檔案 不匹配

2. 出現了could not find file ‘c018i.o’錯誤

    project -> build options -> project -> directories

 對include serach path 和 library serach path等新增(點NEW)預設路徑就行了,一般指向C:/mcc18/h   C:/mcc18/lib

3.PIC18F4550的RAM地址和ROM地址不相容

PIC18F4550採用的是哈佛結構,並且是分別編址的,因此如果一個數據儲存在ROM區,然後用RAM指標去強制轉換,是不起作用的。

所用指標必須和資料儲存區域一樣。

RAM體系也是用哈佛結構,但是是統一編址,不存在這個問題。

 

4、Pickit 3 - MPLAB Target device ID does not match 

google上的辦法很多都試過, downgrade framework等都不行.後來看到一貼的方法:

把usb插到可直接供電的usb口(機箱的前置USB口)就可以了.

後來又遇到類似問題,換了別的晶片。覺得有點扯淡。自己摸索了一下,估計是以下問題導致:

1. 如果讀出來的Target device ID是0, 原因有二(我所知道的):一,pickit 3壞了(這個可能性較小); 二,引腳接觸不良或者不正確(我的就是這個原因)。

2. 如果讀出來的Target device ID非零,但又不匹配,請檢查你開發環境的IC型號是否選擇正確了。