Page 1 of 1

ATmega16 16PU -- 16Mhz -- Device Not Recognized

Posted: Tue Jun 22, 2010 8:04 pm
by MadTheos
Hello,

I'm new to AVRs and am trying to use V-USB for a joystick project:

Current hardware:
ATmega16 16PU
16Mhz crystal
Fuse, low: 0x9F, high: 0xC9
Bus powered 5V circuit with 3.6 zeners
Self-made vero-board-based development board
6 foot usb cable with shield grounded to board ground
USBasp programmer

I have tried various non-USB programs on the uC and they all work fine. I don't have an oscilloscope, but I've made an LED blink at the expected rate, so I'm guessing that it is indeed running at 16Mhz. I have HID Mouse loaded on the uC at the moment. But when I connect it to my desktop, it always says "device not recognized". When I connect it to a netbook, it gets recognized half the time, but as "Unknown Device" (as displayed in the speech bubble upon detection and then in device manager). I'm guessing that something like "Standard HID Mouse" is the correct outcome, so is this an error? Is the crystal's timing off?

The desktop has an intel 82801GB (ICH7) controller while the Netbook has an 82801G (ICH7) controller, so I'm wondering why there is such a difference.

I don't have a 12MHz crystal now, and no debugging h/w except for a bunch of LEDs and a multimeter. Any suggestions how to go about fixing this will be most welcome.

Thanks for reading,

Matt

Re: ATmega16 16PU -- 16Mhz -- Device Not Recognized

Posted: Wed Jun 23, 2010 1:46 am
by ulao
I'm not sure if you said you DO have a external crystal or Dont? But... I'm told you will need a external crystal as USB has some pretty picky timing. Also make sure to use 1/2 watt diodes with the mega168. The surface mount diodes very commonly dont work. I had this issue going on for a long time until I figured it out. If you want to know you have the diode issue try a hub. If your devices works off the hub chances are its the diode.

Re: ATmega16 16PU -- 16Mhz -- Device Not Recognized

Posted: Wed Jun 23, 2010 12:37 pm
by MadTheos
ulao wrote:I'm not sure if you said you DO have a external crystal or Dont? But... I'm told you will need a external crystal as USB has some pretty picky timing. Also make sure to use 1/2 watt diodes with the mega168. The surface mount diodes very commonly dont work. I had this issue going on for a long time until I figured it out. If you want to know you have the diode issue try a hub. If your devices works off the hub chances are its the diode.


I have a 16MHz crystal and a mega16. I'm not using any SMD. I'm using zeners on USB data lines, and the rest of the circuit works on 5V.

You mean an external USB hub?

Thanks,

Matt

Re: ATmega16 16PU -- 16Mhz -- Device Not Recognized

Posted: Wed Jun 23, 2010 2:23 pm
by ulao
Correct I was referring to the zeners. I read that as a 168, I'm not sure about the 16. Sorry for the mix up. May want to check if the zeners are 1 watts, if so try 1/2 watts. Yes an external hub.

Re: ATmega16 16PU -- 16Mhz -- Device Not Recognized

Posted: Wed Jun 23, 2010 10:25 pm
by MadTheos
ulao wrote:Correct I was referring to the zeners. I read that as a 168, I'm not sure about the 16. Sorry for the mix up. May want to check if the zeners are 1 watts, if so try 1/2 watts. Yes an external hub.

I read about the capacitance problem with the zeners. My zeners are the tiny 1N4148-lookalikes, so I imagine that they are of a low wattage.

Well, I don't have a USB hub around. :-/

Thanks,

Matt

Re: ATmega16 16PU -- 16Mhz -- Device Not Recognized

Posted: Tue Jun 29, 2010 12:57 am
by ulao
Ok the problem came back. And I looked in to it a bit. the zeners I have that works are 1n747a. I also have a 1N4148. They are so small I can not read the middle numbers under the highest lens I have but I have the order slip and they are 1N4148. Looking in to it a bit the 1n4148 sold to me as zDiodes are not Zdiodes,they are diodes. Thx for the post, this saved me a lot of recalls.

Re: ATmega16 16PU -- 16Mhz -- Device Not Recognized

Posted: Sat Jul 03, 2010 8:19 pm
by MadTheos
Interesting. Anyway, I bought and tried a 12MHz crystal without success. Then I changed the circuit to work on 3.6V (from the port with two serial 1N4148 diodes). This time it worked! I haven't tried to find out whether it was the zeners or the cable or something else entirely that was the culprit.

I have the 12MHz crystal soldered on. Will there be any issues with the oscillator if I used a socket for the crystal as well (for a general purpose development board)?

Another thing, I have set the poll interval to 10ms, and I still see perceptible jitter in the read value (from a quadrature encoder) shown in ControlPanel>GameControllers. Since the quadrature decoding is pretty smooth (I have an led array as debug output), I'm wondering where the packets are being dropped.

Thanks,

Matt, Kerala, India.