9397 750 XXXXX
© Koninklijke Philips Electronics N.V. 2005. All rights reserved.
User manual
Rev. 01 — 15 August 2005
222
Philips Semiconductors
UM10139
Volume 1
Chapter 14: USB Device Controller
14.9 Protocol engine command description
The protocol engine operates based on the commands issued from the CPU.
These commands have to be written into the Command Code register (
The read data when present will be available in the Command Data register
(
) after the successful execution of the command.
protocol engine commands.
Here is an example of the Read Current Frame Number command (reading 2 bytes):
USBDevIntClr = 0x30; // Clear cmd_code_empty & cmd_data_full int. bits
USBCmdCode = 0x00F50500;
while (!(USBDevIntSt & 0x10)); // Wait cmd_code_empty
USBDevIntClr = 0x10; // Clear cmd_code_empty interrupt bit
USBCmdCode = 0x00F50200;
while (!(USBDevIntSt & 0x20)); // Wait for cmd_data_full
CurFrameNum = USBCmdData; // Read Frame number LSB byte
USBDevIntClr = 0x10; // Clear cmd_code_empty interrupt bit
USBCmdCode = 0x00F50200;
while (!(USBDevIntSt & 0x20)); // Wait for cmd_data_full
Temp = USBCmdData; // Read Frame number MSB byte
CurFrameNum = CurFrameNum | (Temp << 8);
Table 224: USB System Error Interrupt Set register (USBSysErrIntSet - address 0xE009 00C0) bit description
Bit
Symbol
Value
Description
Reset
value
31:0
EPxx
Set endpoint xx (0
≤
xx
≤
31) System Error Interrupt request.
0
0
Ne effect.
1
Set the EPxx System Error Interrupt request in the USBSysErrIntSt register.
Table 225: Protocol engine command code table
Command name
Recipient
Command
Data phase (coding)
Device commands
Set Address
Device
00 D0 05 00
Write 1 byte - 00 <Byte> 01 00
Configure Device
Device
00 D8 05 00
Write 1 byte - 00 <Byte> 01 00
Set Mode
Device
00 F3 05 00
Write 1 byte - 00 <Byte> 01 00
Read Current Frame Number
Device
00 F5 05 00
Read 1 or 2 bytes - 00 F5 02 00
Read Test Register
Device
00 FD 05 00
Read 2 bytes - 00 FD 02 00
Set Device Status
Device
00 FE 05 00
Write 1 byte - 00 <Byte> 01 00
Get Device Status
Device
00 FE 05 00
Read 1 byte - 00 FE 02 00
Get Error Code
Device
00 FF 05 00
Read 1 byte - 00 FF 02 00
Read Error Status
Device
00 FB 05 00
Read 1 byte - 00 FB 02 00
Endpoint Commands