Device Initialization
13-79
USB Function Module
13.4 Device Initialization
To allow communication between the device and a USB host, the local host
must configure the device by filling the configuration registers.
For each endpoint, the local host must write to dedicated register:
-
Endpoint size
-
Whether or not double buffering is allowed for endpoint
-
Endpoint type (isochronous or non-isochronous)
-
Address of the pointer
The RAM has a specified size (2048 bytes), and the local host can choose its
configuration by setting appropriate value. Figure 13–9 shows an example of
RAM organization.
Once the endpoints are configured, the local host must set the Cfg_Lock bit.
If this bit is not set, all transactions are ignored by the core. Then, when the
local host is ready to communicate with the USB host, it must set the Pullup_En
bit. The local host can wait until the DS_Chg Attach interrupt has been
detected and handled before setting the Pullup_En bit. The USB host does not
detect the device until this bit is set.
Figure 13–10 and Figure 13–11 are flowcharts of the configuration phase.