MCF51CN128CLH Freescale Semiconductor, MCF51CN128CLH Datasheet

IC MCU 32BIT 128K FLASH 64-LQFP

MCF51CN128CLH

Manufacturer Part Number
MCF51CN128CLH
Description
IC MCU 32BIT 128K FLASH 64-LQFP
Manufacturer
Freescale Semiconductor
Series
MCF51CNr
Datasheets

Specifications of MCF51CN128CLH

Core Processor
Coldfire V1
Core Size
32-Bit
Speed
50MHz
Connectivity
Ethernet, I²C, SCI, SPI
Peripherals
LVD, PWM, WDT
Number Of I /o
54
Program Memory Size
128KB (128K x 8)
Program Memory Type
FLASH
Ram Size
24K x 8
Voltage - Supply (vcc/vdd)
1.8 V ~ 3.6 V
Data Converters
A/D 12x12b
Oscillator Type
External
Operating Temperature
-40°C ~ 85°C
Package / Case
64-LQFP
Processor Series
MCF51CN
Core
ColdFire V1
Data Bus Width
32 bit
Data Ram Size
24 KB
Interface Type
I2C, SPI, SCI
Maximum Clock Frequency
25 MHz
Number Of Programmable I/os
54
Operating Supply Voltage
1.8 V to 3.6 V
Maximum Operating Temperature
+ 85 C
Mounting Style
SMD/SMT
3rd Party Development Tools
JLINK-CF-BDM26, EWCF
Development Tools By Supplier
TWR-MCF51CN-KIT, TWR-SER, TWR-ELEV, TOWER
Minimum Operating Temperature
- 40 C
On-chip Adc
12 bit, 12 Channel
Package
64LQFP
Device Core
ColdFire
Family Name
MCF51CN
Maximum Speed
50.33 MHz
Number Of Timers
2
For Use With
TWR-MCF51CN - KIT TOWER BOARDTWR-MCF51CN-KIT - KIT TOWER BOARD/SERIAL/ELEVATOR
Lead Free Status / RoHS Status
Lead free / RoHS Compliant
Eeprom Size
-
Lead Free Status / Rohs Status
Lead free / RoHS Compliant

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
MCF51CN128CLH
Manufacturer:
FREESCALE
Quantity:
2 435
Part Number:
MCF51CN128CLH
Manufacturer:
Freescale Semiconductor
Quantity:
10 000
Part Number:
MCF51CN128CLH
Manufacturer:
FREESCALE
Quantity:
2 435
Part Number:
MCF51CN128CLH-1M72P
Manufacturer:
FREESCALE
Quantity:
20 000
Freescale Semiconductor
Application Note
Serial-to-Ethernet Bridge Using
MCF51CN Family and FreeRTOS
by: Paolo Alcantara
1
1.1
This document describes a serial-to-Ethernet bridge
using the MCF51CN128, the open-source RTOS
FreeRTOS™ v5.3.0 and the TCP/IP stack LwIP v1.3.0.
Serial interfaces used are UART and SPI. Ethernet
connects using a well-known socket implementation.
1.2
This document was written to help you enable older
serial interface-related designs for Ethernet connectivity.
Microcontrollers usually connect through interfaces like
SCI (or UART) and SPI. For this particular application,
the microcontroller used is the MCF51CN128, which
supports Ethernet-based connectivity.
To take advantage of this document, it is not mandatory
to have in-depth Ethernet protocol knowledge. For
custom modification, enough information is provided
in this application note.
© Freescale Semiconductor, Inc., 2009. All rights reserved.
RTAC Americas
Mexico 2009
Overview
Purpose
Scope
1
2
3
4
5
6
7
8
Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Introduction to Serial-to-Ethernet Bridge Hardware. . . . . 2
Introduction to the Serial-to-Ethernet Bridge Software . 11
Serial-to-Ethernet Software . . . . . . . . . . . . . . . . . . . . . . 20
Hardware Abstraction Layer (HAL) Implementation . . . 25
Serial Bridge API . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
Customization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
Conclusion. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
Document Number: AN3906
Contents
Rev. 0, 06/2009

Related parts for MCF51CN128CLH

MCF51CN128CLH Summary of contents

Page 1

... MCF51CN128, which supports Ethernet-based connectivity. To take advantage of this document not mandatory to have in-depth Ethernet protocol knowledge. For custom modification, enough information is provided in this application note. © Freescale Semiconductor, Inc., 2009. All rights reserved. Document Number: AN3906 Rev. 0, 06/2009 Contents 1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 2 Introduction to Serial-to-Ethernet Bridge Hardware ...

Page 2

... Figure 2. A Serial Device Connected to Another Serial Device Using Client and Server Implementation Using Figure 3. A Serial Device Connected to a Serial Bridge, which is Connected to the Internet, and a Non-Serial Bridge Receives and Transmits the Information Serial-to-Ethernet Bridge Using MCF51CN Family and FreeRTOS, Rev Two Serial Bridges Freescale Semiconductor ...

Page 3

... Button Power Selector Power Jack Figure 4. Hardware Block Diagram of MCF51CN128 Reference Design Board Serial-to-Ethernet Bridge Using MCF51CN Family and FreeRTOS, Rev. 0 Freescale Semiconductor Introduction to Serial-to-Ethernet Bridge Hardware Figure 4 shows a block diagram of the hardware used RJ45 PHY RST 51C N128 Non-standard ...

Page 4

... Two buttons — RS232 and RS485 transceivers — Accelerometer thru SPI interface — Temperature sensor thru IIC interface — General-purpose LED — Cut traces to select among all the power options Serial-to-Ethernet Bridge Using MCF51CN Family and FreeRTOS, Rev Freescale Semiconductor ...

Page 5

... UART: pin six, +5.5 V unregulated power • Power jack connector (default power source) • Regulated 3.3 V jack connector · Figure 5. MCF51CN128 Reference Design Board Power Options Schematic Serial-to-Ethernet Bridge Using MCF51CN Family and FreeRTOS, Rev. 0 Freescale Semiconductor Introduction to Serial-to-Ethernet Bridge Hardware NOTE 5 ...

Page 6

... Figure 7. MCF51CN128 Reference Design Board Rev. A The serial bridge is targeted at the MCF51CN128 reference design board but also works with the tower board, shown below. For more details about the tower visit www.freescale.com/tower. Serial-to-Ethernet Bridge Using MCF51CN Family and FreeRTOS, Rev Freescale Semiconductor ...

Page 7

... Bridge mode — characters received at serial interface, are sent to Ethernet and vice versa. The web server interface works all the time but the serial configuration (UART or SPI) works only in configuration mode. Serial-to-Ethernet Bridge Using MCF51CN Family and FreeRTOS, Rev. 0 Freescale Semiconductor Introduction to Serial-to-Ethernet Bridge Hardware 7 ...

Page 8

... Serial-to-Ethernet Bridge Using MCF51CN Family and FreeRTOS, Rev MAC Parameters 00:CF:52:35:00:07 192.168.1.3 for static implementation 255.255.255.0 192.168.1.1 192.168.1.3 Dynamic TCP Parameters 1234 192.168.1.3 Bridge UART Parameters First port 19200 None 8 1 Software flow control SPI Parameters Second port 1 Mbps Low Middle Master Polling Freescale Semiconductor ...

Page 9

... GET functions will return the same number of characters as “Number of Parameters.” Serial-to-Ethernet Bridge Using MCF51CN Family and FreeRTOS, Rev. 0 Freescale Semiconductor Introduction to Serial-to-Ethernet Bridge Hardware Figure 9. GET Commands nd 2 Character Character: Number of ...

Page 10

... Serial-to-Ethernet Bridge Using MCF51CN Family and FreeRTOS, Rev SET Commands nd 2 Character Character: Number of Command ID Parameters 0xA0 1 0xA0 1 0xA0 1 0xA0 1 0xA0 1 0xA0 1 0xA0 1 0xA0 1 0xA0 1 0xA0 1 0xA0 1 0xA0 1 0xA0 1 0xA0 1 0xA0 1 0xA0 2 0xA0 2 0xA0 4 0xA0 4 0xA0 4 0xA0 4 0xA0 4 0xA0 6 0xA0 6 0xA0 6 0xA0 6 NOTE rd 3 Character: SubCommand Freescale Semiconductor ...

Page 11

... Only two pins are used (RxD and TxD). However, an extra software layer must be added to UART software drivers to have this feature. Additionally a non-flow control is presented. Serial-to-Ethernet Bridge Using MCF51CN Family and FreeRTOS, Rev. 0 Freescale Semiconductor Introduction to the Serial-to-Ethernet Bridge Software RST Command ...

Page 12

... UART ISR will take it character by character until it is emptied in this transmission case. In this way, the number of times communication is stopped by using flow control is reduced. See Serial-to-Ethernet Bridge Using MCF51CN Family and FreeRTOS, Rev Figure 12 and Figure 13 for more details. Freescale Semiconductor ...

Page 13

... However, protocols like UART and SPI receive character per character. Serial-to-Ethernet Bridge Using MCF51CN Family and FreeRTOS, Rev. 0 Freescale Semiconductor Introduction to the Serial-to-Ethernet Bridge Software 13 ...

Page 14

... Ethernet node inside the network, like the Internet as shown in Serial-to-Ethernet Bridge Using MCF51CN Family and FreeRTOS, Rev Table 3 shows a summary of this section. Table 3. Baud Rates and Data Handling Communication Process UART and SPI Pollings Interrupts Table Figure 14. Serial Bridge in Bridge Mode (Figure 26), 3. Freescale Semiconductor ...

Page 15

... To change again to configuration mode, this must be requested by the web page. A switch from bridge mode to configuration mode from serial interface (UART or SPI) cannot be made to avoid altering bridge operability. Serial-to-Ethernet Bridge Using MCF51CN Family and FreeRTOS, Rev. 0 Freescale Semiconductor Introduction to the Serial-to-Ethernet Bridge Software 15 ...

Page 16

... SPI-to-UART bridge, because this goes out of the scope of this document. For more information about SPI and UART see the MCF51CN128 Reference Manual . For software go to Processor Expert TM Codewarrior v6.2.1. Serial-to-Ethernet Bridge Using MCF51CN Family and FreeRTOS, Rev Figure 1, Figure 2, and Figure 3 Freescale Semiconductor show these cases. TM for ...

Page 17

... MAC address — IP address — Mask address — Gateway address — Server address to connect as a client — Static or dynamic address Serial-to-Ethernet Bridge Using MCF51CN Family and FreeRTOS, Rev. 0 Freescale Semiconductor Introduction to the Serial-to-Ethernet Bridge Software Figure 5 for more details. Figure 17 for 17 ...

Page 18

... The following settings can be changed or shown at run time through the configuration web or at compile time in the file constants.c: — Port — Baud rate — Parity — Number of bits — Number of stop bits — Flow control Serial-to-Ethernet Bridge Using MCF51CN Family and FreeRTOS, Rev Figure 5 for more details. Freescale Semiconductor ...

Page 19

... It can also be used in the tower board. Selection between either M51CN128RD or V1TOWER C-macros inside m51cn128evb.h file. Figure 18. Code Snippet for Hardware Change Serial-to-Ethernet Bridge Using MCF51CN Family and FreeRTOS, Rev. 0 Freescale Semiconductor Introduction to the Serial-to-Ethernet Bridge Software NOTE 19 ...

Page 20

... Serial-to-Ethernet Bridge Using MCF51CN Family and FreeRTOS, Rev Email UIF uSD Serial Client (UART) Card Bridges SPI IIC FreeRTOS (RTOS) SPI IIC GPIO ADC Hardware Figure 19. Software Segmentation Table 4) HTTP DCHP Server 2.0 Client lwIP 1.3.1 TCP/IP Stack MAC RTC FEC KBI Freescale Semiconductor ...

Page 21

... The implementation of a layered software architecture allows to easily migrate this application software to other Freescale MCUs like MCF5225x, MCF5223x, or even higher processors if more resources are needed like FlexCAN, Encryption, or USB. The following sections give more detail. Serial-to-Ethernet Bridge Using MCF51CN Family and FreeRTOS, Rev. 0 Freescale Semiconductor FreeRTOS Files ROM list.c 212 queue ...

Page 22

... STDLIB 3056 TCP 15143 UDP 1594 TOTAL 51636 MODULE ROM TCP/IP API 5887 DHCP 5213 DNS 1639 ETHERNET 2536 FEC 1140 ICMP 772 IP 5072 LwIP+FREERTOS 824 OTHERS 4017 RAM 24 4 569 47 4678 8604 14043 RAM 24 4 569 47 4678 8604 Freescale Semiconductor ...

Page 23

... Table 6. LwIP Memory Footprint for MCF51CN128 MCU (Debugging Options OFF) (continued) Memory footprint doesn’t consider RAM space taken by the TCP/IP suite at run time, only at compile time. Serial-to-Ethernet Bridge Using MCF51CN Family and FreeRTOS, Rev. 0 Freescale Semiconductor STDLIB 3056 TCP 12896 ...

Page 24

... Serial-to-Ethernet Software 4.2 3.2 Software Hierarchy The following figure shows files’ hierarchy: Serial-to-Ethernet Bridge Using MCF51CN Family and FreeRTOS, Rev Figure 21. File Implementation Freescale Semiconductor ...

Page 25

... The following figures are representation of the software blocks more important for the HAL, the closest software layer to hardware, using modules and register present on the MCF51CN128 MCU. Serial-to-Ethernet Bridge Using MCF51CN Family and FreeRTOS, Rev. 0 Freescale Semiconductor Hardware Abstraction Layer (HAL) Implementation Table 7. File Purpose ...

Page 26

... LwIP TCP/IP stack. Then it releases the buffer so the buffer can be available during the next reception by the FEC RX ISR. Finally, it waits for a new signal from the FEC RX ISR. Serial-to-Ethernet Bridge Using MCF51CN Family and FreeRTOS, Rev Freescale Semiconductor ...

Page 27

... The low-level transmission of the FEC controller is as follows: 1. Wait for an available buffer descriptor 2. Fill from the network buffers (LwIP TCP/IP stack) to the Tx buffer 3. Start the Tx transfer Serial-to-Ethernet Bridge Using MCF51CN Family and FreeRTOS, Rev. 0 Freescale Semiconductor Hardware Abstraction Layer (HAL) Implementation Figure 22. FEC Rx Processing 27 ...

Page 28

... Allocate one Tx buffer 3. Both Tx buffers’ descriptors point to the same allocated Tx buffer 4. Send as usual; more details in Figure 24. Code Snippet Showing How Both Buffer Descriptors Point to the Same Buffer Area Serial-to-Ethernet Bridge Using MCF51CN Family and FreeRTOS, Rev Figure 23. FEC Tx Processing Figure 24 Freescale Semiconductor ...

Page 29

... UART Flow Control The following flow diagrams are part of uart_rtos.c and uart_rtos.h implementation for the Rx and Tx flow control. Figure 25. Rx ISR Flow Control State Machine Serial-to-Ethernet Bridge Using MCF51CN Family and FreeRTOS, Rev. 0 Freescale Semiconductor Hardware Abstraction Layer (HAL) Implementation 29 ...

Page 30

... The following figures show the functionality of the application bridge as software and hardware blocks and the differences between them with a polling or interrupt implementation. Files uart_rtos.c and spi_rtos.c with their respective header files show this functionality. Serial-to-Ethernet Bridge Using MCF51CN Family and FreeRTOS, Rev Figure 27. Polling Handling Freescale Semiconductor ...

Page 31

... The following tables show the main functions used for the serial-to-Ethernet bridge The bridge only has two main functions to allow the bridge to run: Table 8. UART to Send and Receive Character Serial-to-Ethernet Bridge Using MCF51CN Family and FreeRTOS, Rev. 0 Freescale Semiconductor Figure 28. Interrupt Handling Sintaxis void ...

Page 32

... LwIP configuration file. Enables/disables TCP/IP options. Changes GPIO used for all modules in the MCU. FreeRTOS user-configuration file. Enables/disables features. Default setting for this serial bridge. Select task priorities and buffer length for UART bridge. Select task priorities and buffer length for SPI bridge. Freescale Semiconductor ...

Page 33

... To learn more about the tower system please visit: www.freescale.com/tower. • The BridgeSoftwareDemo software was developed and tested with CodeWarrior for Coldfire v6.2.1. • Download the source files for AN3906SW.zip from www.freescale.com. Serial-to-Ethernet Bridge Using MCF51CN Family and FreeRTOS, Rev. 0 Freescale Semiconductor ROM RAM 5.5 KB 344 B FreeRTOS 43 ...

Page 34

... Freescale Semiconductor product could create a situation where personal injury or death may occur. Should Buyer ...

Related keywords