I built a small attiny85-based board using vusb and essentially the schematic of the discontinued Sparkfun "AVR Stick" (at least on the usb/uC side; see https://www.sparkfun.com/datasheets/Widgets/AVR-Stick-v12.pdf).
Trying to run micronucleus , a V-USB based bootloader, on it, I used the following config changes from the included
tiny85-default example (to accomodate for different pins):
#define USB_CFG_DMINUS_BIT 0 #define USB_CFG_DPLUS_BIT 2 #define USB_INTR_VECTOR PCINT2_vect
as far as i (and the available documentation) can tell, this is the correct setup.
when I try to connect it to my PC via usb though, I get enumeration errors, and attaching a logic analyzer to its VCC (to trigger on plugging it in) and data lines, I see the following traffic:
- VCC high
- a few random broken packets as the uC spins up
- a loop of:
SYNC PID_SETUP 0x00 0x00 CRC_OK EOP(handshake begin)
SYNC DATA0 0x80 0x06 0x00 0x01 0x00 0x00 0x40 0x00 CRC_OK EOP(no clue)
- expecting either a
SYNC NAKpacket now, but nothing happens, except for
- a few evenly spaced (and very slow, compared to the previous packets) keepalives, until it retries this loop a few times (with a few resets+vcc cycles from my kernel trying to un-break the stuck device)
- the data lines going into idle state as my kernel gives up on it and decides to just deliver power
I attached a csv dump from my logic analyzer here.
If anyone has an idea what's going on here or how to fix it (or at least how to get more info on what's actually wrong), any help is greatly appreciated :)
EDIT: forgot to mention above, the logic analyzer is attached at the uC pins, not inline of the USB connection, so it's very likely a software problem since the electrical signals definitely reach the uC. a simple pin-toggling test program (with unchanged fuses) confirms the uC is running at the time.