AVR-USB Device Not Recognized on Atmega8
-
- Rank 1
- Posts: 23
- Joined: Sat Mar 15, 2008 7:46 pm
The voltage levels at D+ and D- are at 4V without clamping diodes and 3V with. What should I be using to connect the USB interface. I do not have a LE35 and the AVR has to run at 5V powered by the USB port. I have tried many combinations of hardware, but something isn't right. Would a new Atmega8 help?
-
- Rank 1
- Posts: 23
- Joined: Sat Mar 15, 2008 7:46 pm
-
- Rank 1
- Posts: 23
- Joined: Sat Mar 15, 2008 7:46 pm
Since you don't get any debug logs, AVR-USB does not send any data (except the disconnect at boot time, but that would be D+ and D- at 0 V). The static 3 V level must therefore come from the host. But there's no situation where you can see extended periods of high level on D+, not even a pulse sequence with an average close to 3 V.
A scope would be pretty useful to see what's going on...
A scope would be pretty useful to see what's going on...
-
- Rank 1
- Posts: 23
- Joined: Sat Mar 15, 2008 7:46 pm
I rebuilt the circuit and I am still getting ~3V levels on both lines. I have built the circuit exactly like the easylogger circuit. This must be a hardware error. This isn't making sense. I don't have an oscilloscope, but I think I am going to order one. Is it okay if I e-mail you the code I'm using to rule out that possibility?
Yes, please mail me the code through http://www.obdev.at/products/avrusb/feedback.html
I might have a hardware to run it.
I might have a hardware to run it.
-
- Rank 1
- Posts: 23
- Joined: Sat Mar 15, 2008 7:46 pm
I've tried your code just now (sorry, did not have the time to do it earlier).
First one comment: You have set F_CPU and DEBUG_LEVEL in main.c. This is not the place where they should be set since these are global settings for all modules. They should be added to the compiler command line with -DF_CPU=12000000 -DDEBUG_LEVEL=2.
Since 12 MHz is the default anyway and since the debug level does not matter for functionality, I've left it as it is for testing. However, my board has D+ on Port D bit 2 and D- on Port D bit 4. I've therefore updated usbconfig.h and the initialization in main() to
Then I found that you left a modification you made for testing: You renamed the interrupt vector in usbdrvasm12.inc from USB_INTR_VECTOR to USB_INTRA_VECTOR. I've reverted this change, compiled the project and flashed it.
The resulting device enumerates correctly and the descriptors can be read. It is recognized as PowerSwitch. In other words: It works for me.
First one comment: You have set F_CPU and DEBUG_LEVEL in main.c. This is not the place where they should be set since these are global settings for all modules. They should be added to the compiler command line with -DF_CPU=12000000 -DDEBUG_LEVEL=2.
Since 12 MHz is the default anyway and since the debug level does not matter for functionality, I've left it as it is for testing. However, my board has D+ on Port D bit 2 and D- on Port D bit 4. I've therefore updated usbconfig.h and the initialization in main() to
Code: Select all
DDRD = ~((1 << 2)|(1<<4));
Then I found that you left a modification you made for testing: You renamed the interrupt vector in usbdrvasm12.inc from USB_INTR_VECTOR to USB_INTRA_VECTOR. I've reverted this change, compiled the project and flashed it.
The resulting device enumerates correctly and the descriptors can be read. It is recognized as PowerSwitch. In other words: It works for me.
-
- Rank 1
- Posts: 23
- Joined: Sat Mar 15, 2008 7:46 pm
I finally got it! I made those changes you told me, but I do not think any of those were the problem. I have been using an Olimex development board and I finally breadboarded the circuit without it. Now the device is recognized and I am having no problems. I do not know why I never checked that, but apparently it was the problem. Thank you very much for your help and patience Christan.