关键词不能为空

当前您在: 主页 > 英语 >

新手 高手必看: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的相关文章

  • 爱心与尊严的高中作文题库

    1.关于爱心和尊严的作文八百字 我们不必怀疑富翁的捐助,毕竟普施爱心,善莫大焉,它是一 种美;我们也不必指责苛求受捐者的冷漠的拒绝,因为人总是有尊 严的,这也是一种美。

    小学作文
  • 爱心与尊严高中作文题库

    1.关于爱心和尊严的作文八百字 我们不必怀疑富翁的捐助,毕竟普施爱心,善莫大焉,它是一 种美;我们也不必指责苛求受捐者的冷漠的拒绝,因为人总是有尊 严的,这也是一种美。

    小学作文
  • 爱心与尊重的作文题库

    1.作文关爱与尊重议论文 如果说没有爱就没有教育的话,那么离开了尊重同样也谈不上教育。 因为每一位孩子都渴望得到他人的尊重,尤其是教师的尊重。可是在现实生活中,不时会有

    小学作文
  • 爱心责任100字作文题库

    1.有关爱心,坚持,责任的作文题库各三个 一则150字左右 (要事例) “胜不骄,败不馁”这句话我常听外婆说起。 这句名言的意思是说胜利了抄不骄傲,失败了不气馁。我真正体会到它

    小学作文
  • 爱心责任心的作文题库

    1.有关爱心,坚持,责任的作文题库各三个 一则150字左右 (要事例) “胜不骄,败不馁”这句话我常听外婆说起。 这句名言的意思是说胜利了抄不骄傲,失败了不气馁。我真正体会到它

    小学作文
  • 爱心责任作文题库

    1.有关爱心,坚持,责任的作文题库各三个 一则150字左右 (要事例) “胜不骄,败不馁”这句话我常听外婆说起。 这句名言的意思是说胜利了抄不骄傲,失败了不气馁。我真正体会到它

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