
UM10375
All information provided in this document is subject to legal disclaimers.
© NXP B.V. 2011. All rights reserved.
User manual
Rev. 3 — 14 June 2011
162 of 368
NXP Semiconductors
UM10375
Chapter 10: LPC13xx USB device controller
the SETUP data. If it is set then it should discard the previously read data, clear the PO bit
by issuing a Select Endpoint/Clear Interrupt command, read the new SETUP data and
again check the status of the PO bit.
See
Section 10.13 “Functional description”
for a description of when this command is
used.
10.11.14 Validate Buffer (Command: 0xFA, Data: none)
When the CPU has written data into an IN buffer, software should issue a Validate Buffer
command. This tells hardware that the buffer is ready for sending on the USB bus.
Hardware will send the contents of the buffer when the next IN token packet is received.
Internally, there is a hardware FIFO status flag called Buffer_Full. This flag is set by the
Validate Buffer command and cleared when the data has been sent on the USB bus and
the buffer is empty.
A control IN buffer cannot be validated when its corresponding OUT buffer has the Packet
Over-written (PO) bit (see the Clear Buffer Register) set or contains a pending SETUP
packet. For the control endpoint the validated buffer will be invalidated when a SETUP
packet is received.
See
Section 10.13 “Functional description”
for a description of when this command is
used.
Remark:
For sending an empty packet, the Validate Buffer command should also be
used.
10.12 USB device controller initialization
The LPC134x USB device controller initialization includes initialization of the USB clock
and the device controller.
10.12.1 USB clock configuration
1. Enable the PLL for USB clock if the PLL is used.
2. Set the system oscillator control register SYSOSCCTRL (see
to 0.
3. Enable the system oscillator by clearing bit 5 in the PDAWAKECFG register (see
), then wait 200
s for system oscillator to stabilize.
Table 185. Clear Buffer command description
Bit
Symbol Value Description
Reset
value
0
PO
Packet over-written bit. This bit is only applicable to the control
endpoint EP0.
0
0
The previously received packet is intact.
1
The previously received packet was over-written by a later SETUP
packet.
7:1
-
-
Reserved, user software should not write ones to reserved bits. The
value read from a reserved bit is not defined.
NA