C++ 在哪里学习硬件编程?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/7754315/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Where to learn Hardware Programming?
提问by monk
I have been doing some web development, and now I want to know further more about programming so, these Hardware Programming stuffs excite me. I could not find a proper place to start to learn this process. So can you provide any better place ? I want to know better about C or C++ to do hardware programming. Is there any place so that I could get knowledge from start ?
我一直在做一些 web 开发,现在我想进一步了解编程,所以这些硬件编程的东西让我兴奋。我找不到合适的地方开始学习这个过程。那么你能提供任何更好的地方吗?我想更好地了解 C 或 C++ 来进行硬件编程。有什么地方可以让我从一开始就获得知识吗?
Thank you.
谢谢你。
采纳答案by old_timer
There are boards you can get for $10 or less that have things like leds that you can start with getting comfortable programming at that level, then expand that knowledge. I have example programs for a number of sub $100 (usually under $50) boards at github.
有些板子你可以花 10 美元或更少的钱买到,里面有 LED 之类的东西,你可以从在那个级别开始舒适地编程,然后扩展知识。我在 github 上有一些低于 100 美元(通常低于 50 美元)的板的示例程序。
The msp430 launchpad is $4.30 for example and the stm32 value line discovery is around $10.
例如,msp430 启动板的价格为 4.30 美元,而 stm32 价值线发现价格约为 10 美元。
I have not posted arduino examples at github although I have many avr based examples out in the world. The arduino is probably where you will want to spend some time, there is a long list of things you can plug into an arduino board, called "shields" in the arduino jargon. you can do wireless stuff, robotics, gps stuff. They appear to have done a good job creating a user friendly C(/C++?) with api calls environment, etc. sparkfun.com is a good place for all kinds of embedded development/eval boards plus a number of arduino items (not all that is out there of course). ti.com is the home of the msp430 and the stellaris line of ARM cortex-m devices. The eval boards for the stellaris family are jam packed with peripherals that you can learn to program.
尽管我在世界上有许多基于 avr 的示例,但我还没有在 github 上发布 arduino 示例。arduino 可能是您想要花一些时间的地方,有很多东西可以插入 arduino 板,在 arduino 行话中称为“盾牌”。你可以做无线的东西,机器人,gps的东西。他们似乎在创建用户友好的 C(/C++?) 和 api 调用环境等方面做得很好。 sparkfun.com 是各种嵌入式开发/评估板以及许多 arduino 项目(并非所有那当然就在那里)。ti.com 是 msp430 和 stellaris 系列 ARM cortex-m 设备的所在地。stellaris 系列的评估板塞满了您可以学习编程的外围设备。
If you are not comfortable being this deeply embedded and want to run with an operating system. You are getting into the $100 to $300 range for the system but they are out there, embeddedarm.com and gumstix for example (note the robovero for example is not a full blown linux platform it is closer to the platforms I have described above, microcontroller based).
如果您对这种深度嵌入感到不舒服并希望与操作系统一起运行。您的系统价格在 100 美元到 300 美元之间,但它们就在那里,例如embeddedarm.com 和gumstix(注意,例如robovero 不是一个成熟的linux 平台,它更接近我上面描述的平台,微控制器基于)。
Things you will want to learn after the basics of just booting the processor would be spi and i2c and other similar, common, interfaces. some controllers have dedicated hardware to do the dirty work for you and some you simply bit bang. Learning to bit bang these is critical as even in your desktop or laptop computer there are i2c interfaces that linux bitbangs on in drivers.
在刚刚启动处理器的基础知识之后,您将要学习的内容是 spi 和 i2c 以及其他类似的通用接口。一些控制器有专门的硬件来为你做肮脏的工作,而有些你只是简单地敲了一下。学习 bitbang 这些是至关重要的,因为即使在您的台式机或笔记本电脑中,Linux bitbangs 驱动程序中也有 i2c 接口。
Expect to kill some hardware, either by bricking the board so it cannot boot and is not recoverable, or quite literally "letting the smoke out" of some parts. In short I definitely would not invest $300 or anything like that into a single board/platform for this education. You can buy many $25 boards and trash/destroy most of them while learning. I almost always buy two of whatever the first time just in case. These days I dont usually let the smoke out but have instead bricked a number of boards. When you get into making your own bootloader that is a risk. This would be similar to writing desktop applications and occasionally, accidentally, overwriting an output file, or opening a file that you wanted to read as a open to write and losing the file, that sort of thing, bugs happen.
期望杀死一些硬件,或者通过将电路板变砖使其无法启动且无法恢复,或者从字面上“让烟雾消失”某些部分。简而言之,我绝对不会为这种教育投资 300 美元或类似的东西到一个单一的董事会/平台上。您可以在学习的同时购买许多 25 美元的木板并丢弃/销毁其中的大部分。我几乎总是第一次买两个以防万一。这些天我通常不放烟,而是用砖砌了一些板。当您开始制作自己的引导加载程序时,这是一种风险。这将类似于编写桌面应用程序,偶尔会意外地覆盖输出文件,或者打开一个您想读取的文件作为打开写入和丢失文件,诸如此类的事情,会发生错误。
the msp430 launchpad is so cheap might as well just get one or a few, a very good instruction set, etc. you will probably settle in with the arduino, an arduino uno is not a bad first board, the mbed on the arm side is not bad, you dont have to use their web based thing at all, you can use any compiler you want. Arm dominates the processor market, every second or third thing with an on/off switch (including an increasing number of Intel based laptops) have one or more ARMs in them running something. avr is nowhere near that and wont be, it dominates the hobby market but not the rest of the world, so arm knowledge at some point will greatly benefit you.
msp430 launchpad 太便宜了,不如只买一个或几个,一个非常好的指令集等。你可能会适应 arduino,arduino uno 不是一个糟糕的第一块板,手臂侧的 mbed 是不错,您根本不必使用他们基于 Web 的东西,您可以使用任何您想要的编译器。Arm 在处理器市场占据主导地位,每秒钟或第三个带有开/关开关的东西(包括越来越多的基于 Intel 的笔记本电脑)都有一个或多个 ARM 在运行。avr 远非如此,也不会如此,它主导着业余爱好市场,但不是世界其他地区,因此在某些时候掌握知识将对您大有裨益。
回答by Prof. Falken contract breached
回答by neurotix
You might want to read about Embedded programmingthen.
那么您可能想阅读有关嵌入式编程的内容。
回答by Janick Bernet
We used VHDLto program FPGAs back in university. That's pretty lowlevel, as you are connecting logical gates to generate algorithms and have to also pay attention to timing. I don't know if that's really what you want and if nowadays there maybe are better tools for that kind of thing, but I think it should give you a good pointer to start.
我们在大学时使用VHDL对FPGA进行编程。这是相当低级的,因为您正在连接逻辑门以生成算法,并且还必须注意时序。我不知道这是否真的是你想要的,现在是否有更好的工具来做这种事情,但我认为它应该给你一个很好的开始。
回答by SKi
Maybe a development kit is best way to start. Usually there are C or asm compiler, documentation, examples, cables and a development board in kits. With a development kit, there is no need to learn anything about device drivers of operating systems. So it is quite easy to start.
也许开发套件是最好的开始方式。通常有 C 或 asm 编译器、文档、示例、电缆和套件中的开发板。使用开发套件,无需了解操作系统的设备驱动程序。所以很容易上手。