English
Language : 

PIC18F47J53 Datasheet, PDF (380/586 Pages) Microchip Technology – 28/44-Pin, High-Performance USB Microcontrollers with nanoWatt XLP Technology
PIC18F47J53 FAMILY
23.2 USB Status and Control
The operation of the USB module is configured and
managed through three control registers. In addition, a
total of 22 registers are used to manage the actual USB
transactions. The registers are:
• USB Control register (UCON)
• USB Configuration register (UCFG)
• USB Transfer Status register (USTAT)
• USB Device Address register (UADDR)
• Frame Number registers (UFRMH:UFRML)
• Endpoint Enable registers 0 through 15 (UEPn)
23.2.1 USB CONTROL REGISTER (UCON)
The USB Control register (Register 23-1) contains bits
needed to control the module behavior during transfers.
The register contains bits that control the following:
• Main USB Peripheral Enable
• Ping-Pong Buffer Pointer Reset
• Control of the Suspend mode
• Packet Transfer Disable
In addition, the USB Control register contains a status
bit, SE0 (UCON<5>), which is used to indicate the
occurrence of a single-ended zero on the bus. When
the USB module is enabled, this bit should be
monitored to determine whether the differential data
lines have come out of a single-ended zero condition.
This helps to differentiate the initial power-up state from
the USB Reset signal.
The overall operation of the USB module is controlled
by the USBEN bit (UCON<3>). Setting this bit activates
the module and resets all of the PPBI bits in the Buffer
Descriptor Table (BDT) to ‘0’. This bit also activates the
internal pull-up resistors if they are enabled. Thus, this
bit can be used as a soft attach/detach to the USB.
Although all status and control bits are ignored when
this bit is clear, the module needs to be fully preconfig-
ured prior to setting this bit. The USB clock source
should have been already configured for the correct
frequency and running. If the PLL is being used, it
should be enabled at least 2 ms (enough time for the
PLL to lock) before attempting to set the USBEN bit.
Note:
When disabling the USB module, make
sure the SUSPND bit (UCON<1>) is clear
prior to clearing the USBEN bit. Clearing
the USBEN bit when the module is in the
suspended state may prevent the module
from fully powering down
DS39964B-page 380
Preliminary
 2010 Microchip Technology Inc.