This project's goal is to build a device that connects to the PC's USB-port. It doesn't do anything, it just tells the computer it's there. The purpose is to learn about V-USB and to have a starting point for new projects. Both the hardware and the software is kept simple.
Hardware
Based on a ATTiny25. Two 1N4148 in the USB power line, 100n and 10-47u capacitors over plus and ground.
68 ohm resistors on D+ and D-, 1k5 pull-up on D-.
This device is powered from USB, no external powersource is used.
I'm not yet convinced how to set the and USB_CFG_VENDOR_ID and USB_CFG_DEVICE_ID for my non-commercial project. I don't own a VID/PID .
Note: Not convinced on the fuse settings, have used Windows and AVR Studio to set the fuses:
spien enabled
bod disabled
Nothing else marked
pll clock, startuptime pwrdwn/reset:1k ck/14 +4ms
Ext 0xff
high 0xDF
low 0xc1
The code builds to a size of 1682 bytes. When mounted in the target board it seems to do nothing, but dmesg says:
new low speed USB device using ehci_hcd and address 101
[314209.638232] usb 1-5.4: configuration #1 chosen from 1 choice
[314218.822680] usb 1-5.1: usbfs: USBDEVFS_CONTROL failed cmd lsusb rqt 128 rq 0 len 2 ret -110
lsusb -v|less
Bus 001 Device 101: ID c016:df05
...
iManufacturer 1 patrikhermansson.se
iProduct 2 usb-test
...
MaxPower 100mA
...
It's working with a error message. Guess the PC gets a little upset when the usbFunctionSetup() just contains "return 0". When less is showing the info this pops up:
":cannot read device status, Connection timed out (110)"
Forum thread at Obdev