General discussions about V-USB, our firmware-only implementation of a low speed USB device on Atmel's AVR microcontrollers
Posts: 1
Joined: Wed Sep 20, 2017 8:14 pm


Postby jbrielBVB09 » Thu Sep 21, 2017 8:47 am

first, please sorry. i am a total newbie to build custom µc circuits and programming in c. :-D normally i only do c#, java and javascript projects.

I build up a simple circuit with a attiny85 and 3,3v drop regulator and a usb connection. i customized the usbconfig.h and the project perfectly builds in atmel studio, but if i plug it to my windows 10 notebook it just says USB\DEVICE_DESCRIPTOR_FAILURE. if tried to reinstall the libusb driver as well as automatically select a driver in the windows device manager but still windows can not even get the correct vendorid. if tried everything i could imagine for the last couple of days but got no progress at all. meanwhile i am close to totally freak out. does someone of you guys have an other idea? please help...

i build up the usb connection with D+ on PB0 and D- on PB1. I added 68 ohm resistors to limit the current and added a 1k5 ohm pullup resistor to D- and 1m ohm pullup resistor to D+. If i check the voltage the attiny provides about 3.1v at d- and about 0.4v at d+.

this is my main file:
it should simply build up a usb connection and make a led on PB4 blink with 2hz...

Code: Select all

#include <avr/io.h>
#include <avr/interrupt.h>
#include <avr/wdt.h>

#include "usbdrv.h"

#define F_CPU 16500000UL
#include <util/delay.h>

USB_PUBLIC uchar usbFunctionSetup(uchar data[8]) {
        return 0; // do nothing for now

int main() {
    uchar i;

    wdt_enable(WDTO_1S); // enable 1s watchdog timer

    usbDeviceDisconnect(); // enforce re-enumeration
    for(i = 0; i<250; i++) { // wait 500 ms
        wdt_reset(); // keep the watchdog happy
    sei(); // Enable interrupts after re-enumeration
    DDRB = 0b00010000;
    while(1) {
        wdt_reset(); // keep the watchdog happy
        //make the led blink with 2hz
        PORTB = 0b00010000;
        PORTB = 0b00000000;
    return 0;

i build up the project along the tutorial from codeandlife

if i comment out all the usb stuff in the code, the µc starts blinking as excpected, so that i rather think of a hardware or windows error...

thanks a lot

Rank 4
Rank 4
Posts: 455
Joined: Mon Aug 25, 2008 8:45 pm


Postby ulao » Fri Sep 29, 2017 1:47 pm

added a 1k5 ohm pullup resistor to D- and 1m ohm pullup resistor to D+.
Using the latest code examples that will not work. Or maybe you just failed to explain it right? The 1k5 goes from D- to the (normally middle pin) pull up pin. The Driver turns this pull up on and off. It may work with the right usb timeouts but I would just wire it up the right way for now. Also I never heard of pulling up D+ .

Did you try any of the pre built examples? I have also heard of issue win Win10.

Return to “V-USB”

Who is online

Users browsing this forum: Bing [Bot] and 9 guests