大多数微控制器都有不错的 C 编译器,因此最好使用 C 语言进行编码,尽管您可能需要深入研究汇编例程以实现偶尔的高性能例程。微控制器的选择通常取决于硬件需求、板载外设、性能和成本限制。 您通常不会将代码从 Windows/Linux/Mac 环境移植到微控制器环境;您通常会直接为微控制器编写代码,因此严格来说,编译器是交叉编译器 - 在您的 PC 上编译以在不同的处理器上运行。通常,您可以在 IDE 中获得调试器、模拟器和完整的编辑器功能,因此其体验与在 PC 环境中编写代码类似,但运行速度较慢,并且必须下载到目标硬件或进行模拟才能进行测试。
Most microcontrollers have decent C compilers so are best coded for in C, although you might need to delve into assembly routines for occassional high performance routines. The choice of microcontroller is usually determined by the hardware demands, on board peripherals, performance and cost constraints. You wouldn't generally be porting code from a Windows/Linux/Mac environment to a microcontroller one; you would generally be writing directly for the microcontroller, so strictly the compiler is a cross compiler - compiling on your PC to run on a different processor. You typically get debuggers, emulators and full editor capabilities in the IDE, so its a similar experience to writing code in a PC environment, but it runs slower, and has to be downloaded to the target hardware or emulated to be tested.
发布评论
评论(1)
大多数微控制器都有不错的 C 编译器,因此最好使用 C 语言进行编码,尽管您可能需要深入研究汇编例程以实现偶尔的高性能例程。微控制器的选择通常取决于硬件需求、板载外设、性能和成本限制。
您通常不会将代码从 Windows/Linux/Mac 环境移植到微控制器环境;您通常会直接为微控制器编写代码,因此严格来说,编译器是交叉编译器 - 在您的 PC 上编译以在不同的处理器上运行。通常,您可以在 IDE 中获得调试器、模拟器和完整的编辑器功能,因此其体验与在 PC 环境中编写代码类似,但运行速度较慢,并且必须下载到目标硬件或进行模拟才能进行测试。
开始阅读有关嵌入式开发的权威人士是 Jack Gansle 和他的 固件手册。还有 www.embedded.com 用于一般文章。
Most microcontrollers have decent C compilers so are best coded for in C, although you might need to delve into assembly routines for occassional high performance routines. The choice of microcontroller is usually determined by the hardware demands, on board peripherals, performance and cost constraints.
You wouldn't generally be porting code from a Windows/Linux/Mac environment to a microcontroller one; you would generally be writing directly for the microcontroller, so strictly the compiler is a cross compiler - compiling on your PC to run on a different processor. You typically get debuggers, emulators and full editor capabilities in the IDE, so its a similar experience to writing code in a PC environment, but it runs slower, and has to be downloaded to the target hardware or emulated to be tested.
A great authority to start reading about embedded development is Jack Gansle and his firmware handbook. Also www.embedded.com for general articles.