Freescale Semiconductor MCF51CN128 Reference guide

Type
Reference guide
TCP/IP Applications Using the
MCF51CN FamilyDesigner Reference
Manual
Device Supported: MCF51CN Microcontrollers
Document Number: DRM114
Rev. 0, 12/2009
TCP/IP Applications Using the MCF51CN FamilyDesigner Reference Manual, Rev. 0, 12/2009
Freescale Semiconductor2
Contents
PageTitleSection Number
Chapter 1
Introduction
Overview...........................................................................................................................................................................51.1
Key Features.....................................................................................................................................................................51.2
Advantages........................................................................................................................................................................81.3
Development Tools...........................................................................................................................................................81.4
Top and Bottom View of the MCF51CN128 Reference Design Hardware......................................................................81.5
How the MCF51CN128 Reference Design Fits Your System..........................................................................................91.6
Chapter 2
Hardware Description
Hardware.........................................................................................................................................................................132.1
Minimal System Features...............................................................................................................................................132.2
Demo System Features...................................................................................................................................................142.3
Connection Between Minimal System and Demo System Features...............................................................................152.4
Hardware Block Diagram...............................................................................................................................................162.5
Pinout Description..........................................................................................................................................................182.6
MCF51CN128 Reference Design Board Power Options...............................................................................................192.7
Hardware Considerations................................................................................................................................................202.8
Chapter 3
Firmware Description
Firmware.........................................................................................................................................................................213.1
Firmware Organization...................................................................................................................................................213.2
Block Diagram................................................................................................................................................................223.3
System Startup................................................................................................................................................................233.4
Internal Functionality of Socket Layer...........................................................................................................................243.5
Chapter 4
System Setup
Getting Started................................................................................................................................................................274.1
TCP/IP Applications Using the MCF51CN FamilyDesigner Reference Manual, Rev. 0, 12/2009
3Freescale Semiconductor
PageTitleSection Number
Install Software...............................................................................................................................................................274.2
Hardware Setup...............................................................................................................................................................274.3
HTTP Server Functionality.........................................................................................................................284.3.1
Email Client Functionality..........................................................................................................................314.3.2
FTP Server Functionality.............................................................................................................................324.3.3
Serial Bridge Functionality..........................................................................................................................344.3.4
Principle of Operation.....................................................................................................................................................354.4
Serial Conguration Commands....................................................................................................................................364.5
Support............................................................................................................................................................................394.6
Appendix A
Additional Files...............................................................................................................................................................41A.1
Appendix B
Bill of Materials (BOM).................................................................................................................................................43B.1
Appendix C
Schematics......................................................................................................................................................................47C.1
TCP/IP Applications Using the MCF51CN FamilyDesigner Reference Manual, Rev. 0, 12/2009
Freescale Semiconductor4
Chapter 1
Introduction
1.1 Overview
This reference manual describes using the MCF51CN128 reference design hardware
to run the following TCP/IP applications:
SCI/SPI to Ethernet
Web Server
Email Client
FTP Server
All hardware schematics diagram, gerber les, Allegro hardware source les, board pictures,
and rmware source codes are available in reference materials. All hardware les and
software can be reused to enable directly TCP/IP connectivity in customized applications.
For details about the technical implementation of the reference design main features, refer
to the following documents:
Application note titled Serial-to-Ethernet Bridge Using MCF51CN Family and
FreeRTOS (document AN3906)
Application note titled Web Server Using MCF51CN Family and FreeRTOS (document
AN3928)
Application note titled Email Client Using MCF51CN Family and FreeRTOS (document
AN3930)
Application note titled FTP Server Using MCF51CN Family and FreeRTOS (document
AN3931)
1.2 Key Features
Uses Freescale ColdFire V1 Core MCF51CN128 48-pin QFN package running up
to 50.33 MHz
TCP/IP Applications Using the MCF51CN FamilyDesigner Reference Manual, Rev. 0, 12/2009
5Freescale Semiconductor
Low cost board in a minimal size of 2.89 × 1.55. Ethernet Minimal System is 1.15
× 1.55.
For the MCF51CN128 reference design hardware, power can be applied to both unused
pairs from the RJ45 cable. Therefore, power through the jack is not required. For more
details go to Section 2.7.
The following TCP/IP services are implemented.
DHCP Client Service:
IP dynamic address (DHCP) or static support at runtime
Serial Bridge
A UART or SPI to Ethernet bridge is implemented using the socket approach.
Supports client or server implementation that allows connecting two serial
bridges using the Internet.
An always enabled web page can congure all interfaces and bridge settings.
A reset command can be sent through the web page to make settings take effect.
The following settings can be changed or shown at runtime through the
conguration web page or at compile time:
MAC address
IP address
IP mask address
IP gateway address
Server address to connect as a client
Static or dynamic IP address
TCP port to connect or bind to
TCP client or server implementation
Conguration or bridge implementation
UART port
UART baudrate
UART parity
UART number of bits
UART number of stop bits
TCP/IP Applications Using the MCF51CN FamilyDesigner Reference Manual, Rev. 0, 12/2009
Freescale Semiconductor6
Key Features
UART ow control
SPI port
SPI baudrate
SPI polarity
SPI phase
SPI master or slave
SPI polling or interrupt handling
Using hardware and software ow control for the RS232 interface
Presence of RS485 transceiver and connector
The bridge can be congured through the UART interface using a set of
commands explained in Section 4.5
For the MCF51CN128 reference design hardware, power can be applied to pin
6 of the UART connector. Therefore, the power jack is not required. Refer to
Figure 2-5 for more details.
An accelerometer by SPI is on-board to test SPI bridge.
HTTP Server Service
Supports HTTP with the following services:
HTTP 2.0Persistent connections or keep-alive sessions
SSIServer side include (SSI) directives
AJAXUsed to give the illusion that a web page changes without
refreshing it
FORMS (POST request)
CGI(POST request) common gateway interface support
Tasks status though a web page
Email Client Service
Assigned IP is sent via email if the dynamic IP is used.
TCP/IP Applications Using the MCF51CN FamilyDesigner Reference Manual, Rev. 0, 12/2009
7Freescale Semiconductor
Chapter 1 Introduction
FTP Server Service
Stores information using FAT and then makes it accessible using FTP
FTP is mounted over an SD card reader
1.3 Advantages
The MCF51CN128 is a low cost MCU that can enable Ethernet/TCP/IP connectivity
to any embedded design.
Software source codes are available to directly use in a customer application. It also
allows customer changes or customizations.
Hardware les are provided for free. If a change in hardware is required for a customized
design, hardware source les can be edited.
The MCF51CN128 MCU can obtain power from connectors like the RJ45 and DB9.
For support enter a service request at, www.freescale.com/support.
1.4 Development Tools
CodeWarrior V6.2.1 is used to download the software application.
A proper Ethernet cable must be selected depending on the Ethernet element that is the
PC, hub, switch, or router.
1.5 Top and Bottom View of the MCF51CN128 Reference Design
Hardware
The following gures describe the top and bottom view of the board. A hardware block
diagram is shown in Figure 2-2. For details about components, go to Sections 2.2 and Section
2.3.
TCP/IP Applications Using the MCF51CN FamilyDesigner Reference Manual, Rev. 0, 12/2009
Freescale Semiconductor8
Advantages
Figure 1-1.Top view of MCF51CN128 reference design hardware
Figure 1-2. Bottom view of MCF51CN128 reference design hardware
1.6 How the MCF51CN128 Reference Design Fits Your System
The following gures show how the system ts into some TPC/IP applications. Specic
features are explained in the Section Firmware. The gures show reference design squared
by a red box.
TCP/IP Applications Using the MCF51CN FamilyDesigner Reference Manual, Rev. 0, 12/2009
9Freescale Semiconductor
Chapter 1 Introduction
Figure 1-3. Serial bridge in Bridge mode
Figure 1-4. Serial bridge in Configuration mode
Figure 1-5.Web server implemented at MCF51CN family providing HTTP services, one
client at a time
TCP/IP Applications Using the MCF51CN FamilyDesigner Reference Manual, Rev. 0, 12/2009
Freescale Semiconductor10
How the MCF51CN128 Reference Design Fits Your System
Figure 1-6. Email client connecting to an SMTP server
Figure 1-7. FTP server using FAT16 on an SD card
TCP/IP Applications Using the MCF51CN FamilyDesigner Reference Manual, Rev. 0, 12/2009
11Freescale Semiconductor
Chapter 1 Introduction
TCP/IP Applications Using the MCF51CN FamilyDesigner Reference Manual, Rev. 0, 12/2009
Freescale Semiconductor12
How the MCF51CN128 Reference Design Fits Your System
Chapter 2
Hardware Description
2.1 Hardware
The hardware design characteristics are as follows:
1. Show the small-size Ethernet application board using the MCF51CN128 MCUThis
area must be programmable, functional, and completely independent. This area is called
the Minimal System (see Section 2.4).
2. Demonstrate the Minimal System capabilities using sensors and external hardware.
This area is called the Demo System (see Section 2.4).
3. The Minimal System must be designed in the hardware in such a way that the whole
system can work independent of the Demo System. A set of zeroResistors are provided
so the Minimal System can be isolated from the Demo System.
4. Provide the user with customizable hardwareIf only the Minimal System is required,
layout les from the MCF51CN128 reference design can be edited. Therefore, the
Minimal System can be copied to a new hardware project. Only a power source
connection is required for the Minimal System.
5. To reuse the Minimal System, the same hardware components must be selected.
6. The Demo System must be able to provide all the serial interfaces for testing the VSCI,
IIC, and SPI.
7. The board is able to get power from ve sources. See Section 2.7.
8. The board is able to provide all serial signals available to the client through an accessible
serial header.
2.2 Minimal System Features
The following is a list of main components in the Minimal system:
TCP/IP Applications Using the MCF51CN FamilyDesigner Reference Manual, Rev. 0, 12/2009
13Freescale Semiconductor
Top view (see Figure 1-1):
MCF51CN128 Uses a 48-pin QFN package to handle all the TCP/IP applications
Power LEDTurned on when the power is applied
Reset buttonResets the MCF51CN128 processor
Customized BDM for programming
LDO on-boardProvides regulated 3.3 V. The voltage must be between 3.7 V and
5.5 V.
Ethernet PHY 10/100 Mbps
RJ45 connector
Bottom view (see Figure 1-2):
A single 25 MHz oscillator crystalFeeds the MCF51CN128. The MCU then
feeds the Ethernet PHY clock.
2.3 Demo System Features
The following is the list of the Demo system main components:
Top view (see Figure 1-1):
Standard 2 × 3 BDM connector
Serial headerAll serial signals are mapped
Temperature sensor by IIC
ADCUsing a POT
LEDGeneral purpose LED
Power can be supplied from:
Power jack5.5 V max
Terminal block5.5 V max
Unused DB9 pin for power5.5 V max
Unused Ethernet cable pairs for power5.5 V max
Battery3.3 V max
Accelerometer sensor using SPI
TCP/IP Applications Using the MCF51CN FamilyDesigner Reference Manual, Rev. 0, 12/2009
Freescale Semiconductor14
Demo System Features
Two buttons connected to KBI pins
RS485 output connector
Female DB9 output connector
Bottom view (see Figure 1-2):
RS485 transceiver
RS232 transceiver
µSD card connector
2.4 Connection Between Minimal System and Demo System
Features
The following gure shows how the MCF51CN128 reference design hardware is divided
into a Minimal and Demo system.
A set of zero resistors that connect both these systems are present and visible at the top
and bottom layers on the MCF51CN128 reference design hardware. Disconnecting these
registers isolate the Minimal system from the Demo system.
Figure 2-1. Board showing Minimal and Demo system
TCP/IP Applications Using the MCF51CN FamilyDesigner Reference Manual, Rev. 0, 12/2009
15Freescale Semiconductor
Chapter 2 Hardware Description
2.5 Hardware Block Diagram
The following block diagram shows the features of the MCF51CN128 reference design
hardware. The components related to the Minimal System are shown in the color blue and
the components related to the Demo System are shown in the color green.
Figure 2-2. MCF51CN128 reference design hardware block diagram
The following gures show the main hardware components on the MCF51CN128 reference
design hardware.
TCP/IP Applications Using the MCF51CN FamilyDesigner Reference Manual, Rev. 0, 12/2009
Freescale Semiconductor16
Hardware Block Diagram
Figure 2-3. MCF51CN128 reference design top view
Figure 2-4. MCF51CN128 reference design bottom view
Note
The serial header is not populated in Figure 2-3.
TCP/IP Applications Using the MCF51CN FamilyDesigner Reference Manual, Rev. 0, 12/2009
17Freescale Semiconductor
Chapter 2 Hardware Description
2.6 Pinout Description
The following list shows how all the pins of the MCF51CN128 48-pin QFN are used
on the hardware:
Table 2-1. MCF51CN128 reference design hardware pin assignment
NotesFunc 2Func 1NamePin
VDD11Minimal System
VSS12
VDD213
VSS214
VDD325
VDDA26
VSSA27
VSSA28
VDD437
VSS438
PHYCLKPTA03
MII_MDIOPTA14
MII_MDCPTA25
MII_RXD3PTA36
MII_RXD2PTA47
MII_RXD1PTA58
MII_RXD0PTA69
MII_RX_DVPTA710
MII_RX_CLKPTB011
MII_RX_ERPTB112
MII_TX_CLKPTB316
MII_TX_ENPTB417
MII_TXD0PTB518
MII_TXD1PTB619
MII_TXD2PTB720
MII_TXD3PTC021
MII_COLPTC122
MII_CRSPTC223
EXTALPTD439
XTALPTD540
TCP/IP Applications Using the MCF51CN FamilyDesigner Reference Manual, Rev. 0, 12/2009
Freescale Semiconductor18
Pinout Description
NotesFunc 2Func 1NamePin
PTC3 (RST)RESET24Shared
PTD6 (BKGD)BKGD41
Analog MUX SelectorGPIO (SELECT-
OR)
PTE346Demo System
Selection by Analog
MUX
ADP3 (POT)SPSCK2 (ACC)PTD742
GPIO (SD)MISO2 (ACC)PTE043
MOSI2 (ACC)PTE144
GPIO (LED)SS2 (ACC)PTE245
SS1 (SD)PTB215
Selection by Analog
MUX
MOSI1 (SD)GPIO (CTS)PTC530
MISO1 (SD)SCL2 (TEMP)PTC631
SPSCK1 (SD)SDA2 (TEMP)PTC732
TXD1 (RS232)PTD033
RXD1 (RS232)PTD134
TXD2 (RS485)PTD235
RXD2 (RS485)PTD336
KBI2P4 (SW2)PTE447
KBI2P5 (SW1)PTE548
GPIO (RTS)PTC429
2.7 MCF51CN128 Reference Design Board Power Options
The following gure shows the power options for the MCF51CN128 reference design board.
The options are listed below:
EthernetBrown and blue pairs take power. Brown pair (pin 4 and 5) is positive and
blue pair (pin 7 and 8) is negative. The voltage drop due to the Ethernet cable length
must be considered when carrying power through the RJ45 cable.
Note
This is not power over Ethernet (PoE) but a way to power-up
the MCF51CN128 reference design board.
UARTPin 6, +5.5 V unregulated power
Power jack connector (Default Power Source)
Regulated 3.3 V jack connector
TCP/IP Applications Using the MCF51CN FamilyDesigner Reference Manual, Rev. 0, 12/2009
19Freescale Semiconductor
Chapter 2 Hardware Description
Figure 2-5. MCF51CN128 reference design board power options schematic
2.8 Hardware Considerations
The following list shows all the hardware considerations:
Due to a reduced number of pins to all the functions required by the Demo System, an
analog switch is required to switch between pin functions.
The following list shows shared functions that must be used exclusively:
µSD card reader and I2C (temperature sensor)
rs232 hardware signals and second SPI port (accelerometer sensor)
Accelerometer sensor and µSD card connector while containing a µSD card.
General purpose LED and second SPI port (accelerometer sensor)
POT and second SPI port (accelerometer sensor)
When using the Ethernet cable as the power supply, the length of the cable must be
considered due to the voltage drop.
TCP/IP Applications Using the MCF51CN FamilyDesigner Reference Manual, Rev. 0, 12/2009
Freescale Semiconductor20
Hardware Considerations
  • Page 1 1
  • Page 2 2
  • Page 3 3
  • Page 4 4
  • Page 5 5
  • Page 6 6
  • Page 7 7
  • Page 8 8
  • Page 9 9
  • Page 10 10
  • Page 11 11
  • Page 12 12
  • Page 13 13
  • Page 14 14
  • Page 15 15
  • Page 16 16
  • Page 17 17
  • Page 18 18
  • Page 19 19
  • Page 20 20
  • Page 21 21
  • Page 22 22
  • Page 23 23
  • Page 24 24
  • Page 25 25
  • Page 26 26
  • Page 27 27
  • Page 28 28
  • Page 29 29
  • Page 30 30
  • Page 31 31
  • Page 32 32
  • Page 33 33
  • Page 34 34
  • Page 35 35
  • Page 36 36
  • Page 37 37
  • Page 38 38
  • Page 39 39
  • Page 40 40
  • Page 41 41
  • Page 42 42
  • Page 43 43
  • Page 44 44
  • Page 45 45
  • Page 46 46
  • Page 47 47
  • Page 48 48
  • Page 49 49
  • Page 50 50
  • Page 51 51

Freescale Semiconductor MCF51CN128 Reference guide

Type
Reference guide

Ask a question and I''ll find the answer in the document

Finding information in a document is now easier with AI