Building an USB peripherial
I would like to control an RC model via USB from my computer. I don't need a real radio control, so controlling the servos directly through cables is sufficitent (yes, there will be cables between the model and the controlling unit). I thought I would build some microcontroller-based device which would be connected to the computer via USB and the servos would be connected to this device.
I'm asking for some hint where I should start. I know how servos are controlled and how should I eventually progr开发者_C百科am the microcontroller to control the servos, but the thing I really don't know much about is the USB communication neither on the device side nor the computer side (which will be Linux).
I would like to do the progamming in C (maybe Assembler for the microcontroller).
Thanks for every hint.
The easiest way will be to use an RS232 to USB bridge, like the chipsets offered from FTDI. This will simplify both your hardware and pc software design (no USB driver required). Most microcontrollers have at least one RS232 port to connect to.
Some micro-controllers offer USB support. In that case you would need to do some USB programming in them and use libusb on the PC side.
You might want to start with something like an Arduino, which is a microcontroller on a separate board that you can talk to over USB. There's great development environments and community for Arduino projects.
If you use an FTDI chip alone, you will still need something to understand the RS232 serial instructions from the computer and to control the servo lines. This is where the Arduino will be really helpful.
USB is a fairly complicated to manage system, and many people choose to use an existing serial over USB chip to avoid having to write OS drivers and also avoid the complexities of programming the gadget side of USB. If you're interested in robots and not already familiar with USB then this is probably the best route.
精彩评论