VUSB + Ardunio Problem

General discussions about V-USB, our firmware-only implementation of a low speed USB device on Atmel's AVR microcontrollers
FuzzyWombatSoup
Posts: 1
Joined: Sat Aug 29, 2015 2:09 am

VUSB + Ardunio Problem

Postby FuzzyWombatSoup » Sat Aug 29, 2015 2:18 am

Here's the useful part of my code:

Code: Select all

#include "usbdrv.h"

void setup() {
    TIMSK0 &= !(1<TOIE0);
    cli();
    usbDeviceDisconnect();  /* enforce re-enumeration, do this while interrupts are disabled! */   
    usbDeviceConnect();
    usbInit();
    sei();
}

void loop() {
    usbPoll();
   
}
   
}


I'm able to send data back and forth fine for a few minutes, but after the device sits idle, it seems to become unresponsive to the OS(linux) and requires me to reset the Ardunio or unplug the USB cable. The device never shows a USB disconnect in dmesg when it's this unresponsive state and still shows up in lsusb. Also, when I lsusb -v the usb device in this bad state, i get an error when trying to read the vendor/product strings. These strings show correctly when it's responding.

venum
Posts: 1
Joined: Mon Jun 18, 2018 1:25 pm

Re: VUSB + Ardunio Problem

Postby venum » Mon Jun 18, 2018 1:57 pm

Hi everyone,
I have the exact same problem as the OP.
I made 2 usb IR receivers to control my Gnu/Linux computer with a standard IR remote.

The first one I made uses an attiny85 uC and I even wrote an instructable:
http://www.instructables.com/id/ATtiny8 ... -Receiver/

The second one I made uses an atmega328p uC since I needed extra gpio to control an IR led that I installed to turn of/on the TV.

Both used to work pretty well for months, but then I started having random disconnections from both remotes (it could be after upgrading the operating system, but I am not sure about that).
Now it happens that the devices work well for a random amount of time, then they become not responsive and I need to pull out the device and plug it in again.

lsusb before and after the device becomes not responsive shows up no difference at all.
dmesg or direct inspection of /var/log/syslog do not evidence an state change at all.

So I'm having the same issues as the OP have.
My configuration has decoupling filter caps for the usb power lines (10uF and 0.1uF), 2 zener diodes (3.6V .05W) and the 68R resistors.
This is the schematics that I used for the attiny85 version:
https://cdn.instructables.com/FIK/5Z54/ ... &width=792
The atmega328p is pretty much the same.

This is the code for the attiny85 version:
https://github.com/venumz/ATtiny85-USB- ... serial.ino

This is the code for the atmega328p:
https://github.com/venumz/atmega-328p-I ... yboard.ino

It is like those devices fall in some kind of suspended mode, but I do not know how to get them up and running.

I really hope that someone could give me a hand with this issue, this is a very interesting project in which I have invested a big amount of time and I see lots of uses for it.

Thanks in advance.

PS: FuzzyWombatSoup, did you find any solution since you posted this thread? I'd appreciate so much your help.


Return to “V-USB”

Who is online

Users browsing this forum: No registered users and 2 guests