Starting usb on pro micro after deep sleep (ATmega32u4) I have just started playing with a low power arduino project, and have managed to get the power drain down to about 220uA using powerDown from LowPower.

What I would love to be able to do is start the USB controller and send some data every 8 seconds, but I cant seem to send anything...

Any idea would be greatly appreciated :)

Her is my code:

// **** INCLUDES *****
#include &lt;LowPower.h&gt;

#include &lt;avr/interrupt.h&gt;
#include &lt;avr/power.h&gt;
#include &lt;avr/sleep.h&gt;
#include &lt;avr/io.h&gt;

void setup()
{
  DDRD = B00100000;       // PORTD5 = TXLED
  DDRB = B00000001;        // PORTB0 = RXLed


  Serial.begin(9600);
  while (!Serial) ; // Needed for Leonardo only
  Serial.println("Starter...");
  delay(100);
  Serial.end();

  /*
  *  IKKE FJERN DENNE!!! Da greier vi ikke å omprogramere kortet...
  */
  delay(10000);
  Serial.begin(9600);
  while (!Serial) ; // Needed for Leonardo only
  Serial.println("low-power...");
  delay(100);
  Serial.end();
  flash();
}

void loop() 
{
  //LowPower.idle(SLEEP_8S, ADC_OFF, TIMER4_OFF, TIMER3_OFF, TIMER1_OFF, TIMER0_OFF, SPI_OFF, USART1_OFF, TWI_OFF, USB_OFF);//, USB_OFF);
  LowPower.powerDown(SLEEP_8S, ADC_OFF, BOD_OFF);
  //USBCON &amp;= B11011111; //Disable USB Freeze clock USBCON.FRZCLK
  //USBCON |= B10010001; //SET USB_MACRO_ENABLE_BIT USBCON.USBE

    PLLCSR |= B00000010;   //-Enable             PLL PLLCSR.PLLE = 1; 
    while (!(PLLCSR &amp; 1)); //-Wait PLL LOCK      while (PLLCSR.PLOCK != 1);
    USBCON &amp;= B11011111;   //-Unfreeze USB clock USBCON.FRZCLK = 0; (Clear to unfreeze)
    //-Clear Resume information ???

  flash();


  /*
  * Test USB kommunikasjon :)
  */
  Serial.begin(9600);
  while (!Serial);
  delay(5);
  Serial.println("Hello world!!!");
  delay(5);
  Serial.end();
   PORTD |= B00100000;
   PORTB |= B00000001;
}

void flash() {

   PORTD &amp;= B11011111;
   PORTB &amp;= B11111110;
   delay(100);
   PORTD |= B00100000;
   PORTB |= B00000001;
   delay(100);

   PORTD &amp;= B11011111;
   PORTB &amp;= B11111110;
   delay(100);
   PORTD |= B00100000;
   PORTB |= B00000001;
   delay(100);

   PORTD &amp;= B11011111;
   PORTB &amp;= B11111110;
   delay(100);
   PORTD |= B00100000;
   PORTB |= B00000001;
   delay(100);
}


Best regards, Richard

EDIT

The manual specifies this resume protocol:
Resuming the USB interface (21.13 USB Software Operating Modes)


Enable PLL 
Wait PLL lock
Unfreeze USB clock
Clear Resume Informtion


which I have translated into this:

PLLCSR |= B00000010;   //-Enable             PLL PLLCSR.PLLE = 1; 
while (!(PLLCSR &amp; 1)); //-Wait PLL LOCK      while (PLLCSR.PLOCK != 1);
USBCON &amp;= B11011111;   //-Unfreeze USB clock USBCON.FRZCLK = 0; (Clear to unfreeze)
//-Clear Resume information ???


It have no effect whatsoever, have no idea how to clear resume information though...

Also, for the record, the LEDs are flashing happily every 8 seconds.
I found an answer to a similar question here:
https://forum.sparkfun.com/viewtopic.php?f=32&amp;t=39214&amp;start=15#p175098

Note: it requires you to close and open the serial monitor at proper timings.

// disable the USB prior going to sleep
USBCON |= _BV(FRZCLK);  //freeze USB clock
PLLCSR &amp;= ~_BV(PLLE);   // turn off USB PLL
USBCON &amp;= ~_BV(USBE);   // disable USB

// and wake it up after
//routine to properly wake up
sleep_disable();
delay(100);
USBDevice.attach(); // keep this
delay(100);
Serial.begin(9600);
delay(100);