[SOLVED] ATmega32 is failing to receive the address
Posted: Mon Oct 13, 2008 7:29 pm
Hi i am making a test circuit with an ATmega32 based on the code of HIDKeys.
I am getting this errors on linux debian:
And lsusb doesnt list the device.
The programmer is USBasp and it works fine.
I have used the FUSE calcultor of http://www.engbedded.com/cgi-bin/fc.cgi/
For a 16 Mhz crystal oscilator.
Initialization is as follow:
DDRD = 0; // PortD: inputs
PORTD = 0; // No PullUps on USB pins
#define F_CPU 16000000L
#define USB_CFG_IOPORTNAME D
#define USB_CFG_DMINUS_BIT 2
#define USB_CFG_DPLUS_BIT 6
D- is connected to INT0.
I have only some buttons with internal pullups on portb and leds on port C.
The HID Descriptor is copyed from HIDKeys:
When i click a button it should send a letter and change one led status to see that it was processed.
After i connect the device i can play around with buttons and leds but none are written on the opened text editor.
Doing lsusb seems to try to comunicate with the device because it slows down when the circuit is connected.
"dmesg | grep usb" show the above lines.
And checking for the usb cable, i have continuity with the 4 lines.
In D- Messuring with a normal tester it shows 2.9 V on iddle state, but on D+ i have a plain 0 V which i dont know if it is correct, i think that 0 V means no activity at all.
I can force some activity by running "lsusb".
Zenners are 3.6V and are both new.
Any idea?.
I am getting this errors on linux debian:
usb 2-3: new low speed USB device using ohci_hcd and address 59
usb 2-3: device descriptor read/64, error -62
usb 2-3: device descriptor read/64, error -62
usb 2-3: new low speed USB device using ohci_hcd and address 60
usb 2-3: device descriptor read/64, error -62
usb 2-3: device descriptor read/64, error -62
usb 2-3: new low speed USB device using ohci_hcd and address 61
usb 2-3: device not accepting address 61, error -62
usb 2-3: new low speed USB device using ohci_hcd and address 62
usb 2-3: device not accepting address 62, error -62
And lsusb doesnt list the device.
The programmer is USBasp and it works fine.
I have used the FUSE calcultor of http://www.engbedded.com/cgi-bin/fc.cgi/
For a 16 Mhz crystal oscilator.
Initialization is as follow:
DDRD = 0; // PortD: inputs
PORTD = 0; // No PullUps on USB pins
#define F_CPU 16000000L
#define USB_CFG_IOPORTNAME D
#define USB_CFG_DMINUS_BIT 2
#define USB_CFG_DPLUS_BIT 6
D- is connected to INT0.
I have only some buttons with internal pullups on portb and leds on port C.
The HID Descriptor is copyed from HIDKeys:
Code: Select all
PROGMEM char usbHidReportDescriptor[35] = { /* USB report descriptor */
0x05, 0x01, // USAGE_PAGE (Generic Desktop)
0x09, 0x06, // USAGE (Keyboard)
0xa1, 0x01, // COLLECTION (Application)
0x05, 0x07, // USAGE_PAGE (Keyboard)
0x19, 0xe0, // USAGE_MINIMUM (Keyboard LeftControl)
0x29, 0xe7, // USAGE_MAXIMUM (Keyboard Right GUI)
0x15, 0x00, // LOGICAL_MINIMUM (0)
0x25, 0x01, // LOGICAL_MAXIMUM (1)
0x75, 0x01, // REPORT_SIZE (1)
0x95, 0x08, // REPORT_COUNT (8)
0x81, 0x02, // INPUT (Data,Var,Abs)
0x95, 0x01, // REPORT_COUNT (1)
0x75, 0x08, // REPORT_SIZE (8)
0x25, 0x65, // LOGICAL_MAXIMUM (101)
0x19, 0x00, // USAGE_MINIMUM (Reserved (no event indicated))
0x29, 0x65, // USAGE_MAXIMUM (Keyboard Application)
0x81, 0x00, // INPUT (Data,Ary,Abs)
0xc0 // END_COLLECTION
};
When i click a button it should send a letter and change one led status to see that it was processed.
After i connect the device i can play around with buttons and leds but none are written on the opened text editor.
Doing lsusb seems to try to comunicate with the device because it slows down when the circuit is connected.
"dmesg | grep usb" show the above lines.
And checking for the usb cable, i have continuity with the 4 lines.
In D- Messuring with a normal tester it shows 2.9 V on iddle state, but on D+ i have a plain 0 V which i dont know if it is correct, i think that 0 V means no activity at all.
I can force some activity by running "lsusb".
Zenners are 3.6V and are both new.
Any idea?.