C54x USB from SIEMENS

Download Report

Transcript C54x USB from SIEMENS

USB-Microcontroller
C540U Family
HL CE M,
lehmann
usb_boothesc98.ppt
1 - 7/20/2015, 14:35
SAB-C540U / -C541U
Block Diagram
Oscillator Watchdog
OSC & Timing
RAM
OTP
256 x 8
4K x 8 (C540U)
8K x 8 (C541U)
C500
Prog. Watchdog Timer
(C541U only)
Emulation
Support logic
(E-Hooks)
SSC (SPI) Interface
(C541U only)
Timer 0
Transceiver
Timer 1
USB
PLL
Module
Port 0
8 lines
Port 1
6 / 8 lines
Port 2
8 lines
Port 3
8 lines
1)
Interrupt Unit
1) P-LCC-44:
6lines; S-DIP-52: 8lines
HL CE M,
lehmann
usb_boothesc98.ppt
2 - 7/20/2015, 14:35
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!
HL CE M,
lehmann
usb_boothesc98.ppt
3 - 7/20/2015, 14:35
Command: Get descriptor
(Who is out there?)
Setup stage
USB
Sync
SOF
00000001 0xA5
Frame#
0x0DD
CRC5
0x15
EOP
001
Sync
00000001
SETUP
0xB4
ADDR ENDP
0x00
0x0
Sync
00000001
DATA0
0xC3
DATA
CRC16 EOP
80 06 00 01 00 00 40 00 0xBB29 001
Sync
ACK
00000001 0x4B
CRC5
0x08
EOP
001
Device
EOP
001
Enumeration process on the C541U
HL CE M,
lehmann
usb_boothesc98.ppt
4 - 7/20/2015, 14:35
Start Of Frame
...will be generated every millisecond
Setup stage
USB
Sync
SOF
00000001 0xA5
Frame#
0x0DD
CRC5
0x15
EOP
001
Sync
00000001
SETUP
0xB4
ADDR ENDP
0x00
0x0
Sync
00000001
DATA0
0xC3
DATA
CRC16 EOP
80 06 00 01 00 00 40 500bit0xBB29
001over Frame#
Checksum
Sync
ACK
00000001 0x4B
EOP
001
CRC5
0x08
EOP
001
Device
End of Packet (D+ and D- are low)
Frame number (0 - 2047) overrolling
Start of Frame (every millisecond)
Packet start , signaling to the transceiver: “packet arriving“
HL CE M,
lehmann
usb_boothesc98.ppt
5 - 7/20/2015, 14:35
Setup packets are fully decoded and
Interrupts are generated
Setup stage
USB
Sync
SOF
00000001 0xA5
Frame#
0x0DD
Sync
00000001
SETUP
0xB4
Sync
00000001
DATA0
0xC3
Sync
ACK
00000001 0x4B
CRC5
0x15
ADDR ENDP
0x00
0x0
EOP
001
CRC5
0x08
EOP
001
Device
DATA
CRC16 EOP
80 06 00 01 00 00 40 00 0xBB29 001
Endpoint 0 (used for configuration)
EOP
001
Address 0 (default addr. f. every new plugged-in dev.)
Setup Packet (start of control transfer)
Enumeration process on the C541U
HL CE M,
lehmann
usb_boothesc98.ppt
6 - 7/20/2015, 14:36
The Data packet defines what kind of
setup transfer is initiated
Setup stage
Sync
00000001
SETUP
0xB4
ADDR ENDP
0x00
0x0
Sync
00000001
DATA0
0xC3
DATA
CRC16 EOP
80 06 00 01 00 00 40 00 0xBB29 001
Sync
ACK
00000001 0x4B
EOP
001
CRC5
0x08
EOP
001
USB
Device
DATA
Get device descriptor
80 = transfer direction, std. command
06 = get descriptor
00 = index of descriptor
01 = device descriptor
generates an interrupt
Get device descriptor
00 00 = language ID
generates an interrupt
40 00 = amount of bytes requested
by host (little endian format;
Lowbyte first, Highbyte least)
HL CE M,
lehmann
usb_boothesc98.ppt
7 - 7/20/2015, 14:36
Every control transfer will be
ACKnowledged
Sync
SOF
00000001 0xA5
Frame#
0x0DD
CRC5
0x15
Setup stage
EOP
001
Sync
00000001
SETUP
0xB4
ADDR ENDP
0x00
0x0
Sync
00000001
DATA0
0xC3
DATA
CRC16 EOP
80 06 00 01 00 00 40 00 0xBB29 001
Sync
ACK
00000001 0x4B
CRC5
0x08
EOP
001
Acknowledge Packet
EOP
001
USB
Device
Enumeration process on the C541U
HL CE M,
lehmann
usb_boothesc98.ppt
8 - 7/20/2015, 14:36
Every data transfer will be initiated with an
IN/OUT package by the host(PC)
Data stage
USB
Sync
SOF
00000001 0xA5
Frame#
0x0DE
Sync
00000001
IN
0x96
Sync
00000001
DATA1
0xD2
Sync
ACK
00000001 0x4B
CRC5
0x17
ADDR ENDP
0x00
0x0
EOP
001
CRC5
0x8
EOP
001
Device
DATA
CRC16 EOP
12 01 00 01 00 00 00 08 0xC8E7 001
EOP
001
Data In Packet (Host requesting data from device)
Enumeration process on the C541U
HL CE M,
lehmann
usb_boothesc98.ppt
10 - 7/20/2015, 14:36
Data packages
Data stage
Sync
00000001
IN
0x96
Sync
00000001
DATA1
0xD2
Sync
ACK
00000001 0x4B
ADDR ENDP
0x00
0x0
CRC5
0x8
EOP
001
USB
DATA
CRC16 EOP
12 01 00 01 00 00 00 08 0xC8E7 001
EOP
001
DATA
12 = length of device descriptor
01 = device descriptor type
00 = low-byte of USB-Specification
} V 01.00
01 = high-byte of USB-Specification
00 = Device Class
Device
first 8 bytes of the
device descriptor
initialized in config.h
00 = Device Protocol
00 = Device Sub Class
08 = Max. packet size of endpoint 0
HL CE M,
lehmann
usb_boothesc98.ppt
11 - 7/20/2015, 14:36
End of Data Stage
Data stage  Status stage
Data Out Packet (Host aborts data stage)
Sync
SOF
00000001 0xA5
Frame#
0x0E0
Sync
00000001
OUT
0x87
Sync
00000001
DATA1
0xD2
Sync
ACK
00000001 0x4B
CRC5
0x0E
ADDR ENDP
0x00
0x0
USB
EOP
001
CRC5
0x08
DATA
Device
EOP
001
CRC16
0x0000
EOP
001
EOP
001
Empty data packet
indicating data
stage end
Enumeration process on the C541U
HL CE M,
lehmann
usb_boothesc98.ppt
12 - 7/20/2015, 14:36
Reset from Host (10ms)
USB
RESET
128160
Device
Reset initiated from host
Enumeration process on the C541U
HL CE M,
lehmann
usb_boothesc98.ppt
13 - 7/20/2015, 14:36
Command: Set Address
(You are called Number 2 from now on!)
Sync
SOF
00000001 0xA5
Frame#
0x143
CRC5
0x04
Sync
00000001
SETUP
0xB4
ADDR ENDP
0x00
0x0
Sync
00000001
DATA0
0xC3
DATA
00 05 02 00 00 00 00 00
Sync
ACK
00000001 0x4B
EOP
001
USB
EOP
001
CRC5
0x08
EOP
001
CRC16
0xD768
EOP
001
Device
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
HL CE M,
lehmann
usb_boothesc98.ppt
14 - 7/20/2015, 14:36
End of Data Stage
Data stage  Status stage
USB
Sync
SOF
00000001 0xA5
Frame#
0x144
Sync
00000001
IN
0x96
Sync
00000001
DATA1
0xD2
Sync
ACK
00000001 0x4B
CRC5
0x08
ADDR ENDP
0x00
0x0
EOP
001
CRC5
0x08
DATA
EOP
001
CRC16
0x0000
Device
EOP
001
EOP
001
Empty data packet
from device handled
by C54x without
Software
Enumeration process on the C541U
HL CE M,
lehmann
usb_boothesc98.ppt
15 - 7/20/2015, 14:36
Get Descriptor from Device Number 2
(What are you like?)
Setup stage
USB
Sync
SOF
00000001 0xA5
Frame#
0x151
CRC5
0x1E
EOP
001
Sync
00000001
SETUP
0xB4
ADDR ENDP
0x02
0x0
Sync
00000001
DATA0
0xC3
DATA
80 06 00 01 00 00 12 00
Sync
ACK
00000001 0x4B
CRC5
0x15
EOP
001
Device
EOP
001
CRC16
0x072F
EOP
001
Devices is accessed
by address 2
Enumeration process on the C541U
HL CE M,
lehmann
usb_boothesc98.ppt
16 - 7/20/2015, 14:36
Get Descriptor from Device Number 2
(What are you like?), details
Setup stage
Sync
SOF
00000001 0xA5
Frame#
0x151
CRC5
0x1E
EOP
001
Sync
00000001
SETUP
0xB4
ADDR ENDP
0x02
0x0
Sync
00000001
DATA0
0xC3
DATA
80 06 00 01 00 00 12 00
Sync
ACK
00000001 0x4B
EOP
001
CRC5
0x15
USB
EOP
001
CRC16
0x072F
DATA
EOP
001
Device
80 = transfer direction, std. command
06 = get descriptor
00 = index of descriptor
01 = device descriptor
00 00 = language ID
12 00 = bytes to transfer
HL CE M,
lehmann
usb_boothesc98.ppt
17 - 7/20/2015, 14:36
IN request
(get data about device description)
Data stage
USB
Sync
SOF
00000001 0xA5
Frame#
0x152
Sync
00000001
IN
0x96
Sync
00000001
DATA1
0xD2
Sync
ACK
00000001 0x4B
CRC5
0x1C
ADDR ENDP
0x02
0x0
EOP
001
CRC5
0x15
EOP
001
Device
DATA
CRC16 EOP
12 01 00 01 00 00 00 08 0xC8E7 001
EOP
001
Enumeration process on the C541U
HL CE M,
lehmann
usb_boothesc98.ppt
18 - 7/20/2015, 14:36
IN request, details
(get data about device description)
Sync
00000001
IN
0x96
Sync
00000001
DATA1
0xD2
Sync
ACK
00000001 0x4B
ADDR ENDP
0x02
0x0
CRC5
0x15
EOP
001
Data stage
USB
DATA
CRC16 EOP
12 01 00 01 00 00 00 08 0xC8E7 001
EOP
001
Device
DATA
12 = length of device descriptor
01 = device descriptor type
00 = lowbyte of USB-Specification
01 = highbyte of USB-Specification
first 8 bytes of the
device descriptor
initialized in config.h
00 = Device Class
00 = Device Sub Class
00 = Device Protocol
08 = Max. packetsize of endpoint 0
HL CE M,
lehmann
usb_boothesc98.ppt
19 - 7/20/2015, 14:36
2nd IN request
(get data about device description)
Data stage
USB
Sync
SOF
00000001 0xA5
Frame#
0x153
Sync
00000001
IN
0x96
Sync
00000001
DATA0
0xC3
Sync
ACK
00000001 0x4B
CRC5
0x03
ADDR ENDP
0x02
0x0
EOP
001
CRC5
0x15
EOP
001
Device
DATA
CRC16 EOP
8B 05 41 C5 01 00 00 00 0x86DB 001
EOP
001
Enumeration process on the C541U
HL CE M,
lehmann
usb_boothesc98.ppt
20 - 7/20/2015, 14:36
2nd IN request, details
Device Specific Data are Transferred to PC
Sync
00000001
IN
0x96
Sync
00000001
DATA0
0xC3
Sync
ACK
00000001 0x4B
ADDR ENDP
0x02
0x0
CRC5
0x15
USB
EOP
001
DATA
CRC16 EOP
8B 05 41 C5 01 00 00 00 0x86DB 001
EOP
001
Device
DATA
8B = lowbyte of vendor ID
05 = highbyte of vendor ID
}
41 = lowbyte of product ID
C5 = highbyte of product ID
} C541
next 8 bytes of the
device descriptor
initialized in config.h
01 = lowbyte of devicenumber
00 = highbyte of devicenumber
00 = index for manufacturer string descriptor
00 = index for product string descriptor
HL CE M,
lehmann
usb_boothesc98.ppt
21 - 7/20/2015, 14:36
3rd IN request
the remaining data is transferred
Data stage
USB
Sync
SOF
00000001 0xA5
Frame#
0x154
Sync
00000001
IN
0x96
Sync
00000001
DATA1
0xD2
Sync
ACK
00000001 0x4B
CRC5
0x1D
ADDR ENDP
0x02
0x0
EOP
001
DATA
00 01
EOP
001
CRC5
0x15
EOP
001
Device
CRC16 EOP
0xFCF1 001
DATA
00 = index for serial number string descriptor
01 = number of configurations
HL CE M,
lehmann
usb_boothesc98.ppt
22 - 7/20/2015, 14:36
Command: OUT transfer (with empty data
package) finishes the data stage Data stage  Status stage
USB
Sync
SOF
00000001 0xA5
Frame#
0x155
Sync
00000001
OUT
0x87
Sync
00000001
DATA1
0xD2
Sync
ACK
00000001 0x4B
CRC5
0x02
ADDR ENDP
0x02
0x0
EOP
001
CRC5
0x15
DATA
Device
EOP
001
CRC16
0x0000
EOP
001
EOP
001
Enumeration process on the C541U
HL CE M,
lehmann
usb_boothesc98.ppt
23 - 7/20/2015, 14:36
Command: Get Configuration Descriptor
(How does the device function?)
Setup stage
USB
Sync
SOF
00000001 0xA5
Frame#
0x157
CRC5
0x1F
EOP
001
Sync
00000001
SETUP
0xB4
ADDR ENDP
0x02
0x0
Sync
00000001
DATA0
0xC3
DATA
CRC16
80 06 00 02 00 00 FF 00 0x9725
Sync
ACK
00000001 0x4B
CRC5
0x15
EOP
001
Device
EOP
001
EOP
001
Enumeration process on the C541U
HL CE M,
lehmann
usb_boothesc98.ppt
24 - 7/20/2015, 14:36
Command: Get Configuration Descriptor
(How does the device function?), details
Sync
SOF
00000001 0xA5
Frame#
0x157
CRC5
0x1F
EOP
001
Sync
00000001
SETUP
0xB4
ADDR ENDP
0x02
0x0
Sync
00000001
DATA0
0xC3
DATA
CRC16
80 06 00 02 00 00 FF 00 0x9725
Sync
ACK
00000001 0x4B
EOP
001
CRC5
0x15
USB
EOP
001
EOP
001
DATA
Device
80 = transfer direction, std. command
06 = get descriptor
00 = index of descriptor
02 = configuration descriptor
00 00 = language ID
FF = lowbyte of bytes to transfer
00 = highbyte of bytes to transfer
HL CE M,
lehmann
usb_boothesc98.ppt
25 - 7/20/2015, 14:36
In Request: Gives Feedback to
How does the device function?
Data stage
USB
Sync
SOF
00000001 0xA5
Frame#
0x158
Sync
00000001
IN
0x96
Sync
00000001
DATA1
0xD2
Sync
ACK
00000001 0x4B
CRC5
0x0F
ADDR ENDP
0x02
0x0
EOP
001
CRC5
0x15
DATA
09 02 19 00 01 01 00 60
EOP
001
CRC16
0x5020
Device
EOP
001
EOP
001
Enumeration process on the C541U
HL CE M,
lehmann
usb_boothesc98.ppt
26 - 7/20/2015, 14:36
In Request: Gives Feedback to
How does the device function?, details
Sync
00000001
IN
0x96
Sync
00000001
DATA1
0xD2
ADDR ENDP
0x02
0x0
CRC5
0x15
DATA
09 02 19 00 01 01 00 60
USB
EOP
001
CRC16
0x5020
EOP
001
Device
Sync
ACK EOP
DATA
00000001 0x4B 001
09 = length of configuration descriptor
02 = configuration descriptor type
first 8 bytes of the
device descriptor
initialized in config.h
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
HL CE M,
lehmann
usb_boothesc98.ppt
27 - 7/20/2015, 14:36
2nd In Request: Gives Feedback to
How does the device function?
Data stage
USB
Sync
SOF
00000001 0xA5
Frame#
0x159
Sync
00000001
IN
0x96
Sync
00000001
DATA0
0xC3
Sync
ACK
00000001 0x4B
CRC5
0x10
ADDR ENDP
0x02
0x0
EOP
001
CRC5
0x15
DATA
32 09 04 00 00 01 00 00
EOP
001
CRC16
0x273E
Device
EOP
001
EOP
001
Enumeration process on the C541U
HL CE M,
lehmann
usb_boothesc98.ppt
28 - 7/20/2015, 14:36
2nd In Request: Gives Feedback to
How does the device function?, details
Sync
00000001
IN
0x96
Sync
00000001
DATA0
0xC3
ADDR ENDP
0x02
0x0
CRC5
0x15
DATA
32 09 04 00 00 01 00 00
USB
EOP
001
CRC16
0x273E
EOP
001
Sync
ACK EOP
DATA
00000001 0x4B 001
32 = max. power consumption (in 2mA units)
09 = length of interface descriptor
04 = interface descriptor type
Device
next 8 bytes of the
device descriptor
initialized in config.h
00 = number of interfaces
00 = alternate settings
01 = used endpoints used in this interface
00 = interface class
00 = interface sub class
HL CE M,
lehmann
usb_boothesc98.ppt
29 - 7/20/2015, 14:36
3rd In Request: Gives Feedback to
How does the device function?, details
USB
Sync
SOF
00000001 0xA5
Frame#
0x15B
Sync
00000001
IN
0x96
Sync
00000001
DATA0
0xC3
Sync
ACK
00000001 0x4B
CRC5
0x0D
ADDR ENDP
0x02
0x0
EOP
001
CRC5
0x15
DATA
00
EOP
001
EOP
001
CRC16
0x0000
Device
EOP
001
00 = polling interval
for interrupt
endpoints
Enumeration process on the C541U
HL CE M,
lehmann
usb_boothesc98.ppt
30 - 7/20/2015, 14:36
Command: OUT transfer
finishes the data stage
Data stage  Status stage
USB
Sync
SOF
00000001 0xA5
Frame#
0x15C
Sync
00000001
OUT
0x87
Sync
00000001
DATA1
0xD2
Sync
ACK
00000001 0x4B
CRC5
0x15
ADDR ENDP
0x02
0x0
EOP
001
CRC5
0x15
DATA
EOP
001
CRC16
0x0000
Device
EOP
001
EOP
001
Enumeration process on the C541U
HL CE M,
lehmann
usb_boothesc98.ppt
31 - 7/20/2015, 14:36
USB Application Support
Starterkit
HL CE M,
lehmann
usb_boothesc98.ppt
32 - 7/20/2015, 14:36
USB Application Support
Phytec KitCON-541 / Starterkit
Evaluation Board - Starter Kit
Starterkit
HL CE M,
lehmann
usb_boothesc98.ppt
33 - 7/20/2015, 14:36
C541-Evaluation Board
Phytec KitCON-541 / Starterkit
1 2 3 4
1,5k 
3,0-3,6V
D+
D-
4,0-4,75V
DADD
GND
n-channel
FET
SAB-C541
on PGA 44
socket
rev. USB
Spec. 1.0
100k
47nF
0,0 V
USB Vcc
DD+
USB GND
Common Vcc plane
Common GND plane
FULL speed
USB driver
LOW speed
USB driver
96-pol connector female
detached/attached
circuit
5k
USB powered /
self powered
selector
USB
connector
Starterkit
HL CE M,
lehmann
usb_boothesc98.ppt
34 - 7/20/2015, 14:36
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
HL CE M,
lehmann
usb_boothesc98.ppt
35 - 7/20/2015, 14:36