关键词不能为空

当前您在: 主页 > 英语 >

新手 高手必看:dsPIC编程开发指南Microchip dsPIC Programming Notes

作者:高考题库网
来源:https://www.bjmy2z.cn/gaokao
2021-02-13 11:10
tags:

-

2021年2月13日发(作者:inauguration)


Microchip dsPIC Programming Notes



Microchip has provided very good documentation and tutorial on their website, you can


get yourself started with the resources. Here I'd like to present a few notes from my experience


of programming with MPLAB IDE and dsPIC30F family chips to save your time.



1. Startup Function




If you use the Project Wizard in MPLAB to create a project, you need to supply a main


function in order for the project to build successfully. The wizard uses the startup function from


library file, e.g., libp30F6010A-coff.a. After the initialization of the stack pointer register,


the stack size register, PSV and data, the startup code calls function main() in which your


application code starts.



If you want to have your own startup code, it is strongly recommended to use the supplied


source crt0.s and crt1.s as a baseline, and give a name other than the default names (crt0.s,


crt1.s) to your startup code, and make sure the following three global variables of function type


exist in your startup code:




__reset



__resetPRI



__resetALT



In case any of the above symbols is missing from your startup file, the linker will


supplement it from the default library.



2. Build Options




Build option settings shall be set up at the beginning of project development. It is easier


for one to understand if the project files are organized in logical hierachy. Suppose I have the


following project folder structure. All header files and includes files are stored in


Header


subfolder, all source files are stored in


Source


subfolder (you may create modular subfolders


under this folder), all the generated intermediary files are stored in


Obj


subfolder, and all


output files are stored in


Output


subfolder.





Figure 2-1 Project file structure



First, add all source files to


Source Files


folder and all include files to


Header Files


folder


in the project view.





Figure 2-2 Project view



Then, click menu Project->Build Options->Project, set up


Directories


tab to set up


directories and search path. The relative path is dependent on the


selection at the lower part of the tab. If the first option is checked, the path is relative to


source-file directory except link output; if the second option is checked, the path is relative to


the project directory. The following examples are based on the first option being checked.



Because Output Directory path is where builds (.hex, .map, etc) are stored, and relative to


project root, so set it as


.Output


.




Figure 2-3 Build Options - Output Directory



Intermediary Directory is where obj files are stored, and relative to source file directory as


the first Build Directory Policy



is checked, so set it as


..Obj


.




Figure 2-4 Build Options - Intermedary Directory



Assembler include search path is where all include files are stored, and relative to source


file directory as the first Build Directory Policy



is checked, so set it as


..Header


.





Figure 2-5 Build Options - Assembly Include Search Path



Similarly, Include search path is where all C header files are stored, and relative to C


source directory as the first Build Directory Policy



is checked, so set it as


..Header


.




Figure 2-6 Build Options - Include Search Path



Depening on build needs, set up other build tabs. The following pictures show Link30 tab


General category and Diagnostics category settings.



-


-


-


-


-


-


-


-



本文更新与2021-02-13 11:10,由作者提供,不代表本网站立场,转载请注明出处:https://www.bjmy2z.cn/gaokao/649658.html

新手 高手必看:dsPIC编程开发指南Microchip dsPIC Programming Notes的相关文章

  • 余华爱情经典语录,余华爱情句子

    余华的经典语录——余华《第七天》40、我不怕死,一点都不怕,只怕再也不能看见你——余华《第七天》4可是我再也没遇到一个像福贵这样令我难忘的人了,对自己的经历如此清楚,

    语文
  • 心情低落的图片压抑,心情低落的图片发朋友圈

    心情压抑的图片(心太累没人理解的说说带图片)1、有时候很想找个人倾诉一下,却又不知从何说起,最终是什么也不说,只想快点睡过去,告诉自己,明天就好了。有时候,突然会觉得

    语文
  • 经典古训100句图片大全,古训名言警句

    古代经典励志名言100句译:好的药物味苦但对治病有利;忠言劝诫的话听起来不顺耳却对人的行为有利。3良言一句三冬暖,恶语伤人六月寒。喷泉的高度不会超过它的源头;一个人的事

    语文
  • 关于青春奋斗的名人名言鲁迅,关于青年奋斗的名言鲁迅

    鲁迅名言名句大全励志1、世上本没有路,走的人多了自然便成了路。下面是我整理的鲁迅先生的名言名句大全,希望对你有所帮助!当生存时,还是将遭践踏,将遭删刈,直至于死亡而

    语文
  • 三国群英单机版手游礼包码,三国群英手机单机版攻略

    三国群英传7五神兽洞有什么用那是多一个武将技能。青龙飞升召唤出东方的守护兽,神兽之一的青龙。玄武怒流召唤出北方的守护兽,神兽之一的玄武。白虎傲啸召唤出西方的守护兽,

    语文
  • 不收费的情感挽回专家电话,情感挽回免费咨询

    免费的情感挽回机构(揭秘情感挽回机构骗局)1、牛牛(化名)向上海市公安局金山分局报案,称自己为了挽回与女友的感情,被一家名为“实花教育咨询”的情感咨询机构诈骗4万余元。

    语文
新手 高手必看:dsPIC编程开发指南Microchip dsPIC Programming Notes随机文章