AVR USB unknown device

General discussions about V-USB, our firmware-only implementation of a low speed USB device on Atmel's AVR microcontrollers
Post Reply
deltaar
Posts: 7
Joined: Tue Mar 25, 2008 11:22 pm

AVR USB unknown device

Post by deltaar » Tue Mar 25, 2008 11:32 pm

Hi.

I’m experiencing a few problems with my PowerSwitch circuitry.

First of all when I use my RS232-USB converter to download the firmware to the MCU using PonyProg it gets really slow. Something that should take about 15 seconds, takes about 20 minutes. Anyway, lets forget this for now, I was able to access other computer with serial port and download the firmware taking into account http://www.mydarc.de/dg8saq/AVR-USB/index.shtml fuse configuration. I’m using for now the firmware provided by OD with no changes.

My main problem is: when I connect the USB to the computer it always shows ‘Unknown USB device’. I tried to update the device controller accordingly to the SourceForge description, but it refuses to accept the ‘inf’ file. Anyway I can see in the unknown device drivers’ manufacturer the SourceForge website path... Weird... :?

Image

I’m using the LM317 to generate 3.3V from an exterior power supply (not the USB 5V) and no campling diodes. I can measure 3V at D- and 0 at D+.

Suggestions are mostly welcome.

Thanks in advance.

PS: I’m using the ATTINY2313-20SU (SMD version)

christian
Objective Development
Objective Development
Posts: 1443
Joined: Thu Nov 09, 2006 11:46 am

Post by christian » Fri Mar 28, 2008 3:02 pm

Regarding slow programming with PonyProg: USB to serial converters are very slow when handshake lines should be toggled and most of them don't even work for this purpose because they optimize away short high or low pulses. Have you been able to verify that the flash content is correct?

Does windows call the device by name ("PowerSwitch"), or does it give a generic "device not recognized" message? If it's the generic message, USB connectivity is probably not working at all. This may have many causes, e.g. fuse values, operating voltage etc.

The hex file shipped with the project has been compiled for the AT90S2313. I believe that the Tiny2313 is binary compatible, but I may be wrong. You can try to compile it for the Tiny2313 yourself.

Guest

Post by Guest » Fri Mar 28, 2008 3:24 pm

Hi christian.

Regarding your question, I quit using the USB to serial converter, it takes to much time. I never wait for a 100% download...
LancOS has in their PonyPorg TODO section "...USB support", which are good news.

I made the firmware download using other computer with serial port. After transmitting it said "successful".

Windows always call the device has a generic "device not recognized". I believe the informations from SourceForge come from the usb filter drivers provided by SourceForge. I tried to follow the SourceForge drivers installation procedures, but windows never accepts the 'inf' file. I'm trying to use "PowerSwitch.inf" supplied by OD.

I have used the same fuse configuration has the project mentioned above in my first post.

The operating voltage I'm using is 3.3V.

I will try to follow your advice, compile it for the tiny2313. I'm new to AVR and its tools, so it might take a bit.

Thanks.

christian
Objective Development
Objective Development
Posts: 1443
Joined: Thu Nov 09, 2006 11:46 am

Post by christian » Fri Mar 28, 2008 4:30 pm

If the checkboxes with hook indicate a flashed (=0) bit, then the cksel values (=1111) should be OK. These are the most important settings. The bodlevel of 2.7 V should also be OK...

deltaar
Posts: 7
Joined: Tue Mar 25, 2008 11:22 pm

Post by deltaar » Fri Mar 28, 2008 6:43 pm

Ok, finally I was able to set the AVR tools to work and to generate the hex file.

Do you know any flashing tool that works well with USB to serial converter to download the firmware to the MCU?

Thanks in advance.

christian
Objective Development
Objective Development
Posts: 1443
Joined: Thu Nov 09, 2006 11:46 am

Post by christian » Sat Mar 29, 2008 2:02 pm

I don't think that it is technically possible to flash through USB to RS232 converters reliably. USB support in PonyProg may refer to USB based programmers.

I would recommend that you build a simple programmer such as USBasp. You can flash it with a computer which has RS232 or a parallel port.

deltaar
Posts: 7
Joined: Tue Mar 25, 2008 11:22 pm

Post by deltaar » Sat Mar 29, 2008 2:27 pm

Hi.

I was able to download the firmware again using other PC with serial port.

The problem persists.

I also change the MCU by other (DIP version this time), but I've the same problem.

I’ve an idea, maybe I should try something simpler such as flashing an LED or something like that to make sure the firmware is being correctly downloaded and the MCU is running. Do you have any hex file for the tiny2313 I can use for this purpose? I’ll look for something on the internet.

Thanks.

deltaar
Posts: 7
Joined: Tue Mar 25, 2008 11:22 pm

Post by deltaar » Sat Mar 29, 2008 8:59 pm

Hi again.

I've good and bad news.

The good news are: I was able to put windows xp to recognize PowerSwitch and the drivers look like to be properly installed. The USB looks like to be working. When I set the fuses in PonyProg I didn't choose write, instead I was choosing ok...

The bad news: the PowerSwitch.exe (in the commandline folder) appears and instantly disappears.
I've tried to use the graphical power switch command, but it says:
"Could not find USB device "kszPowerSwitch" with vid=0x16c0 pid=0x5dc." I've checked the vid and pid in the hardware manager and they are the same...

Any ideas?

Thanks. 8)

PS: I only need the PowerSwitch.exe to be working.

christian
Objective Development
Objective Development
Posts: 1443
Joined: Thu Nov 09, 2006 11:46 am

Post by christian » Mon Mar 31, 2008 2:37 pm

What do you mean with "appears and instantly disappears"?

The GUI tool seems to be compiled for a customized device name, maybe even a different vendor name. You can try to change the name of the device accordingly.

deltaar
Posts: 7
Joined: Tue Mar 25, 2008 11:22 pm

Post by deltaar » Mon Mar 31, 2008 10:44 pm

Hi.

For the GUI thank you, I'll try that.

The "appears and instantly disappears" happens with the console application. I open it and it closes right away...

Thanks.

christian
Objective Development
Objective Development
Posts: 1443
Joined: Thu Nov 09, 2006 11:46 am

Post by christian » Tue Apr 01, 2008 2:29 pm

Regarding the console app: well, yes. It's intended to be called from the command line. Open a DOS window and run the command by typing its name.

deltaar
Posts: 7
Joined: Tue Mar 25, 2008 11:22 pm

Post by deltaar » Mon Apr 07, 2008 6:48 pm

Hi christian,

Ok thanks and sorry for the delay.

First I have to solve a pendent problem; I hope you or someone on the forum may help. Every time I try to send a command in the PowerSwitch command line, such as "...PowerSwitch status" the computer shows up a blue screen and reboots!

In my previous attempts with usb drivers there was a time I have installed the filter-drivers. I also read somewhere they aren't necessary unless one want to make development. So, I uninstalled them, but the problem persists (I have installed and uninstalled them using the install-filter.exe directly from de DOS console, not the win32 app).

Any idea?

Cheers.

christian
Objective Development
Objective Development
Posts: 1443
Joined: Thu Nov 09, 2006 11:46 am

Post by christian » Mon Apr 07, 2008 7:10 pm

This must be a problem with libusb-win32. Please remove everything related to this lib and install it from scratch. Maybe a web search brings up something relevant.

deltaar
Posts: 7
Joined: Tue Mar 25, 2008 11:22 pm

Post by deltaar » Tue Apr 08, 2008 6:18 pm

Hi christian,

After a driver clean up and the latest drivers installation, PowerSwitch become to work!

Thanks for your support and patience.

cheers :lol:

Post Reply