对设备编程感兴趣。从哪里开始
全部 我对 C++ 有很好的掌握,但我从来没有做过任何关于设备编程的事情。我对数字逻辑设计有一些基本的了解。但我在电子领域完全是菜鸟。目前我对微控制器编程产生了浓厚的兴趣。
从哪里开始?
我认为人们并不需要拥有大量的电子知识才能在微控制器上运行程序。
我正在使用Linux。我已经下载了Keil。从未尝试过通过 Wine 来运行它。我已经在 Windows 中运行过了。但我并不完全清楚代码是如何工作的。虽然我可以理解用 C 编写的逻辑。但对我来说它仍然像一团雾。
我只需要一个快速启动。
All
I've a Good Command over C++, But I've never done anything anything on device programming. I've some basic understanding on Digital Logic Design. But I am complete Noob in Electronics. Currently I am getting huge interest on microcontroller Programming.
Where To Start ?
I don't think one really needs to have huge amount of knowledge on electronics to run a program on a microcontroller.
I am using Linux. and I've downloaded Keil. never tried to run it through Wine. I've ran it in Windows. But how the code works is not completely clear to me. though I can understand Logic as its written in C. But Its still like a Fog to me.
I Just need a Quick Kickstart.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
SO 不是提出此类问题的最佳网站。 PC 编程和嵌入式系统编程之间确实存在很大区别,其他 SE 站点专门从事物理计算。周二我收到了罗伯特·卡泰诺发来的这封电子邮件:
因此,请访问 electronics.stackexchange.com ,并浏览 chiphacker.com 当你等待的时候。看看 Chiphacker 上的这些问题:
在规划嵌入式系统编程的入门路径时,您应该考虑一些事项。
我在以下段落中概述了一些选项。
您标记了您的问题
linux-device-driver
,这是否意味着您想要制作一个在 Linux 中使用的自定义设备?如果您指的是embedded-linux
,那么您就进入了更大类别的微控制器。我建议您看看 BeagleBoard,也看看 这个 Chiphacker 问题了解一些其他选项。如果您想做嵌入式 Linux,并且想要构建自己的主板,您首先需要在更简单的嵌入式系统设计级别上积累一些经验。您还标记了您的问题
avr
,这是 Atmel 制作的流行微控制器类(查看 avrfreaks论坛了解更多信息)。我开始在ATmega324p上学习嵌入式系统;它们确实有很棒的文档,易于使用,并且与大多数其他处理器相比,avr 的在线站点更多。如果您想要更轻松的学习曲线,我建议您查看 Arduino 环境。它使用 Wiring,与 C/C++ 非常相似,并且 Arduino 可以通过 '盾牌,这是可以插入 Arduino 主板以添加功能的模块。这是您的快速启动。
一个好的学习路径是熟悉 Arduino,然后构建自己的 AVR 板(可能是 Linux 设备,如操纵杆),然后使用 基于 ARM 的开发套件,最后继续构建您自己的嵌入式 Linux 板。如果您不介意陡峭的学习曲线,您可以跳过几个步骤;如果给定级别的功能满足您的需求,您可以在学习过程中的任何一点停止。确实,您不一定需要“大量的电子知识才能在微控制器上运行程序”,但在尝试点亮 LED 或连接两个设备之前,您应该了解一些基本知识,例如电压和电流。
最后,你在问题中说你已经安装了Keil IDE。虽然这是一个很好且相当流行的 IDE,但我建议您学习使用基于 gcc 的命令行工具链。使用嵌入式系统时,可能会以多种方式出现问题,而 IDE 在发生的所有情况之上添加了一层魔力。虽然这可能很好,但我强烈主张在尝试学习该系统时尽量减少魔力。当事情不能自动工作时,你需要了解底层的东西。这个建议在使用 Arduino 时并不适用,Arduino 的设计目的是(并且确实)使所有自动功能都能正常工作。
SO is not the best site to ask this kind of question. There's really a large distinction between programming for a PC and programming for an embedded system, other SE sites specialize in physical computing. I got this email from Robert Cartaino on Tuesday:
So, go commit to electronics.stackexchange.com, and browse chiphacker.com while you wait. Take a look at these questions on Chiphacker:
There are a few things you should consider when planning your entry path to embedded systems programming.
I've outlined a few options in the following paragraphs.
You tagged your question
linux-device-driver
, does this mean that you want to make a custom device to use in Linux? If you meantembedded-linux
, then you're into a larger class of microcontrollers. I suggest that you look at the BeagleBoard, also look at this Chiphacker question for some other options. If you want to do embedded linux, and want to build your own board, you'll first need to build up some experience in simpler levels of embedded systems design.You also tagged your question
avr
, which is a popular microcontroller class made by Atmel (check out the avrfreaks forum for more info). I started learning embedded systems on the ATmega324p; they really have great documentation, are easy to use, and there are more sites online for the avr than most any other processor.If you want an easier learning curve, I suggest taking a look at the Arduino environment. It uses Wiring, which is very similar to C/C++, and the Arduino can be enhanced with 'shields', which are modules that can be plugged into the Arduino main board to add functionality. This is your Quick Kickstart.
A good learning path would be to get familiar with the Arduino, then build your own AVR board (possibly a Linux device, like a joystick), then work with an ARM-based development kit, and finally move on to to building your own embedded linux board. You can skip a few steps if you don't mind a steep learning curve, or stop at any point along the way if a given level's capabilities satisfy your needs. You don't necessarily need a "huge amount of knowledge on electronics to run a program on a microcontroller", it's true, but you should understand some basic things like voltage and current before you try to light an LED or connect two devices.
Finally, you said in your question that you've installed the Keil IDE. While this is a fine and rather popular IDE, I'd suggest that you learn using a gcc-based command line toolchain. There are a staggering number of ways in which things that can go wrong when working with embedded systems, and an IDE adds a layer of magic on top of everything that happens. While this can be nice, I'm a strong advocate of minimizing the magic when trying to learn the system. You need to understand the low-level stuff when things don't work automagically. This advice doesn't apply when using the Arduino, which is designed to (and does) make all of the automagical stuff work well.
Sparkfun.com 有很多板、arduino 系列等。我推荐使用armmite pro、lillypad而不是arduino pro,因为不涉及焊接,因为您需要/想要正确的USB转串口/电源。 mbed2 的成本稍高,蓝色 LED 刺眼,但易于使用。对于以上任何一个,您都不需要在沙盒中玩,您可以使用罐装环境等,但不是必需的。
如果你是 Linux 开发,我推荐 hawkboard.org 而不是 beagleboard.org,为了使 beagleboard 的使用成本大约是板本身的两倍,hawkboard 只需购买一些东西来为其供电即可使用。但你可以只在台式机/笔记本电脑上学习 Linux 驱动程序,而不必搞乱嵌入式。
模拟器是一个好的开始。 Qemu 是个好东西,可以模拟许多处理器,非常适合模拟虚拟 Linux 系统、学习 Linux 驱动程序开发等。但了解(虚拟/模拟)处理器正在做什么并不是目标。我发现拥有可见性很有用。 gdb 还包含一些模拟器。 mame 装载了它们,但就像 qemu 是为快速仿真而不是为教育而设计的。视觉男孩进步很好。仿真从来都不是完美的,因此最终您希望在硬件上运行,但仿真器和编译器工具是免费的,您可以在购买硬件之前学习很多东西。不过,有相当多的内容是您无法从模拟器中学到的,例如将程序加载到闪存/RAM、使用 jtag 或其他接口进行调试。 i2c、spi 等
sparkfun.com has a lot of boards, arduino family and other. I recommend the armmite pro, the lillypad instead of the arduino pro because there is no soldering involved, for either you will need/want the correct usb to serial/power. The mbed2 costs a little more, the blue leds are brutal on the eyes, but easy to use. For none of the above are you required to play in their sandbox, you can use the canned environment, etc but not required.
if it is linux development you are after I recommend the hawkboard.org over the beagleboard.org, to make the beagleboard useable costs about twice as much as the board itself, the hawkboard is usable by only buying something to power it. But you can just learn linux drivers on your desktop/laptop and dont need to mess with embedded necessarily.
Emulators are a good start. Qemu is good stuff, emulates a number of processors, great for emulating virtual linux systems, learning linux driver development, etc. But getting visibility into what the (virtual/emulated) processor is doing is not the goal. I find it useful to have visibility. gdb includes a few emulators as well. mame is loaded with them, but like qemu designed for fast emulation and not for education. visual boy advance is good. Emulation is never perfect, so eventually you want to run on hardware, but emulators and compiler tools are free and you can learn quite a bit before you have to buy hardware. There is a considerable amount you cannot learn from an emulator though, loading your programs into flash/ram, debugging using jtag or other interfaces. i2c, spi, etc.