How to enable sleep mode in HID keyboard example

1 post / 0 new
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello Everyone,


I am new to USB protocol and trying to implement a USB keyboard with SAMD21G18A MCU. With the help of USB device HID Keyboard example from ASF wizard of ATMEL studio 7.0 I am able make the keyboard work. But when I try to enable sleep mode for low power consumption (standby or sleepmode2) the device wake up immediately. I found that the USB interrupts are causing the device to wake up and I wanted to suspend the USB until any key is pressed. Is this possible or only the USB Host (computer) can put the USB in suspend mode ? What I realty want is the keyboard to go to sleep with consuming least current and wake up when any key is pressed. Any suggestion would be helpful.