
EM358x
Rev. 0.4
131
9.12 Suspend and Resume
The USB specification details the maximum allowable current draw while suspended and how quickly a device
must achieve this current draw. Fully supporting all of electrical compliance for the purpose of an EM358x device
passing USB Certification is tightly coupled with the application being run on the EM358x and the larger EM358x
system. From the perspective of the EM358x device, suspend is an asynchronous event. Application designs will
have to be written to effectively handle suspend, resume, remote wakeup and their clocking requirements
To achieve the lower current required, some peripherals need to be disabled. Especially the radio must be
shutdown. To keep the chip functional enough to stay on the USB bus and resume from the suspended state, the
system clock needs to be divided by 4. Refer to figure 5-2 Clocks Block Diagram to see exactly where in the
clocking of the chip the division occurs. Peripherals that are kept active might need to be adjusted for the system
clock being divided by 4.
When the bus suspends this device, the interrupt INT_USBSUSPEND will pend. To divide the system clock by 4,
set the register bit USBSUSP_CLKSEL in the register CPU_CLKSEL and enter idle sleep. Clock division will not
occur until the system enters idle sleep. An exit from idle sleep will automatically disable the divide by 4, restoring
the system clock, and clearing the USBSUSP_CLKSEL bit. Refer to section 5.5 Power Management for general
information about idle sleep.
When the bus resumes the device, the interrupt INT_USBRESUME will pend. The act of servicing the interrupt
will take the system out of idle sleep and disable the divide by 4, restoring the system clock.
The interrupt INT_USBWAKEUP will pend after a successful remote wakeup. Because code on this device is the
action that instigated a remote wakeup, this device is already running and will not have been in idle sleep with the
slower clock mode. With respect to current consumption in the larger system, INT_USBWAKEUP can be treated
like INT_USBRESUME with respect to using pieces of the system that consume higher current, such as the radio.
9.13 Interrupts
USB interrupts are generated on the following events:
INT_USBRXVALIDEPx: Reception becoming valid is indicated with the INT_USBRXVALIDEPx bits. The
interrupt pends on the rising edge of either of the corresponding USB_RXVALIDEPxy bits for endpoint x in the
USB_RXVALID register.
INT_USBTXACTVEEPx: Transmit activity completing is indicated with the INT_USBTXACTVEEPx bit. The
interrupt pends on the falling edge of either of the corresponding USB_TXACTIVEEPxy bits for endpoint x in
the USB_ACTIVE register.
INT_USBRESET: A reset on the bus will reset the USB core and pend the INT_USBRESET bit. A USB reset
of the core will not affect USB DMA. Therefore USB DMA needs to be manually reset.
INT_USBSUSPEND: A suspend on the bus will pend the INT_USBSUSPEND bit.
INT_USBRESUME: When in the suspended state, a resume on the bus will pend the INT_USBRESUME bit.
INT_USBWAKEUP: A successful remote wakeup from the suspended state (performed with the
USB_RESUME register) pends the INT_USBWAKEUP bit. This activity is very similar to INT_USBRESUME,
except it is initiated by this device instead of the bus.
INT_USBSOF: Reception of a Start of Frame packet will pend the INT_USBSOF bit. Because a SOF packet
can be used by the host to prevent the idle state (suspending), this interrupt could burden the device and
therefore might be best left disabled.
INT_USBBUFRXOVF: Buffer reception overflow will pend the INT_USBBUFRXOVF bit.
INT_USBBUFTXUND: Buffer transmit underflow will pend the INT_USBBUFTXUND bit.
INT_USBPIPERXOVF: Pipeline reception overflow will pend the INT_USBPIPERXOVF bit.
INT_USBPIPETXUND: Pipeline transmit underflow will pend the INT_USBPIPETXUND bit.
INT_USBNAK: Reception of a NAK packet will pend the INT_USBNAK bit. This interrupt is best left disabled.
Some NAKs are not an error, other NAKs will occur on errors that will be retried automatically by the core.
Содержание EMBER EM358 series
Страница 2: ...EM358x 2 Rev 0 4 ...
Страница 7: ...EM358x Rev 0 4 7 ...