Page 1 of 1

Could not find USB device "LEDControl" (atmega324p)

Posted: Tue Mar 01, 2011 12:38 am
by jferguson
I'm trying to get the custom-class example to work with an atmega324p. I can compile and flash the firmware without issue, but the set-led program doesn't work.

I went through and modified the files so the appropriate fuse bits are set, and the appropriate pins are chosen for D+ and D-

The full error I get is:
"Could not find USB device "LEDControl" with vid=0x16c0 pid=0x5dc"

When I run lsusb:

Code: Select all

johnny@picard:$ lsusb

Bus 002 Device 025: ID 16c0:05dc VOTI USBasp AVR Programmer

Bus 002 Device 005: ID 03f0:2504 Hewlett-Packard
Bus 002 Device 004: ID 06a3:8021 Saitek PLC Eclipse II Keyboard
Bus 002 Device 003: ID 058f:9254 Alcor Micro Corp. Hub
Bus 002 Device 002: ID 045e:00d1 Microsoft Corp. Optical Mouse with Tilt Wheel
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 010: ID 0781:74c3 SanDisk Corp.
Bus 001 Device 003: ID 0c0b:b159 Dura Micro, Inc. (Acomdata)
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub


A more detailed dump:

Code: Select all

Bus 002 Device 025: ID 16c0:05dc VOTI USBasp AVR Programmer
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               1.10
  bDeviceClass          255 Vendor Specific Class
  bDeviceSubClass         0
  bDeviceProtocol         0
  bMaxPacketSize0         8
  idVendor           0x16c0 VOTI
  idProduct          0x05dc USBasp AVR Programmer
  bcdDevice            1.00
  iManufacturer           1 jferg.net
  iProduct                2 LEDControl
  iSerial                 0
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           18
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0
    bmAttributes         0x80
      (Bus Powered)
    MaxPower               40mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           0
      bInterfaceClass         0 (Defined at Interface level)
      bInterfaceSubClass      0
      bInterfaceProtocol      0
      iInterface              0
Device Status:     0x0000
  (Bus Powered)


The product name appears to be correct.

I'm measuring 2.75V on the D- line, and 0V on the D+ line. This is just with a standard multimeter.

Re: Could not find USB device "LEDControl" (atmega324p)

Posted: Tue Mar 01, 2011 3:47 am
by jferguson
I've tried with an ATMEGA48 now. Same problem.

I've checked the voltages at D+ and D-. D- is at 2.7V, D+ is at 0V. The uC has 5.05V.

Can someone give me ballpark figures on the voltages I should be seeing?

Additional details:
Ubuntu 10.04
libusb1.0 and 0.14 installed (might this cause a conflict of some kind?)

I noticed `libusb-config --cflags` didn't return anything, so I modified the makefile to include -lusb in the compiler flags (for the set-led program)

Thanks for your time. Sorry if I seem impatient, I just got all my parts today, and I'm quite excited. It's just a shame that I have to work through so many strange errors. :lol:

Re: Could not find USB device "LEDControl" (atmega324p)

Posted: Tue Mar 01, 2011 4:22 am
by jferguson
A picture in case it helps:

Image
(click to enlarge)

Re: Could not find USB device "LEDControl" (atmega324p)

Posted: Tue Mar 01, 2011 9:31 pm
by maxi
I see you are using a USBasp programmer, could it be that the VID & PID are the same as LEDcontrol? I know Windows has a problem with this scenario but not too sure about Ubuntu. Try re-booting without the programmer connected and see if that makes a difference.

Re: Could not find USB device "LEDControl" (atmega324p)

Posted: Fri Mar 04, 2011 12:13 am
by jferguson
Okay.... for posterity, the program has to be called with sudo.

Code: Select all

sudo ./set-led status


not

Code: Select all

./set-led status


D'OH! I wonder why this is. I guess my OS isn't automagically allowing the device to be accessed by regular users. I know there are programs to allow users to access things like USB drives, or cameras, but I guess by default hardware access is restricted to root. If anyone could explain or elabourate on that, I'd be grateful.

At least it's working! :D :D :D

Let the hacking begin.