USB programming

前端 未结 10 1802
不思量自难忘°
不思量自难忘° 2021-01-30 11:19

I want to program a microcontroller (AVR) to control some leds through USB. It\'s just out of interest in how to build and program USB devices. There are some AVR microcontrolle

10条回答
  •  后悔当初
    2021-01-30 12:16

    That sounds like a great project! I'd suggest starting off with something a little simpler since you're - as you say - a "total n00b". I'm not sure what hardware you currently have (or have in mind) but what I would suggest for the total beginner is the STK500. It's a development board that's very well supported in both Linux and Windows and will give you the most flexibility. It comes with LEDs and switches built in for your projects, but you will need to get a microcontroller. And for that I recommend the ATMega32, a great multi-purpose IC that's also well supported and has lots of documentation on the web.

    Once you get those I suggest you do your development on Linux using avr-gcc (make sure to also install avr-libc). If you're using Ubuntu it's easy to get all the packages you need:

    % sudo apt-get install gcc-avr avr-libc avrdude
    

    Those should get you up and running. I'd suggest Googling around for help writing your first programs but another good resource is the online materials for this class at Cornell.

    That's enough to get your feet wet with AVR microcontrollers and the development tools. The sky is the limit at that point but since you said you want to get into USB I'd suggest using the excellent V-USB framework to have your ATMega32 act as a USB device. After that, as they say, the steps to flipping LEDs are a piece of cake :).

提交回复
热议问题