problem with LEDControl example

General discussions about V-USB, our firmware-only implementation of a low speed USB device on Atmel's AVR microcontrollers
tombaugh
Posts: 11
Joined: Sat Nov 14, 2009 5:34 pm

Re: problem with LEDControl example

Post by tombaugh » Fri Nov 20, 2009 4:50 pm

Saimon wrote:As i remember, mega8 use #reset pin combined with another some port pin. May be use forget to pull-up reset or configure it wrong?
Best regards, Saimon!


There's a pull-up resistor on reset, you can see it behind the bunch of wires. I tried to just blink the led on this setup (no usb) and that worked fine...

maxi
Rank 3
Rank 3
Posts: 122
Joined: Fri Jul 24, 2009 6:13 pm

Re: problem with LEDControl example

Post by maxi » Fri Nov 20, 2009 7:48 pm

I still can't see where the problem is but here are a few suggestions you may or may not have already tried.

1. I don't see the 100n cap anymore, I would recommend you include that as well as the 4u7 (10u should be fine btw)

2. Test resistance beetween the 'A' end of the usb cable and the actual uC pins. Also test that D+ & D- are not shorted.

3. Try different values for the pull-up on D- (1K - 2K2)

4. Try a different xtal if you have one, and/or try it with the calibrated internal RC method.

5. Try a different uC if you have one.

6. Try a different example project, maybe HID data.


I'm sure it'll just be something simple, best of luck!

tombaugh
Posts: 11
Joined: Sat Nov 14, 2009 5:34 pm

Re: problem with LEDControl example

Post by tombaugh » Fri Nov 20, 2009 9:26 pm

maxi wrote:I still can't see where the problem is but here are a few suggestions you may or may not have already tried.

1. I don't see the 100n cap anymore, I would recommend you include that as well as the 4u7 (10u should be fine btw)

2. Test resistance beetween the 'A' end of the usb cable and the actual uC pins. Also test that D+ & D- are not shorted.

3. Try different values for the pull-up on D- (1K - 2K2)

4. Try a different xtal if you have one, and/or try it with the calibrated internal RC method.

5. Try a different uC if you have one.

6. Try a different example project, maybe HID data.


I'm sure it'll just be something simple, best of luck!


Ok, I think we may be getting somewhere. I first tried 1, 2 (67.8 and 68.7 Ohm), 3 and 4. I then tried another atmega8 but that one appears to be broken because I couldn't program it. But then I tried another one which I thought was broken, because LEDs connected to PORTC were always very faint no matter which resistor I used. When I connect using that one, dmesg says

Code: Select all

[34374.430024] usb 5-2: new low speed USB device using ohci_hcd and address 118
[34374.616128] usb 5-2: configuration #1 chosen from 1 choice


lsusb gives me

Code: Select all

Bus 005 Device 118: ID 16c0:05dc VOTI USBasp AVR Programmer


although the programmer is not connected anymore. Of course the host software says

Code: Select all

Could not find USB device "LEDControl" with vid=0x16c0 pid=0x5dc


but at least it appears to be connected. What should I do next?

Thanks a lot for the assistance!
Pieter

edit: I tried it on my netbook as well, and there the device shows up as "VOTI" in the lsusb list.

maxi
Rank 3
Rank 3
Posts: 122
Joined: Fri Jul 24, 2009 6:13 pm

Re: problem with LEDControl example

Post by maxi » Sat Nov 21, 2009 5:16 pm

Well, it could be that libusb is mistaking the LEDControl for your USBasp programmer. I have experienced similar situations under Windows when I have had connected multiple V-USB devices, probably because they all share the same VID & PID but I'm not entirely sure. The problem is resolved under Windows by simply removing the device in 'Device Manager' and opting to delete the driver software. A scan for hardware changes usually then identifies the device correctly. Not sure of the exact procedure for linux though.

tombaugh
Posts: 11
Joined: Sat Nov 14, 2009 5:34 pm

Re: problem with LEDControl example

Post by tombaugh » Sat Nov 21, 2009 6:19 pm

maxi wrote:Well, it could be that libusb is mistaking the LEDControl for your USBasp programmer. I have experienced similar situations under Windows when I have had connected multiple V-USB devices, probably because they all share the same VID & PID but I'm not entirely sure. The problem is resolved under Windows by simply removing the device in 'Device Manager' and opting to delete the driver software. A scan for hardware changes usually then identifies the device correctly. Not sure of the exact procedure for linux though.


I removed the code which checks the vendor and product names from the host software, and it works fine! Any thoughts on getting these names right in Ubuntu?

maxi
Rank 3
Rank 3
Posts: 122
Joined: Fri Jul 24, 2009 6:13 pm

Re: problem with LEDControl example

Post by maxi » Sat Nov 21, 2009 6:44 pm

tombaugh wrote:Any thoughts on getting these names right in Ubuntu?


I suspect that it's more a libusb issue than an OS specific one. Problem is that it's unconventional for two entirely different devices to have the same PID & VID, I guess the proper answer would be to use a unique VID/PID for each V-USB device but then that might not always be practical.

Post Reply