完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
如果我用C语言生成程序,然后点击程序来编程,实际上会发生什么,C程序是如何转换成可以自己执行的呢?是把C编译成ASM然后编译成十六进制然后到芯片吗?我曾尝试谷歌,但不知道该搜索什么。芯片是如何理解什么的。谢谢,
以上来自于百度翻译 以下为原文 If I produce program in C language and then I click to program the device, what actually happens, how does the C program convert into something that can later be executed on its own? Is the C compiled into ASM then compiled into HEX then to the chip? I have tried to google but not sure what to search. How does the chip understand whats what. Thanks, |
|
相关推荐
4个回答
|
|
|
|
|
|
当然,这只会在安装C编译器之后发生。MPLABX不是一个。你没有提到你正在看的PIC家族,所以我不能说你需要哪一个编译器。
以上来自于百度翻译 以下为原文 Of course, this will only happen once you have installed a C compiler. MPLABX does not come with one. You did not mention what family of PICs you are looking at, so I can't say which compiler you need. |
|
|
|
你的理解是正确的。C编译器将你所写的代码编译成汇编代码,然后使用MPASM汇编成二进制(HEX),例如可以使用PICTIT3写入该设备。
以上来自于百度翻译 以下为原文 Your understanding is correct. The C compiler compiles what you wrote into assembly code which is then assembled using MPASM into binary (HEX) that can be written into the device using PICKIT3 for example. |
|
|
|
是的,消息1中的理解是正确的,但是在路上有很多细节,这个过程可能略有不同,这取决于编译器和链接器的使用,使用什么编程工具链,以及目标机器是什么。R是最典型的,如果安装了XC8编译器,在/DOCS目录中与编译器安装并行,则有XC8C编译器用户指南,它描述了如何对具有高级整体程序优化的编译器进行操作。它存储在类似于:C//程序文件(x)的地方。86)/Microchip /XC8/V1.42/DOCS/MPLABAXXC8YCCOMPILRIOR USER指南。PDFL是困难的:如果编译和链接用于调试,“.HEX”文件并不是没有产生或使用的。“ELF”文件,实际上是由链接器产生的,都需要为MicroCONT编程所需的所有信息。Road,并且在调试过程中还需要调试符号信息,因此,如果程序由调试器执行,则可能不需要'.HEX '文件。否则,“.HEX”文件将由一个从“.ELF”文件中提取信息的程序在单独的步骤中创建,并写入I。NTO十六进制文本,在一个文件中,你可以在文本编辑器中打开并查看它。它被许多在生产编程中使用的闪存编程工具所使用,并且由可以输入序列号的实用程序使用,并且对于每一个生成和编程的程序都是不同的。在PIC设备中,有一个单独的文档:Flash编程规范,你可以找到它,并从每个PIC设备的产品网页下载它。在途中有几个中间文件。可以在IDE中设置复选框,或者给命令行添加一个。为了保持这些,其中一些可能是有用的,如果追逐一个困难的bug,但可能有很多东西,很难知道在哪里搜索。
以上来自于百度翻译 以下为原文 Yes, the understanding in message #1 is correct as an overwiev. There is however a lot of details along the way, and the process may be slightly different, depending upon what compiler and linker is used, what programming toolchain is used, and what target machine is intended. While not the simplest, nor the most typical, if you have XC8 compiler installed, in /docs directory in parallel with the compiler installation, there is XC8 C Compiler user's guide, with descriptions of how it is done for a compiler that have advanced whole program optimization. It is stored somewhere like: C:/Program Files (x86)/Microchip/xc8/v1.42/docs/MPLAB_XC8_C_Compiler_User_Guide.pdf Just to be difficult: If compiling and linking for debugging, a '.hex' file is not nessesarily produced nor used. The '.elf' file, which is what may actually be produced by the linker, have all information needed to program the microcontroller, and also have debugging symbol information that will be needed during debugging anyway, so if programming is performed by the debugger, a '.hex' file may not be needed. Otherwise, the '.hex' file is created in a separate step by a program that extract information from '.elf' file, and write into hexadecimal text, in a file that you may open and look at in a text editor. It is used by many flash programming tools used in production programming, and by utility programs that may put in serial numbers and such that shall be different for each item produced and programmed. Then for every family of PIC devices, there is a separate document: Flash Programming Specification, you can find it and download it from the product webpage for each PIC device. There are several intermediate files produced along the way. It is possible to set a checkbox in the IDE, or give an addition to command line, to keep these. Some of these may be useful if chasing a difficult bug, but there may be a lot of stuff, and be difficult to know where to search. Regards, Mysil |
|
|
|
只有小组成员才能发言,加入小组>>
5158 浏览 9 评论
1997 浏览 8 评论
1926 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3169 浏览 3 评论
请问电源和晶体值之间有什么关系吗?PIC在正常条件下运行4MHz需要多少电压?
2222 浏览 5 评论
722浏览 1评论
605浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
493浏览 1评论
PIC Kit3出现目标设备ID(00000000)与预期的设备ID(02c20000)不匹配。是什么原因
619浏览 0评论
518浏览 0评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-19 05:23 , Processed in 1.251611 second(s), Total 55, Slave 48 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号