TWR-MCF52259-Ethenet
Hareesh S
Sr.FAE
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
TM
Ethernet Router
Ethernet Overview Session
Ethernet NIC
Ethernet Switch
Ethernet Cables
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
Ethernet Connector
TM
1
What is Ethernet?
•
It’s a cable I connect to my computer to surf the net
•
It’s how I do emails
•
My home router uses it to let all my computers talk
Why do we care about Ethernet?
•
Work is telling me I need it for my embedded product
•
It will let me remotely access my embedded product
•
Seems to be a cool way to have fast downloads
How will I use Ethernet?
Ethernet Overview Session
•
Just in factory application (i.e. local only)
•
Connected to WLAN (i.e. publicly accessible)
•
Through VPN only (i.e. secure tunnel)
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
TM
2
Ethernet
Ethernet defines the mechanical/electrical connection between
devices (the physical layer).
Ethernet also defines a protocol used to communicate between
multiple devices (the MAC layer).
Ethernet is defined by the IEEE 802.3 standard
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
TM
3
ColdFire
ColdFire
On-Chip
®
®
Generic ColdFire ®Board Layout of Ethernet
MII – Media Independent Interface
Network
Network
Cable
Ethernet
PHY
PHY
MAC-Media Access Controller
PHY-Physical Layer
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
Magnetics
Magnetics
Isolation
And
optional PoE
RJ45
RJ45
Jack
Line Voltage Levels
+2.8V or -2.8VDC
4
RJ45
RJ45
TM
MCF5223x
MCF5223x
M52233DEMO Board Layout of Ethernet
Network
Network
On-Chip
Ethernet
PHY
w/ PHY
MAC-Media Access Controller
PHY-Physical Layer
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
PHY
Magnetics
Magnetics
Isolation
And
optional PoE
Cable
RJ45
RJ45
Jack
Line Voltage Levels
+2.8V or -2.8VDC
5
RJ45
RJ45
TM
Connectors
• RJ-45
Cables
• CAT-5
Ethernet Overview Physical Session
24 AWG solid
bare copper
Four unbounded
twisted pairs
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
TM
6
Ethernet Cable: Straight Through Pinout
The following table demonstrates the proper color scheme.
Wire pair #1:
Wire pair #2:
Wire pair #3:
Wire pair #4:
White/Blue
Blue
White/Orange
Orange
White/Green
Green
White/Brown
Brown
RJ-45
Pin
Sign
al
Directi
on
RJ-45
Pin
1 ---> TX+ 1
2 ---> TX- 2
3 <--- RX+ 3
4 - - 4
5 - - 5
6 <--- RX- 6
7 - - 7
Source: http://www.netspec.com/helpdesk/wiredoc.html
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
8 - - 8
TM
7
Ethernet Cable: Crossover Pinout
The following is the proper pin out and cable pair/color order for the "crossover" end.
Pair#2 is connected to pins 1 and 2 like this:
white/green Pin 1 wire color:
green Pin 2 wire color:
Pair#3 is connected to pins 3 and 6 like this:
white/orange Pin 3 wire color:
orange Pin 6 wire color:
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
TM
8
* Distance Signal Travels at 100 Mbits?
Name Transmission Medium Data Rate
(Mb/s)
100BASE-TX 2 pairs of Category UTP-5,
alternative 2 pairs of STP, 150 Ω
Impedance, Cable Code MLT-3,
Full Duplex
100BASE-FX 2 Multimode Optical Fiber (62.5/125
µ m), Cable Code 4B5B, NRZI, Full
Duplex
1 0 0 B A S E - T 4 4 p a i r s o f C a t e g o r y 3 U T P - ( 3 / 4 / 5 ) o r
b e t t e r , 1 0 0 Ω I m p e d a n c e , C a b l e
C o d e 8 B 6 T , N o F u l l D u p l e x
1 0 0 B A S E - T 2 2 p a i r s o f C a t e g o r y 3 U T P - ( 3 / 4 / 5 ) o r
b e t t e r , C a b l e C o d e P A M 5 , F u l l
D u p l e x
x
3
2
2
S
u
p
p
o
t
r
e
d
b
y
CF
M
5
100 100
100 2,000
1 0 0 1 0 0
1 0 0 1 0 0
Requires using external PHY
Distance
(m)
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
9
TM
Full Duplex Ethernet Links
Full duplex operation means that devices at each end of a full duplex
link can send and receive data simultaneously.
This means, theoretically, that Full Duplex has twice the bandwidth of
normal (half duplex) Ethernet.
Since there are only two devices on a full duplex link, there is no shared
channel and no collisions.
CSMA/CD protocol
prevents this
Full Duplex Half Duplex
DTE
DTE
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
R
DTE
DTE
DTE
10
S
DTE
TM
Hub
= Multiport
repeater
Basic Ethernet Network
Ethernet
Switch
Router/Gateway
= Switching
physically
star
topology
(common
transport
medium
CSMA/CD!)
Logically
bus
topology
Outputs all
incoming
signals on
Hub, LAN
Switch
Real star
topology
Physical
connection
only for the
duration of the
communication
all outputs
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
TM
11
Basic Ethernet Bus
Co-axial based Ethernet connection daisy chain connection
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
TM
12
Collisions
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
TM
13
HUB
Centralized connection
Can bypass not connected
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
TM
14
Switch
The switch reads the destination addresses and 'switches' the signals
directly to the recipients without broadcasting to all of the machines on
the network.
This 'point to point' switching alleviates the problems associated with
collisions and considerably improves network speed.
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
TM
15
Ethernet Router/Gateway
A Router or Gateway is used to translate one protocol to
another.
It is also used when the physical layer changes mediums.
Ethernet to fiber
At one time there was a difference between a router and a
gateway.
The gateway was strictly used as a medium translator (
electrical ) and the router was strictly used as protocol
translator ( software ).
Now routers and gateways are normally combined and
called a routers.
Note: Ethernet to WiFi is a router functionality.
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
TM
16
*Media Independent Interface (MII)
• The MII links the Ethernet MAC with
the PHY.
• An MII may support both 10-Mb/s and
100-Mb/s operation, allowing network
devices to connect to both 10BASE-T
and 100BASE-T media segments.
• The MII electronics may be linked to
an outboard transceiver through a
40-pin MII connector and a short
(0.5m) MII cable.
• The MII is internally connected to the
EPHY on the MCF5223x
4-bit wide Tx and Rx data @2.5MHz or 25MHz
TTL signal levels
Typical MII Interface
TXDn_<3:0>
TX_ERn
TX_ENn
TX_CLKn
RXDn_<3:0>
RXDVn
(MAC)
Controller
Media Access
RX_ERn
RX_CLKn
CRSn
COLn
Magnetics/Fiber Transceiver
PHY
with
MII
Full duplex
Media status signals:
Carrier Presence & Collision
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
TM
17
*Autonegotiation
Auto-Negotiation is the exchange of information about each stations
abilities over a link segment allows the stations to achieve the best
possible mode of operation.
The highest performance mode of operation that Auto-Negotiation can
achieve is based on a priority table.
The Auto-Negotiation protocol contains a set of priorities which result
in the devices selecting their highest common set of abilities.
If the devices at both ends of the link can support full duplex
operation, and if they also both support Auto-Negotiation of this
capability, then they will automatically configure for full duplex.
The priorities are listed in the table below...
Auto-Negotiation priority Resolution Table
A 100 Base-TX Full Duplex
B 100 Base-T4
C 100 Base-TX
D 10 Base-T Full Duplex
E 10 Base-T Half Duplex
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
Full duplex is given a
higher priority than
half duplex, since it
can send more data.
TM
18
The Ethernet Data Packet Format
Ethernet Data Frame – old/original format used
Preamble
Destination
Address
Source
Address
Frame
Type
Frame
User Data
FCS
Checksum
8 Byte 6 Byte 6 Byte 2 Byte 46 – 1500 Byte 4 Byte 64-1518
IEEE 802.3 Data Frame
SOF
Destination
Preamble
Address
7 Byte 1 Byte 2/6 Byte 2/6 Byte 2 Byte 46 – 1500 Byte 4 Byte
Source
Address
Length
Type
Frame
User Data
DSAP SSAP Control Data
FCS
Checksum
1 Byte 1 Byte ½ Byte
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
TM
19
Terminology
CSMA - Carrier Sense Multiple
Access
CD - Collision Detection
OSI - Open Systems
Interconnection
ISO - International Organization
for Standardization
LAN - Local Area Network
WAN- Wide Area Network
MAC - Medium Access Control
BD - Buffer Descriptor
PHY - Physical Layer Device
MDI - Medium Dependent
Interface
CRC - Cyclic Redundancy Checking
FCS - Frame Checksum
IP - Internet Protocol
TCP - Transmission Control
Protocol
UDP - User Datagram Protocol
ICMP - Internet Control Message
Protocol
FEC - Fast Ethernet Controller
MII - Media Independent Interface
AUI - Attachment Unit Interface
DTE - Data Terminal Equipment
MAU - Medium Attachment Unit
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
TM
20
Ethernet Definition…
Ethernet - http://dictionary.reference.com/search?q=Ethernet
<networking> A local area network first described by
Metcalfe & Boggs of Xerox PARC in 1976. Specified by DEC ,
Intel and XEROX (DIX) as IEEE 802.3 and now recognised
as the industry standard.
Data is broken into packets and each one is transmitted
using the CSMA/CD algorithm until it arrives at the
destination without colliding with any other packet. The
first contention slot after a transmission is reserved for
an acknowledge packet. A node is either transmitting or
receiving at any instant. The bandwidth is about 10 Mbit/s.
Disk-Ethernet-Disk transfer rate with TCP/IP is typically 30
kilobyte per second.
Version 2 specifies that collision detect of the transceiver
must be activated during the inter-packet gap and that when
transmission finishes, the differential transmit lines are
driven to 0V (half step). It also specifies some network
management functions such as reporting collisions, retries
and deferrals .
Ethernet cables are classified as "XbaseY", e.g. 10base5,
where X is the data rate in Mbps , "base" means "baseband "
(as opposed to radio frequency ) and Y is the category of
cabling. The original cable was 10base5 ("full spec"),
others are 10base2 ("thinnet") and 10baseT ("twisted
pair") which is now (1998) very common. 100baseT ("Fast
Ethernet") is also increasingly common
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
TM
21
More Ethernet References
Web sites:
•
http://www.tcpipguide.com/
• http://www.uni-trier.de/infos/ether/ethernet-guide/ethernet-
guide.html#HDR%202.0%20%20%202%2062
• http://www.lauraknapp.com/presentation.htm
• http://www.ethermanage.com/ethernet/ethernet.html
• http://osiris.sunderland.ac.uk/online/ethernet/ethernet.html
• http://computer.howstuffworks.com/ethernet.htm
References:
Ethernet, The Definitive Guide
Charles E. Spurgeon
O'Reilly
2000
ISBN 1-56592-660-9
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
TM
22
IP - Internet Protocol
The IP defines how a network of more then 2 devices is formed. IP
is the network Layer.
IPv4 uses 32 bit addressing
IPv6 uses 128 bit addressing
A IPv4 node is defined by its IP address , and subnet mask.
•
IPv4 sample address 192.168.1.0 subnet 255.255.255.0
A IPv6 node is defined by its IP address
IP
•
2001:0DB8:0000:0000:0000:0000:1428:57ab
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
TM
23
IP Classes
With IP V4 , there are not enough IP addresses for everbody.
To solve this problem , subnetting is used.
IP addresses consists of 2 parts, a node address and a network
address.
The class of the address and the subnet mask determine which part
belongs to the network address and which part belongs to the node
address.
Each class is defined by the first 4 bits of the IP address.
•
Class A = 0xxx, or 1 to 126
•
Class B = 10xx, or 128 to 191
•
Class C = 110x, or 192 to 223
•
Class D = 1110, or 224 to 239
•
Class E = 1111, or 240 to 254
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
TM
24
IP Subnetting
Each IP address contains a node address and a network address.
The subnet mask determines which bits identify a node address, and
which bits identify a network address.
The network bits are the 1’s, the node bits are the 0’s.
Default subnet masks
•
Class A – 255.0.0.0 255 networks, > 16million nodes
•
Class B – 255.255.0.0 64K networks, 64K nodes
•
Class C – 255.255.255.0 >16 million networks, 255 nodes
CIDR = Classless Inter Domain Routing
Eliminates class restrictions giving finer control to netmask.
Uses 192.168.1.99/24 nomenclature ( 24 = # of ones from left )
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
TM
25
IPv4 network classes
Your IP address identifies the “neighborhood” your node is in.
“Private IP addresses” are not assigned by the IANA (Internet Assigned
Numbers Authority)
Total # of addresses Class RFC Purpose CIDR Equivalent Addresses
0.0.0.0 - 0.255.255.255
10.0.0.0 - 10.255.255.255
127.0.0.0 -
127.255.255.255
169.254.0.0 -
169.254.255.255
172.16.0.0 - 172.31.255.255
192.0.2.0 - 192.0.2.255
192.88.99.0 - 192.88.99.255
192.168.0.0 -
192.168.255.255
198.18.0.0 - 198.19.255.255
224.0.0.0 -
239.255.255.255
240.0.0.0 -
255.255.255.255
16,777,216 ARFC 1700Zero Addresses 0.0.0.0/8
16,777,216 ARFC 1918 Private IP addresses10.0.0.0/8
16,777,216 ARFC 1700Localhost Loopback Address 127.0.0.0/8
65,536 BRFC 3330 Zeroconf169.254.0.0/16
1,048,576 BRFC 1918 Private IP addresses172.16.0.0/12
256 CRFC 3330Documentation and Examples 192.0.2.0/24
256 CRFC 3068 IPv6 to IPv4 relay Anycast 192.88.99.0/24
65,536 CRFC 1918 Private IP addresses192.168.0.0/16
131,072 CRFC 2544Network Device Benchmark198.18.0.0/15
268,435,456 DRFC 3171 Multicast224.0.0.0/4
268,435,456 ERFC 1700Reserved 240.0.0.0/4
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
TM
26
NAT
Network Address Translation (NAT, also known as network masquerading or IP-masquerading )
involves re-writing the source and/or destination addresses of IP packets as they pass through a
router or firewall.
Most systems using NAT do so in order to enable multiple hosts on a private network to access the
Internet using a single public IP address.
NAT is a non-standard protocol
Local
192.168.1.1
192.168.1.2
192.168.1.3
192.168.1.4
192.168.1.5
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
Router/Gateway
running NAT
IP=10.1.2.3
Default Gateway is where packets
addressed outside the subnet are
sent to.
Global
10.1.2.3 192.168.1.0
internet
TM
27
Default Gateway
192.168.1.1
192.168.1.2
Router/Gateway
10.1.2.3 192.168.1.0
internet
running NAT
192.168.1.3
IP=10.1.2.3
192.168.1.4
Default Gateway is where packets
192.168.1.5
addressed outside the subnet are
sent to.
Local Global
Node 192.168.1.5 needs to send a packet to 207.68.172.246 (msn.com)
Node 192.168.1.5 identifies that 207.68.172.246 is outside the subnet
(255.255.255.0 )
The packet is sent to 192.168.1.0, the default gateway
NAT translates the source field to 10.1.2.3
The internet sees a packet from 10.1.2.3 to 207.68.172.246
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
TM
28
Getting packets into a NAT network
Default
node gets
all packets
from
internet
from
connection
s not
originated
from
subnet
Local
192.168.1.1
192.168.1.2
Router/Gateway
Global
10.1.2.3 192.168.1.0
internet
running NAT
192.168.1.3
IP=10.1.2.3
192.168.1.4
Default node is where all packets
192.168.1.5
from internet that are not responses
to packets from subnet are routed
to.
If the connection originates from the internet ( like connecting to a web
server on an embedded device ) NAT has a default node.
The default node is defined in the router/gateway.
Some routers/gateways always default to x.x.x.1
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
TM
29
TCP is One of the Protocols in the Internet Protocol Suite
TCP - Transport Control Protocol
TCP provides a “virtual” connection from one point to another.
The protocol guarantees reliable and in-order delivery of sender to
receiver data. TCP also distinguishes data for multiple, concurrent
applications (e.g. web server and email server) running on the same
host.
TCP supports many of the Internet's most popular application
protocols and resulting applications, including the world wide web, and
email.
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
30
TM
Other Protocols in the Internet Protocol Suite
HTTP - HyperText Transport Protocol - Supported by Freescale Web Server
•
Used to transport HTML (web pages)
POP3 - Post Office Protocol
•
Used to “pull” email from a server
TFTP - Trivial File Transfer protocol - Supported by ColdFire Lite stack
•
Used to transfer blocks of data
UDP - User Datagram Protocol - Supported via Interniche
•
Used to transfer data without a connection
•
Provides 65535 multiplexed ports per IP address
PPP - Point to Point Protocol - Supported via Interniche
•
used to establish a direct connection between two nodes
DHCP - Dynamic Host Configuration Protocol - Supported by ColdFire Lite stack
•
Used to dynamically configure a device on a network
BOOTP – Bootstrap Protocol - Supported by ColdFire Lite stack
•
Another much simpler method of dynamically configuring a device on a network
DNS – Dynamic Name System - Supported via Interniche
•
A client/server based system to translate host/domain names or URL’s to IP addresses.
ARP – Address Resolution Protocol - Supported by ColdFire Lite stack
•
A lower level protocol required to match IP addresses and Ethernet MAC addresses
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
31
TM
The OSI 7 Layer Model
The Open Systems Interconnection Reference Model (OSI Model or OSI Reference Model for short) is a
layered abstract description for communications and computer network protocol design, developed as part of
the Open Systems Interconnect initiative.
TCP/IP Four
Layer 7 – Application
HTTP, SMTP, POP3, TFTP
Layer 6 – Presentation
Berkeley Socket Interface, XTI, Custom
Layer 5 – Session
Berkeley Socket Interface, XTI, Custom
Layer 4 – Transport
TCP, UDP
Layer 3 – Network
IP, ARP, ICMP (Internet Control Message Protocol)
Layer 2 – Data Link (MAC)
Ethernet, PPP
Layer 1 – Physical (PHY)
Layers
Equivalent:
Application
Transport
Network
Link
RS232, 10BASE-T, DSL, T1
All People Seems To Need Data Processing”.
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
TM
32
Some Interesting RFC’s
0008 Functional specifications for the ARPA Network. G. Deloche. May-05-1969. (Not online) (Status: UNKNOWN)
0009 Host software. G. Deloche. May-01-1969. (Not online) (Status: UNKNOWN)
0011 Implementation of the Host-Host software procedures in GORDO. G. Deloche. Aug-01-1969. (Not online) (Obsoleted by
RFC0033) (Status: UNKNOWN)
0015 Network subsystem for time sharing hosts. C.S. Carr. Sep-25-1969. (Format: TXT=10695 bytes) (Status: UNKNOWN)
0016 M.I.T. S. Crocker. Aug-27-1969. (Format: TXT=682 bytes) (Obsoletes RFC0010 ) (Obsoleted by RFC0024 ) (Updated by RFC0024 ,
RFC0027, RFC0030) (Status: UNKNOWN)
0017 Some questions re: Host-IMP Protocol. J.E. Kreznar. Aug-27-1969. (Format: TXT=6065 bytes) (Status: UNKNOWN)
0018 IMP-IMP and HOST-HOST Control Links. V. Cerf. Sep-01-1969. (Format: TXT=634 bytes) (Status: UNKNOWN)
0019 Two protocol suggestions to reduce congestion at swap bound nodes. J.E. Kreznar. Oct-07-1969. (Format: TXT=3392 bytes)
(Status: UNKNOWN)
0020 ASCII format for network interchange. V.G. Cerf. Oct-16-1969. (Format: TXT=18504 bytes) (Status: UNKNOWN)
0021 Network meeting. V.G. Cerf. Oct-17-1969. (Format: TXT=2143 bytes) (Status: UNKNOWN)
0022 Host-host control message formats. V.G. Cerf. Oct-17-1969. (Format: TXT=4606 bytes) (Status: UNKNOWN)
0023 Transmission of Multiple Control Messages. G. Gregg. Oct-16-1969. (Format: TXT=690 bytes) (Status: UNKNOWN)
0031 Binary Message Forms in Computer. D. Bobrow, W.R. Sutherland. Feb-01-1968. (Format: TXT=11191 bytes) (Status:
UNKNOWN)
0033 New Host-Host Protocol. S.D. Crocker. Feb-12-1970. (Format: TXT=44167 bytes) (Obsoletes RFC0011 ) (Updated by RFC0036,
RFC0047) (Status: UNKNOWN)
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
33
TM
Freescale solution for Ethernet
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
TM
Flash
Production - Available NOW
Execution - Specification frozen, in design
Planning - Specification subject to Change
Flexis 8-bit
Compatible
2009
ColdFire MCU Roadmap
1MB
MCF5216
512KB
MCF521/2/3/4
256KB
MCF52110
128KB
MCF52100
64KB
General Purpose /
Low Power
CAN
MCF51AC
CAN
RTC
RTC
MC51QE
Ultra Low
Power
MC51QE
Ultra Low
Power
5V Motor
Control
MCF51AC
5V Motor
Control
MCF5282
10/100 CAN
MCF5281
10/100 CAN
Ethernet
MCF52233/4/5
10/100 + PHY
CAN
Encryption
MCF52230/1
10/100 + PHY
CAN
MCF52236
10/100 +
PHY
MCF52232
10/100 +
PHY
Low cost
MCF5225x
10/100 USB
otg MQX
MCF5225x
10/100 USB
otg, MQX
MCF51CN128
Ethernet,
External Bus
RTOS
RTOS
MCF52223
USB otg (FS)
MCF52211
USB otg (FS)
MCF52210
USB otg (FS)
USB
MCF52213
USB otg (FS)
MCF52212
USB otg (FS)
MCF51JM
USB otg (FS)
CAN
Encryption
MCF51JM
USB otg (FS)
CAN
Encryption
MC51FQE
32KB
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
Ultra Low
Power
TM
35
Cold
Cold
Fire V2 Core
Fire
• Up to 76 Dhrystone 2.1 MIPS @ 80 MHz
• MAC Module and HW Divide
• Encryption – CAU
• External Bus
• Up to 64K bytes SRAM
• Up to 512K bytes Flash
• USB 2.0 full-speed Host/Device/On-the-go
Controller
• CAN – (FlexCAN)
• FEC (10/100 Ethernet)
• 3 UARTs
• Serial Peripheral Interface (Queued SPI)
• I2C bus interface modules
• 4 ch. 32-bit timers with DMA support
• 4 ch. 16-Bit Capture/Compare/PWM timers
• 2 ch. Periodic Interrupt Timer
• 8 ch. PWM timer with enhanced DAC capabilities
• 2ndWatchdog timer with independent clock
• Real Time Clock with 32kHz crystal oscillator
• 8 ch. 12-bit A-to-D converter with simultaneous
sampling
• Up to 56 5V Tolerant General-Purpose I/O
• System Integration (PLL, SW Watchdog)
512KBytes
Flash
64KBytes
SRAM
256KBytes
Flash
64KBytes
SRAM
256KBytes
Flash
32KBytes
SRAM
Memory Options
Crypto
(CAU)
RNGA
Optional
Cold
Cold
USB
otg
Flash
SRAM
10/100
FEC
CAN
EMAC
Fire: MCF5225x
Fire
DMA
Cold
Cold
Core
4ch 32-bit
Timer
4ch 16-bit
Timer
RTC
2ch PIT
V2
®
®
Fire
Fire
32kHz
Osc.
8-ch 12-bit
System
Integration
I2C
QSPI
ADC
8ch
PWM
GPI/O JTAG PLL BDM
UART
UART
UART
4ch DMA
Ext
Bus
EZPORT
•Single 3.3V supply
•Temperature Range: -40° C to +85° C
•Available Speeds: 66 and 80MHz
•Available packages: 100 LQFP, 144 LQFP, 144 BGA
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
TM
36
MCF52259 –FEC features
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
TM
37
MCF52259-FEC Fetures
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
TM
38
MCF522xx – Ethernet Media Access Controller (MAC)
• The Ethernet MAC supports
10/100 Mbps Ethernet/IEEE
802.3 networks
• IEEE 802.3 full duplex flow
control
• Support for full-duplex operation
(40Mbps throughput) with a
minimum system clock rate of
50MHz
• Support for half-duplex operation
(20Mbps throughput) with a
minimum system clock rate of
25MHz
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
TM
39
• The ePHY (embedded
PHYsical layer interface) is
IEEE 802.3 compliant
• Supports both the mediaindependent interface (MII)
and the MII management
interface
• Full-/half-duplex support in
all modes
MCF5223x - ePHY
• Requires a 25-MHz crystal
for its basic operation
• Supports Loopback modes
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
TM
40
MCF51CN
Up to 46 Dhrystone 2.1 MIPS
@ 50 MHz
Mini-FlexBus support up to
2MB external memory
Ethernet:
• 10/100 FEC – Fast
Ethernet Controller with
DMA
• MII Interface with Output
Clock for PHY
• Support Half/Full Duplex
MII
10/100
FEC
2x 3ch TPM
MCF51CN
PHY Clk
Out
12 Ch 12-Bit
DMA
GPI/O
ADC
RTC
Complete Ethernet Solution
Freescale MQX™
Rapid
GPI/O
2x I2C
2x SPI
2x MTIM8
MCG
3x UART
MQX Software
Reuse of software
Full production source code
16ch KBI
128K
Flash
Developers keep their source
modifications
Small, configurable footprint
Integrated communication
BDM
ColdFire
Core
V1
®
DBG
System
Integration
suite (RTCS)
Eliminates initial software
investment hurdle
$95K worth of software from
day one
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
24K
SRAM
Ext
Bus
www.freescale.com/mqx
41
41
TM
®
68K/
68K/
Cold
Cold
Fire
Fire
®
V1 Core
• Up to 46 Dhrystone 2.1 MIPS @ 50 MHz
•
Mini Flexbus support up to 1MB external memory (80LQFP) support 2
Devices
Memory
• 128K bytes flash
• 24K bytes SRAM
MII
10/100
FEC
MCF51CN128
PHY Clk
Out
12 Ch 12-Bit
DMA
GPI/O
ADC
Rapid
GPI/O
2x I2C
Features
• Ethernet:
• 10/100 FEC – Fast Ethernet Controller with DMA
• MII Interface with Output Clock for PHY
• Support Half/Full Duplex
• Low power mode – Ethernet operation supported at 3V and above
• Ultra-small (7x7mm) 48-pin package
• 12-Ch, 12-Bit ADC
• 3x UARTs (2 on 48 pin, 3 on 64/80 pin)
• 2x SPI
• 2x I 2C bus interface
• Real Time Counter
• Up to 70 General-Purpose I/O
• System Integration
(PLL, SW Watchdog)
• Single Voltage Supply 1.8-3.6V
Package Part #
ADC
Ch
KBI
Port
I/O
Rapid
GPIO
2x 3ch TPM
2x MTIM8
16ch KBI
BDM
Cold
Cold
SCI
(UART)
V1
Core
Fire
Fire
®
®
TPM
Ch
RTC
MCG
128K
Flash
DBG
Integration
Ext Bus lines
addr/data/chip
System
select
2x SPI
3x UART
24K
SRAM
Ext
Bus
10K# SRP
$3.31 20 / 8 / 2 6 3 16 70 16 12 80LQFP MCF51CN128CLK
$3.21 - 6 3 16 54 12 12 64LQFP MCF51CN128CGT
$2.99 - 6 3 8 38 6 12 48QFN MCF51CN128CLH
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
TM
42
Freescale Complimentary Software Solution
InterNiche and Freescale have collaborated to provide and OEM
version of InterNiche’s NicheLite optimized for the ColdFire
architecture.
Key Features:
Address Resolution Protocol (ARP)
Internet Protocol (IP)
Internet Control Messaging Protocol
(ICMP)
User Datagram Protocol (UDP)
Transmission Control Protocol (TCP)
Dynamic Host Configuration Protocol
(DHCP) Client
Bootstrap Protocol (BOOTP)
Trivial File Transfer Protocol (TFTP)
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
TM
43
CodeWarrior
development
environment
(MQX OS Aware)
CodeWarrior
Processor
Expert
MQX PC host
tools
3rdParty:
IAR
(MQX OS Aware)
Open Source BDM
3rdparty:
Emulator/Probe
Demo Code
Application tasks &
industry-specific libraries
MQX RTOS
Optional
Services
Core Services MQX RTOS
BDM/
JTAG
Freescale Complete Solution
Applications
Customized
Applications
File System
Ethernet
(RTCS)
BSP/PSP
MCF5225x Microcontroller
USB
CAN
3
Party & FSL
• MCF5225x is a
one-stop-shop
connectivity MCU
with on-chip USB,
Application
Discrete Driver
rd
Enablement
Layer
HAL
Hardware
Ethernet, CAN and
encryption.
• MQX offers RTOS,
USB Stack and
drivers, RTCS of
Ethernet stack, file
systems and more
functions
• A single
CodeWarrior
development studio
supports the entire
ColdFire Family.
• Processor Expert
allows GUI-enabled
interface.
• Cost effective and
full function
development tools
with built in BDM
module for in-circuit
debug
PC-Hosted On-Device
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
Freescale Enablement
(MQX)
TM
44
RTCS – Real-time TCP/IP Communications Suite
RPC
XDR
Telnet
SSH XML
Sockets
ICMP TCP
ICMP UDP
NAT CIDR
IP-E IPCP PAP CHAP CCP LCP
FTP
BootP
BootP
SSL
IP
IP
SMTP
TFTP
DHCP
DHCP
RIP
UDP IGMP
POP3
HTTP
DNS SNMP TFTP SNTP
Protocols
ARP
ARP
Ethernet
E t h e r n e t
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
PPP
S e r i a l
Serial
PPPoE
HDLC
TM
45
Freescale owns
• Source code, rights to distribute and modify
across the Freescale Portfolio
Freescale MQX Software Solutions
Full- Featured and Powerful
F u l l - F e a t u r e d a n d P o w e r f u l
.
Benefits
•Full production source code* with silicon
•Commercial-friendly licensing model that lets
developers keep their source modifications
•Small, configurable footprint
•Integrated stacks (TCP/IP, USB, etc.)
Value
•Eliminates initial software investment hurdle
•$95K worth of software from day one
Proven
• Market-proven on Freescale processors for over
15 years and used in millions end use products,
now a part of the offering.
One Collaborative Source
•Hardware: MCF5225x (ColdFire)
•Tool: CodeWarrior ™(CW7.1 plus v7.1.1) & IAR
System (RTOS Task aware debugging)
•Run-time software: Freescale MQX
•Strong Third Party Support Network
What is Freescale MQX?
► RTOS (Full priority-based, pre-emptive
scheduler)
► Real-time TCP/IP Communication Suite
(RTCS)
TCP/IP, FTP, Telnet, DHCP, SNMP etc..
► USB Host - HID, MASS, HUB
► USB Device - HID, MASS, CDC
► MS-DOS File System (MFS )
► BSP I/O Driver: CAN, UART etc…
► HTTP Web server
Past Customer Problem
The Solution
* Complimentary with MCF5225x. Subject to License Agreement
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
TM
46 46
HTTP server
Coldfire TCP/IP Stack Features
Transmission control protocol (TCP)
HTTP client
RSS/XML client
TCP/UDP client and server
Serial to Ethernet client and server
TFTP
DHCP or Manual IP configuration
Domain name server client (DNS)
User Datagram protocol (UDP)
Internet controlling message protocol (ICMP)
BOOT strap protocol
Address resolution protocol (ARP)
Internet protocol (IP)
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
TM
47
TCP/IP stack overview
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
TM
48
TCP/IP stack structure
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
TM
49
More details about the stack
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
TM
50
Coldfire TCP/IP flash and RAM requirement
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
TM
51
Ethernet LABs
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
TM
Install the Given exe file TCP_IPLite_MCF5225xI.exe
LAB1
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
TM
53
Directory Structure
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
TM
54
Directory Structure
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
TM
55
Open the codewarrior for coldfire
Open the Coldifre_Lite7x …*.mcp project file.
Project file
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
TM
56
Project file details
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
TM
57
Coldfire TCP/IP lite stack files
Main.C – setting IP and MAC address
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
TM
58
LAB1
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
TM
Connect the board via USB and
serial to the board
Select the Coldfire_Lite project in
code warrior.
Compile the code.
Flash the program into the
controller using codewarrior
Flashing and booting the board
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
TM
60
Compiler the code
Make button
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
TM
61
Flash progamming
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
TM
62
Flash file selection
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
TM
63
Erase and program the flash
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
TM
64
Baudrate – 115200
Stop bit – NO
Data bit – 8
Parity None
Hyper terminal setting
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
TM
65
Reset the board- Should receive the message
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
TM
66
Commands
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
TM
67
Setting IP address at PC side
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
TM
68
Comunicating between the board and PC – PING COMM
Connect the Ethernet cable between the
MCF52259 board to PC
Type the command ping “192.168.0.98”
from PC side.
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
TM
69
IP Address changing
Open the Main.c file
Change the IP address.
Check with the ping command as well as in boot mointor about the
changes you have done for IP address is working or not.
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
TM
70
LAB2 – Serial to Ethernet and Visa versa
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
TM
TM
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
Freescale Semiconductor Confidential Proprietary. Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc.
All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2004
TM
72
LAB3 – Web server
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
TM
Webserver project
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
TM
74
Webserver demo
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
TM
75
TM
April 7, 2010
TWR-MCF52259-USB
TM
Hareesh S
Sr.FAE
a
K2u/USB Workshops-on-Demand Series
d
n
e
g
A
e
l
u
d
o
M
This module contains
• Introduction to USB
• Basic Operation of USB hardware
and software
• USB Data Structures for K2/3u
• USB API Calls for K2/3u
:
TM
Introduction To USB
TM
In This Section:
Introduction to USB
Motivation for the USB Standard
TM
History and Evolution of USB
USB Topology
USB Connectors
U
S
M
USB - U niversal S erial B us was born out of the
need to provide designers and end-users with:
• an alternative to Apple’s 1394 digital link
otiva
tio
n
fo
r
B
Introduction to USB
standard (FireWire )
®
• a fast, bi-directional, low-cost,
dynamically attachable serial interface
• that removes the port availability
constraints for the PC and other devices
TM
M
Introduction to USB
otiva
tio
n
fo
r
U
S
TM
B
n
o
i
t
a
v
i
t
o
Introduction to USB
M
• and adds true plug-and-play attributes for a
wide range of devices simultaneously
• with minimal or no user intervention
required for configuration
• and is very end-user friendly
H
sto
i
y a
r
d E
n
olu
v
tio
n
Introduction to USB
U
5
9
9
1
S
B
g
r
o
u
p
n
c
o
i
t
a
c
i
f
i
B
S
U
8
9
9
1
1
.
1
c
e
p
S
d
e
m
r
o
f
B
S
U
1996
1
.
0
S
e
p
n
o
i
t
a
c
i
f
i
c
e
p
S
TM
0
.
2
B
S
U
2000
n
o
i
t
a
c
i
f
i
O
B
S
U
1
0
0
2
n
o
G
-
e
h
t
-
Introduction to USB
o
t
d
n
r
t
s
o
H
i
Current USB Speeds and Limitations
y
a
E
v
olu
i
n
Introduction to USB
Spec
USB 1.1 Lowspeed
USB 2.0 Lowspeed
USB 1.1 Fullspeed
USB 2.0 Fullspeed
USB 2.0 Highspeed
Performance
1.5 Mbps / 10100 Kbps
12 Mbps / 5-10
Mbps
480 Mbps / 25400 Mbps
Keyboard,
mouse, joystick
Printers, audio
devices, floppy
drives
Video, storage,
imaging
Notes Applications Data Rate and
Low cost but limited
TM
performance; type
and number of
endpoints are limited
Moderate
performance;
guaranteed latency;
guaranteed
bandwidth
Vast bandwidth
improvements
Introduction to USB
l
p
o
o
T
USB Spec Provides for a Flexible Tiered Star Topology
o
g
y
y
g
o
l
o
p
o
T
B
S
U
Introduction to USB
• Single Host – The host controls communication with each device
• Up to 127 devices can be attached
• Devices are one of the following:
TM
– Hubs (provide additional attachment points)
– Functions (devices) which provide capabilities to the system (e.g.,
printer, thumb drive, I-pod)
• Up to 7 tiers
– Can have up to 5 hubs deep with a max of 5 meters between each
hub
y
g
o
l
o
p
o
T
o
p
log
o
y
Host
Root Hub
Hub
- Tiered Star
TM
Hub
Hub
T
B
S
U
Introduction To USB
Hub
U
S
B
Introduction to USB
S
t
a
n
d
a
d C
r
o
n
n
e
c
t
o
r
s
Introduction To USB
A-connector (upstream)
B-connector (downstream)
A
Connector types
B
Root Hub
A
A
B
A
B
Hub
A
A
B
B
A
B
Hub
TM
B
A
B
B
Hub
A
A
B
y
g
o
l
Introduction to USB
o
p
o
T
B
S
U
Software
General Concepts
TM
In This Section:
How Data is Transferred in USB
TM
How Does the Host Know the Device’s Requirements?
The Enumeration Process: What happens when a device is connected?
A More Detailed Look at What Comprises a Frame
API Calls: What happens after enumeration?
Software – General Concepts
s
c
r
B
e
r
n
e
G
h
T
USB is a token-based (packet) standard. Data is transferred
between the host and the device in a series of frames, transfers,
transactions, and packets within1 Ms/1500 byte frames.
e
How Data is Transferred in USB
l U
a
S
P
o
e
s
Software – General ConceptsTMSoftware – General Concepts
Transfer 1
Transaction
Start of Frame
Transaction 1
Packet 1
Packet 2
Frame
Transfer 2
Transaction 2
Packet 3
Packet 1
1500 bytes / 1 Ms
Packet 2
Packet 3
Transaction 3
Packet 1
Packet 2
TM
Transfer 3
Transaction 1
Packet 3
Packet 1
Packet 2
Packet 3
s
T
h
e
G
e
n
e
r
l U
a
S
B
P
r
o
c
e
s
How Data is Transferred in USB
Frames are made up of transfers, which are made up of
transactions, which are made up of packets. The USB
host schedules these 1mS frames when communicating
with the low and full speed devices.
Frame
Transfer Transfer
Transaction
1
t
e
k
c
a
P
2
t
e
k
c
a
P
3
t
e
k
c
a
P
Transaction Transaction Transaction
1
t
e
k
c
a
P
2
t
e
k
c
a
P
3
t
e
k
c
a
P
e
k
c
a
P
1
t
2
t
e
k
c
a
P
3
t
e
k
c
a
P
1
t
e
k
c
a
P
2
t
e
k
c
a
P
3
t
e
k
c
a
P
T
h
r
B
e
r
n
G
e
Transfer Transfer
e
How Data is Transferred in USB
There are 4 types of data transfer:
1. Interrupt
2. Bulk
3. Isochronous
l U
a
Frame
S
P
o
TM
c
e
s
s
Software – General Concepts
4. Control
The type of transfer depends upon the type of device and its
data requirements (this is discussed in more detail later).
T
h
B
e
r
n
e
G
e
How Data is Transferred in USB
l U
a
Transfer
S
P
r
o
c
e
s
s
Software – General Concepts
Transaction
Each transfer can contain multiple transactions and a
transaction can span multiple frames
The host schedules transactions within the 1mS frame.
Transaction
TM
T
h
B
e
r
n
e
G
e
How Data is Transferred in USB
l U
a
S
P
r
o
c
e
s
s
Transaction
1
t
e
k
c
a
P
For each transaction there are three types of packets that
communicate the data between host and device:
1. Token Packet – the header that defines what follows
2. Optional Data Packet – contains the data being transmitted
3. Status/Handshake Packet – used to acknowledge transactions
2
t
e
k
c
a
P
e
k
c
a
P
3
t
Transaction
1
t
e
k
c
a
P
2
t
e
k
c
a
P
3
t
e
k
c
a
P
TM
Software – General Concepts
and provide a means of error correction
s
c
r
B
e
r
n
e
G
h
T
How Does the Host Know a Device’s Requirements?
When a USB device is plugged into a USB port the host communicates
with the device and configures each device according its unique
e
l U
a
S
P
o
e
s
Software – General Concepts
requirements such
1. Type of transfer required (interrupt, bulk, isochronous, or control
2. Who supplies the power (host or device)
3. Maximum packet size
4. The number of configurations (e.g., a single device can be
configured to use its own power or power from the host)
5. Manufacturer’s product ID and registration information
6. Etc.
This configuration process is called enumeration. Enumeration
is be covered in greater detail later in this presentation
as:
TM
s
c
r
B
e
r
n
e
G
h
T
How Does the Host Know a Device’s Requirements?
These requirements are communicated to the host
through a hierarchy of C program descriptors. The types
of descriptors include:
1. Device Descriptors
2. Configuration Descriptors
3. Interface Descriptors
4. Endpoint Descriptors
e
l U
a
S
P
o
e
TM
s
Software – General Concepts
5. String Descriptors
s
c
r
B
e
r
n
e
G
h
T
How Does the Host Know a Device’s Requirements?
This hierarchy of the most commonly used descriptors
looks like this:
e
l U
a
Device Descriptor
S
P
o
e
TM
s
Endpoint
Descriptor
Software – General Concepts
Interface
Descriptor
Endpoint
Descriptor
Configuration
Descriptor
Endpoint
Descriptor
Interface
Descriptor
Endpoint
Descriptor
Interface
Descriptor
Endpoint
Descriptor
Configuration
Descriptor
Endpoint
Descriptor
Interface
Descriptor
Endpoint
Descriptor
Endpoint
Descriptor
e
r
n
e
G
h
T
How Does the Host Know a Device’s Requirements?
Device Descriptor
Since the device descriptor
represents the entire device,
there can be only one per
device. This descriptor specifies
basic information such as: USB
version supported, maximum
packet size, the number of
configurations, and vendor and
product ID info.
e
l U
a
s
c
r
B
S
//-----------------------------------------------------------// Sample Standard Device Descriptor Type
// Definition Fields
//------------------------------------------------------------
Length (18 bytes)
Descriptor Type (DEVICE)
USB Spec Release Number (0200h)
Device class (hub type…Human Interface defined in
Device Sub-class (00h)
Device protocol (00h)
Maximum Packet size (64 bytes – max for the
Vendor ID (ID assigned by USB IF)
Product ID (ID assigned by product manufacturer)
Device release number (revision code of device)
Manufacturer (ABC Corp)
Product (string identifier)
Serial Number (1234)
Number of configurations (1 or more configurations
P
o
other descriptor, CDC described here)
e
T M
can follow)
s
endpoint)
Software – General Concepts
e
r
n
e
G
h
T
How Does the Host Know a Device’s Requirements?
Configuration
Descriptor
The configuration descriptor is a
header to the interface descriptors. It
specifies how this configuration of the
device is powered, what the
maximum power consumption is, and
how many interfaces there are. There
can be more than one configuration
descriptor (for example: if the device
can switch between self-power and
e
l U
a
s
c
r
B
S
//-----------------------------------------------------------// Sample Standard Configuration Descriptor Type
// Definition Fields
//------------------------------------------------------------
Length (9 bytes)
Descriptor Type (CONFIGURATION)
Total Length (total length in bytes of data returned)
Number of Interfaces (number of interfaces present
for this configuration)
Configuration Value (value used by the
SetConfiguration request to select this configuration)
Configuration (Index of String Descriptor describing
this configuration)
Attributes (bus powered, self powered, remote
wakeup)
Max Power (Maximum Power Consumption in 2mA
units)
P
o
e
T M
s
host-power).
Software – General Concepts