On 18 Jan 2012 at 17:14, Curt Vendel wrote:
I can use a $1.00 Atmega8A and easily implement a USB
keyboard and
connect an Atari 800 keyboard in a row/column matrix very easily.
Now going the other way around requires the port pins to be outputs
and you would use the same amount of pins for talking to a ps/2
keyboard as talking out as a USB device, you'll still need 2 pins for
clock lines and run at 12mhz for best results... You don't need to
throw a lot at this situation.
The USB keyboard and mice are special HID devices and not at all like
most other USB devices as I noted. As a counter-example, I suspect
you'll have a lot of trouble talking to a USB flash drive with an
ATMega8. In that sense, the ATMega8 isn't a true USB host. See my
cite on using a Mega32 to talk to a mouse--mothing to it.
Serving as host to a USB WiFi modem, on the other hand, is a real
project.
One of the more frequent questions on the MCU forums is "how do I
talk to a USB flash drive using a low-end AVR or PIC?". The answer
is that you don't--at least not without some external help.
--Chuck