USB-Microcontroller C540U Family
SAB-C540U / -C541U Block Diagram Oscillator Watchdog RAM 256 x 8 OTP 4K x 8 (C540U) 8K x 8 (C541U) OSC & Timing C500 Emulation Support logic (E-Hooks) Prog. Watchdog Timer (C541U only) SSC (SPI) Interface (C541U only) Port 0 Port 1 Port 2 Port 3 8 lines 6 / 8 lines 1) 1) P-LCC-44: 6lines; S-DIP-52: 8lines Timer 0 LED Timer 1 LED D+ Transceiver USB PLL Module D- LED Interrupt Unit
SAB-C540U / -C541U List of Features Enhanced 8-Bit C500-CPU 500 ns Instruction Cycle Time @ 12 MHz CPU Clock Two 16-bit Timer/Counters (C501 compatible T0/1) [4kbytes in the C540U] 8 Kbytes OTP / 256 bytes RAM USB Device Core (FS/LS speed) Synchronous Serial Channel, Watchdog Timer [C541U only] 30 digit. I/O Ports, 32 in SDIP52 LED Driver capability on 3 dedicated pins, 10 mA / 4,5 to 5,5 V Power supply voltage range: according to USB spec Enhanced HooksTechnology 48 MHz PLL on-chip for FS Transceiver, D+ D-, on-chip ...the interfacing solution!
Command: Get descriptor (Who is out there?) Setup stage USB Device PC Sync 00000001 SOF 0xA5 Frame# 0x0DD CRC5 0x15 EOP 001 Sync 00000001 ACK 0x4B EOP 001 Sync 00000001 SETUP 0xB4 ADDR 0x00 ENDP 0x0 CRC5 0x08 EOP 001 Sync 00000001 DATA0 0xC3 DATA 80 06 00 01 00 00 40 00 CRC16 0xBB29 EOP 001 Enumeration process on the C541U
Start Of Frame ...will be generated every millisecond Setup stage USB Device PC Sync 00000001 SOF 0xA5 Frame# 0x0DD CRC5 0x15 EOP 001 Sync 00000001 SOF 0xA5 Frame# 0x0DD CRC5 0x15 EOP 001 Packet start , signaling to the transceiver: “packet arriving“ Start of Frame (every millisecond) Frame number (0 - 2047) overrolling 5 bit Checksum over Frame# End of Packet (D+ and D- are low) Sync 00000001 SETUP 0xB4 ADDR 0x00 ENDP 0x0 CRC5 0x08 EOP 001 DATA0 0xC3 DATA 80 06 00 01 00 00 40 00 CRC16 0xBB29 ACK 0x4B
Setup packets are fully decoded and Interrupts are generated Setup stage USB Device PC Sync 00000001 SOF 0xA5 Frame# 0x0DD CRC5 0x15 EOP 001 Sync 00000001 Sync 00000001 SETUP 0xB4 ADDR 0x00 ENDP 0x0 CRC5 0x08 EOP 001 SETUP 0xB4 ADDR 0x00 ENDP 0x0 CRC5 0x08 EOP 001 Setup Packet (start of control transfer) Address 0 (default addr. f. every new plugged-in dev.) Endpoint 0 (used for configuration) Sync 00000001 DATA0 0xC3 DATA 80 06 00 01 00 00 40 00 CRC16 0xBB29 EOP 001 Sync 00000001 ACK 0x4B EOP 001 Enumeration process on the C541U
The Data packet defines what kind of setup transfer is initiated Setup stage PC USB Device Sync 00000001 SETUP 0xB4 ADDR 0x00 ENDP 0x0 CRC5 0x08 EOP 001 Sync 00000001 DATA0 0xC3 Sync 00000001 DATA0 0xC3 DATA 80 06 00 01 00 00 40 00 CRC16 0xBB29 EOP 001 DATA 80 06 00 01 00 00 40 00 CRC16 0xBB29 EOP 001 Sync 00000001 ACK 0x4B EOP 001 DATA Get device descriptor generates an interrupt 80 = transfer direction, std. command 06 = get descriptor 00 = index of descriptor Get device descriptor generates an interrupt 01 = device descriptor 00 00 = language ID 40 00 = amount of bytes requested by host (little endian format; Lowbyte first, Highbyte least)
Every control transfer will be ACKnowledged Setup stage Sync 00000001 SOF 0xA5 Frame# 0x0DD CRC5 0x15 EOP 001 PC Sync 00000001 SETUP 0xB4 ADDR 0x00 ENDP 0x0 CRC5 0x08 EOP 001 Sync 00000001 DATA0 0xC3 DATA 80 06 00 01 00 00 40 00 CRC16 0xBB29 EOP 001 Sync 00000001 ACK 0x4B EOP 001 USB Device Acknowledge Packet Enumeration process on the C541U
Data In Packet (Host requesting data from device) Every data transfer will be initiated with an IN/OUT package by the host(PC) Data stage USB Device PC Sync 00000001 SOF 0xA5 Frame# 0x0DE CRC5 0x17 EOP 001 Sync 00000001 DATA1 0xD2 DATA 12 01 00 01 00 00 00 08 CRC16 0xC8E7 EOP 001 Sync 00000001 ACK 0x4B EOP 001 Sync 00000001 IN 0x96 ADDR 0x00 ENDP 0x0 CRC5 0x8 EOP 001 Data In Packet (Host requesting data from device) Enumeration process on the C541U
12 = length of device descriptor 01 = device descriptor type Data packages Data stage Sync 00000001 IN 0x96 ADDR 0x00 ENDP 0x0 CRC5 0x8 EOP 001 PC USB Device Sync 00000001 DATA1 0xD2 DATA 12 01 00 01 00 00 00 08 CRC16 0xC8E7 EOP 001 Sync 00000001 DATA1 0xD2 DATA 12 01 00 01 00 00 00 08 CRC16 0xC8E7 EOP 001 Sync 00000001 ACK 0x4B EOP 001 DATA 12 = length of device descriptor 01 = device descriptor type first 8 bytes of the device descriptor initialized in config.h 01 = high-byte of USB-Specification 00 = low-byte of USB-Specification V 01.00 } 00 = Device Protocol 00 = Device Class 00 = Device Sub Class 08 = Max. packet size of endpoint 0
PC End of Data Stage USB Data stage Status stage Data Out Packet (Host aborts data stage) USB Device PC Sync 00000001 SOF 0xA5 Frame# 0x0E0 CRC5 0x0E EOP 001 Sync 00000001 ACK 0x4B EOP 001 Sync 00000001 DATA1 0xD2 DATA CRC16 0x0000 EOP 001 Sync 00000001 OUT 0x87 ADDR 0x00 ENDP 0x0 CRC5 0x08 EOP 001 Empty data packet indicating data stage end Enumeration process on the C541U
Reset initiated from host Reset from Host (10ms) USB Device PC RESET 128160 Reset initiated from host Enumeration process on the C541U
Command: Set Address (You are called Number 2 from now on!) USB Device Sync 00000001 SOF 0xA5 Frame# 0x143 CRC5 0x04 EOP 001 Sync 00000001 SETUP 0xB4 ADDR 0x00 ENDP 0x0 CRC5 0x08 EOP 001 Sync 00000001 DATA0 0xC3 DATA 00 05 02 00 00 00 00 00 CRC16 0xD768 EOP 001 PC Sync 00000001 ACK 0x4B EOP 001 DATA 00 = direction from host to device, std. command, recipient device 05 = set address 02 = device address nr. 2 00 00 00 00 00 = default this command is handled by the C54x itself without extra software
Empty data packet from device handled by C54x without Software End of Data Stage Data stage Status stage PC USB Device Sync 00000001 SOF 0xA5 Frame# 0x144 CRC5 0x08 EOP 001 Sync 00000001 DATA1 0xD2 DATA CRC16 0x0000 EOP 001 Sync 00000001 IN 0x96 ADDR 0x00 ENDP 0x0 CRC5 0x08 EOP 001 Sync 00000001 ACK 0x4B EOP 001 Empty data packet from device handled by C54x without Software Enumeration process on the C541U
Get Descriptor from Device Number 2 (What are you like?) Setup stage USB Device PC Sync 00000001 SOF 0xA5 Frame# 0x151 CRC5 0x1E EOP 001 Sync 00000001 ACK 0x4B EOP 001 Sync 00000001 DATA0 0xC3 DATA 80 06 00 01 00 00 12 00 CRC16 0x072F EOP 001 Sync 00000001 SETUP 0xB4 ADDR 0x02 ENDP 0x0 CRC5 0x15 EOP 001 Devices is accessed by address 2 Enumeration process on the C541U
Get Descriptor from Device Number 2 (What are you like?), details Setup stage Sync 00000001 ACK 0x4B EOP 001 SETUP 0xB4 ADDR 0x02 ENDP 0x0 CRC5 0x15 SOF 0xA5 Frame# 0x151 0x1E PC USB Device Sync 00000001 DATA0 0xC3 DATA 80 06 00 01 00 00 12 00 CRC16 0x072F EOP 001 Sync 00000001 DATA0 0xC3 DATA 80 06 00 01 00 00 12 00 CRC16 0x072F EOP 001 DATA 80 = transfer direction, std. command 06 = get descriptor 00 = index of descriptor 01 = device descriptor 00 00 = language ID 12 00 = bytes to transfer
IN request (get data about device description) Data stage USB Device PC Sync 00000001 SOF 0xA5 Frame# 0x152 CRC5 0x1C EOP 001 Sync 00000001 DATA1 0xD2 DATA 12 01 00 01 00 00 00 08 CRC16 0xC8E7 EOP 001 Sync 00000001 ACK 0x4B EOP 001 Sync 00000001 IN 0x96 ADDR 0x02 ENDP 0x0 CRC5 0x15 EOP 001 Enumeration process on the C541U
IN request, details (get data about device description) Data stage Sync 00000001 ACK 0x4B EOP 001 IN 0x96 ADDR 0x02 ENDP 0x0 CRC5 0x15 USB Device PC Sync 00000001 DATA1 0xD2 DATA 12 01 00 01 00 00 00 08 CRC16 0xC8E7 EOP 001 Sync 00000001 DATA1 0xD2 DATA 12 01 00 01 00 00 00 08 CRC16 0xC8E7 EOP 001 DATA 12 = length of device descriptor 01 = device descriptor type first 8 bytes of the device descriptor initialized in config.h 01 = highbyte of USB-Specification 00 = lowbyte of USB-Specification 00 = Device Protocol 00 = Device Class 00 = Device Sub Class 08 = Max. packetsize of endpoint 0
2nd IN request (get data about device description) Data stage USB Device PC Sync 00000001 SOF 0xA5 Frame# 0x153 CRC5 0x03 EOP 001 Sync 00000001 DATA0 0xC3 DATA 8B 05 41 C5 01 00 00 00 CRC16 0x86DB EOP 001 Sync 00000001 ACK 0x4B EOP 001 Sync 00000001 IN 0x96 ADDR 0x02 ENDP 0x0 CRC5 0x15 EOP 001 Enumeration process on the C541U
2nd IN request, details Device Specific Data are Transferred to PC USB Device PC Sync 00000001 ACK 0x4B EOP 001 IN 0x96 ADDR 0x02 ENDP 0x0 CRC5 0x15 Sync 00000001 DATA0 0xC3 DATA 8B 05 41 C5 01 00 00 00 CRC16 0x86DB EOP 001 Sync 00000001 DATA0 0xC3 DATA 8B 05 41 C5 01 00 00 00 CRC16 0x86DB EOP 001 DATA 8B = lowbyte of vendor ID 05 = highbyte of vendor ID } next 8 bytes of the device descriptor initialized in config.h C5 = highbyte of product ID 41 = lowbyte of product ID } C541 01 = lowbyte of devicenumber 00 = highbyte of devicenumber 00 = index for manufacturer string descriptor 00 = index for product string descriptor
3rd IN request the remaining data is transferred Data stage USB Device PC Sync 00000001 SOF 0xA5 Frame# 0x154 CRC5 0x1D EOP 001 Sync 00000001 SOF 0xA5 Frame# 0x154 CRC5 0x1D EOP 001 IN 0x96 ADDR 0x02 ENDP 0x0 0x15 DATA1 0xD2 DATA 00 01 CRC16 0xFCF1 Sync 00000001 DATA1 0xD2 DATA 00 01 CRC16 0xFCF1 EOP 001 Sync 00000001 IN 0x96 ADDR 0x02 ENDP 0x0 CRC5 0x15 EOP 001 Sync 00000001 ACK 0x4B EOP 001 DATA 00 = index for serial number string descriptor 01 = number of configurations
Command: OUT transfer (with empty data package) finishes the data stage Data stage Status stage USB Device PC Sync 00000001 SOF 0xA5 Frame# 0x155 CRC5 0x02 EOP 001 Sync 00000001 ACK 0x4B EOP 001 Sync 00000001 OUT 0x87 ADDR 0x02 ENDP 0x0 CRC5 0x15 EOP 001 Sync 00000001 DATA1 0xD2 DATA CRC16 0x0000 EOP 001 Enumeration process on the C541U
Command: Get Configuration Descriptor (How does the device function?) Setup stage PC USB Device Sync 00000001 SOF 0xA5 Frame# 0x157 CRC5 0x1F EOP 001 Sync 00000001 ACK 0x4B EOP 001 Sync 00000001 DATA0 0xC3 DATA 80 06 00 02 00 00 FF 00 CRC16 0x9725 EOP 001 Sync 00000001 SETUP 0xB4 ADDR 0x02 ENDP 0x0 CRC5 0x15 EOP 001 Enumeration process on the C541U
80 = transfer direction, std. command 02 = configuration descriptor Command: Get Configuration Descriptor (How does the device function?), details Sync 00000001 ACK 0x4B EOP 001 SETUP 0xB4 ADDR 0x02 ENDP 0x0 CRC5 0x15 SOF 0xA5 Frame# 0x157 0x1F PC USB Device Sync 00000001 DATA0 0xC3 DATA 80 06 00 02 00 00 FF 00 CRC16 0x9725 EOP 001 Sync 00000001 DATA0 0xC3 DATA 80 06 00 02 00 00 FF 00 CRC16 0x9725 EOP 001 DATA 80 = transfer direction, std. command 06 = get descriptor 00 = index of descriptor 02 = configuration descriptor 00 00 = language ID 00 = highbyte of bytes to transfer FF = lowbyte of bytes to transfer
In Request: Gives Feedback to How does the device function? Data stage PC USB Device Sync 00000001 SOF 0xA5 Frame# 0x158 CRC5 0x0F EOP 001 Sync 00000001 DATA1 0xD2 DATA 09 02 19 00 01 01 00 60 CRC16 0x5020 EOP 001 Sync 00000001 ACK 0x4B EOP 001 Sync 00000001 IN 0x96 ADDR 0x02 ENDP 0x0 CRC5 0x15 EOP 001 Enumeration process on the C541U
In Request: Gives Feedback to How does the device function?, details USB Device PC Sync 00000001 IN 0x96 ADDR 0x02 ENDP 0x0 CRC5 0x15 EOP 001 Sync 00000001 DATA1 0xD2 DATA 09 02 19 00 01 01 00 60 CRC16 0x5020 EOP 001 Sync 00000001 DATA1 0xD2 DATA 09 02 19 00 01 01 00 60 CRC16 0x5020 EOP 001 Sync 00000001 ACK 0x4B EOP 001 DATA 09 = length of configuration descriptor first 8 bytes of the device descriptor initialized in config.h 02 = configuration descriptor type 19 00 = length of configuration, interface and endpoint descriptor 01 = number of used interfaces in this configuration 01 = value to set this configuration with SetConfiguration 00 = index to configuration string descriptor 60 = attributes of configuration
2nd In Request: Gives Feedback to How does the device function? Data stage USB Device PC Sync 00000001 SOF 0xA5 Frame# 0x159 CRC5 0x10 EOP 001 Sync 00000001 DATA0 0xC3 DATA 32 09 04 00 00 01 00 00 CRC16 0x273E EOP 001 Sync 00000001 ACK 0x4B EOP 001 Sync 00000001 IN 0x96 ADDR 0x02 ENDP 0x0 CRC5 0x15 EOP 001 Enumeration process on the C541U
32 = max. power consumption (in 2mA units) 2nd In Request: Gives Feedback to How does the device function?, details PC USB Device Sync 00000001 ACK 0x4B EOP 001 IN 0x96 ADDR 0x02 ENDP 0x0 CRC5 0x15 Sync 00000001 DATA0 0xC3 DATA 32 09 04 00 00 01 00 00 CRC16 0x273E EOP 001 Sync 00000001 DATA0 0xC3 DATA 32 09 04 00 00 01 00 00 CRC16 0x273E EOP 001 DATA 32 = max. power consumption (in 2mA units) next 8 bytes of the device descriptor initialized in config.h 09 = length of interface descriptor 04 = interface descriptor type 00 = number of interfaces 00 = alternate settings 01 = used endpoints used in this interface 00 = interface class 00 = interface sub class
3rd In Request: Gives Feedback to How does the device function 3rd In Request: Gives Feedback to How does the device function?, details PC USB Device Sync 00000001 SOF 0xA5 Frame# 0x15B CRC5 0x0D EOP 001 Sync 00000001 DATA0 0xC3 DATA 00 CRC16 0x0000 EOP 001 Sync 00000001 IN 0x96 ADDR 0x02 ENDP 0x0 CRC5 0x15 EOP 001 Sync 00000001 ACK 0x4B EOP 001 00 = polling interval for interrupt endpoints Enumeration process on the C541U
Command: OUT transfer finishes the data stage Data stage Status stage PC USB Device Sync 00000001 SOF 0xA5 Frame# 0x15C CRC5 0x15 EOP 001 Sync 00000001 ACK 0x4B EOP 001 Sync 00000001 OUT 0x87 ADDR 0x02 ENDP 0x0 CRC5 0x15 EOP 001 Sync 00000001 DATA1 0xD2 DATA CRC16 0x0000 EOP 001 Enumeration process on the C541U
USB Application Support Starterkit
USB Application Support Phytec KitCON-541 / Starterkit Evaluation Board - Starter Kit Starterkit
C541-Evaluation Board Phytec KitCON-541 / Starterkit 1 2 3 4 DADD 5k 100k 47nF detached/attached circuit GND n-channel FET rev. USB Spec. 1.0 SAB-C541 on PGA 44 socket 1,5k 3,0-3,6V 4,0-4,75V 0,0 V FULL speed USB driver LOW speed USB powered / self powered selector D+ D- 96-pol connector female Common GND plane D- D+ USB GND USB Vcc Common Vcc plane USB connector Starterkit
Infos on INTERNET Microcontrollers general: http://www.siemens.de/Semiconductor/Microcontroller/ ...for infos on our USB parts http://www.siemens.de/Semiconductor/products/ICs/34/usb.htm ...the interfacing solution