kehribar / Attiny2313-USB-MIDI

MIDI -> USB converter
1 stars 0 forks source link

usb not recognized #1

Open ydswd2003 opened 4 years ago

ydswd2003 commented 4 years ago

When I connect the PCB to the computer, I get "USB not recognized" message, it works fine with the original firmware, but not with your's. Please, share the hex files. Thank You

vtochq commented 4 years ago

I add watchdog reset in code and now it works. But I don't understand why it don't work without watchdog and without WDTON Fuse enabled.

int main(void) 
{   
  wdt_enable(WDTO_1S);
  hardwareInit();
  usbInit();
  sei();

  PORTB = 1;

  for(;;)
  {
    wdt_reset();
    usbPoll();
    /* send packets to USB MIDI  */
    if(usbInterruptIsReady() && utxrdy) 
    {
      usbSetInterrupt(utx_buf, 4);
      utxrdy = FALSE;
    }
  }
  return 0;
}

There are less Note-off glithces but they appears.