[SOLVED] v-usb on atmega32 and protoboard

General discussions about V-USB, our firmware-only implementation of a low speed USB device on Atmel's AVR microcontrollers
Post Reply
lucio
Posts: 2
Joined: Sat Jul 25, 2009 11:39 pm

[SOLVED] v-usb on atmega32 and protoboard

Post by lucio » Sat Jul 25, 2009 11:50 pm

Hello all,

Ive spent a lot of trying trying to make this work. I have the stk500 i am using to program the atmega32. Then i put the chip on the protoboard where i have implemented a lot of different variations on the circuits trying to get this to work.

The micro is runinng at 16mhz. These are my Makefile settings:

Code: Select all

DEVICE  = atmega32
F_CPU   = 16000000   # in Hz
FUSE_L  = 0x9f
FUSE_H  = 0xc9


And this are the ones from the .h"

Code: Select all

#define USB_CFG_IOPORTNAME      D
#define USB_CFG_DMINUS_BIT      3
#define USB_CFG_DPLUS_BIT       2

The rest is all the same!

The current designis based on with-zener.png from the source distribution. This last one i had to accept some variations as i dont have all the exact part, ie:
- the 4u7 capacitor is replaced by to 10u capacitors in series (5u)
- the 27p capacitors for the cristar are replaced with 22p capacitors.

And thats it. All i get from doing `dmesg` is lots of:

Code: Select all

Jul 25 18:43:35 prometeo kernel: [94932.256165] hub 6-0:1.0: unable to enumerate USB device on port 1
Jul 25 18:43:35 prometeo kernel: [94932.504053] hub 6-0:1.0: unable to enumerate USB device on port 1
Jul 25 18:43:35 prometeo kernel: [94932.752153] hub 6-0:1.0: unable to enumerate USB device on port 1
Jul 25 18:43:35 prometeo kernel: [94933.000231] hub 6-0:1.0: unable to enumerate USB device on port 1

and when i reset i see:

Code: Select all

Jul 25 18:46:09 prometeo kernel: [95086.762985] hub 6-0:1.0: unable to enumerate USB device on port 1
Jul 25 18:46:09 prometeo kernel: [95087.008410] hub 6-0:1.0: unable to enumerate USB device on port 1
Jul 25 18:46:10 prometeo kernel: [95087.312042] usb 6-1: new low speed USB device using uhci_hcd and address 119
Jul 25 18:46:10 prometeo kernel: [95087.432056] usb 6-1: device descriptor read/64, error -71
Jul 25 18:46:10 prometeo kernel: [95087.656031] usb 6-1: device descriptor read/64, error -71
Jul 25 18:46:10 prometeo kernel: [95087.876525] usb 6-1: new low speed USB device using uhci_hcd and address 120
Jul 25 18:46:10 prometeo kernel: [95087.998014] usb 6-1: device descriptor read/64, error -71
Jul 25 18:46:10 prometeo kernel: [95088.164075] hub 6-0:1.0: unable to enumerate USB device on port 1
Jul 25 18:46:10 prometeo kernel: [95088.496054] hub 6-0:1.0: unable to enumerate USB device on port 1

lsusb of course shows nothing. this is using ubuntu 9.10.

And this is the code from my main file:

Code: Select all

usbMsgLen_t usbFunctionSetup(uchar data[8])
{
   return 0;   /* default for not implemented requests: return no data back to host */
}


int main (void)
{
    uchar   i;

    wdt_enable(WDTO_1S);
    /* Even if you don't use the watchdog, turn it off here. On newer devices,
     * the status of the watchdog (on/off, period) is PRESERVED OVER RESET!
     */
    /* RESET status: all port bits are inputs without pull-up.
     * That's the way we need D+ and D-. Therefore we don't need any
     * additional hardware initialization.
     */
    usbInit();
    usbDeviceDisconnect();  /* enforce re-enumeration, do this while interrupts are disabled! */
    i = 0;
    while(--i){             /* fake USB disconnect for > 250 ms */
        wdt_reset();
        _delay_ms(1);
    }
    usbDeviceConnect();
    sei();
    for(;;){                /* main event loop */
        wdt_reset();
        usbPoll();
    }
    return 0;
}


My next step is to replace the parts that dont match exactly the ones in the schematics, but ive tried many variations and many designs (eg, metaboard) and i cant get this to work with this micro.

So, do you guys have any idea what could be going on?

lucio
Posts: 2
Joined: Sat Jul 25, 2009 11:39 pm

Re: [SOLVED] v-usb on atmega32 and protoboard

Post by lucio » Thu Jul 30, 2009 5:14 am

always, and i mean always, make sure you are using low current zener diodes. That was it.

tombaugh
Posts: 11
Joined: Sat Nov 14, 2009 5:34 pm

Re: [SOLVED] v-usb on atmega32 and protoboard

Post by tombaugh » Sun Nov 15, 2009 3:23 am

I'm having the exact same problem right now, using BZX55C3V6 500mW zeners. Could that be the problem, and should I start looking for 250mW diodes?

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

Re: [SOLVED] v-usb on atmega32 and protoboard

Post by christian » Fri Dec 11, 2009 11:06 pm

If you are unsure, remove the zeners and lower the supply with two series diodes. If that works, look for other zener diodes.

Post Reply