AN2282
APPLICATION NOTE
TCP/IP Over Ethernet Connectivity
with the STR710
Introduction
With the ever-increasing success of the Internet, many applications with networking features
are being developed making the TCP/IP protocol a global standard for communication both
for the Internet and local area networks. In a normal scenario, a microcontroller inside a
home appliance or process controller of an industrial distributed control system is not
directly connected to the Internet but instead is a host of a home or industrial local area
network using an Ethernet protocol.
This application note describes a method to provide TCP/IP over Ethernet connectivity to an
STR710-based solution and, as an example, an application layer has been included in the
solution firmware. The application is a server that waits for a Client request. The successful
or unsuccessful processing notification is sent back to the Client. The solution block diagram
is showed in
Figure 1.
The MAC layer is implemented using the third part CIRRUS LOGIC
®
Crystal LANTM CS8900A 10-baseT Ethernet controller because of its ISA bus interface.
The STR7 EMI interface can be interfaced with an ISA bus by simple Glue Logic.
Figure 1.
Solution block diagram
CS8900A
EMI
ISA
Glue
Logic
STR7
RJ45
RS232
USB
February 2006
Rev 1
www.st.com
1/19
Contents
AN2282
Contents
1
Hardware . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.1
1.2
The STR710 microcontroller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
EMI-ISA Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
2
Firmware . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2.1
Ethernet controller driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2.1.1
2.1.2
2.1.3
Low Level Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
Initialization and configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
Ethernet packet management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
2.2
2.3
2.4
Device driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
TCP/IP layers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
Application layer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
3
4
5
Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
Revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
2/19
AN2282
Hardware
1
Hardware
The target microcontroller for the solution is the STR710 with TQFP144 package to have the
EMI bus available for Ethernet controller interfacing. The hardware includes also a RS232
interface for SLIP implementation.
1.1
The STR710 microcontroller
The STR710 is a 16-/32-bit microcontroller based on the ARM7TDMI RISC microprocessor.
It combines the high performance of the ARM® CPU with an extensive range of peripheral
functions and enhanced I/O capabilities. The microcontroller has on-chip high-speed single
voltage FLASH memory and high-speed RAM, since both memories are mounted on an
ARM® CPU native bus the STR710 maximizes the CPU calculation speed. The STR710
has an embedded ARM® core and is therefore compatible with all ARM tools and software.
The 144-pin version (used for the solution in the present AN) has a non-multiplexed 16-bit
data/24-bit address bus available that supports four 16-Mbyte banks of external memory
(EMI). Wait states are programmable individually for each bank allowing different memory
types (Flash, EPROM, ROM, SRAM etc.) to be used to store programs or data. Later on, the
way of interfacing the EMI with an ISA Ethernet controller will be shown.
3/19
Hardware
AN2282
The STR710 main features are as follows [1]:
●
Memories:
–
–
–
–
Up to 272 KB (256+16) FLASH program memory
Up to 64 KB RAM
EMI for up to 4 banks with 16MB of addressing space each (64MB total)
Multi-boot capability
3.3V supply and I/O interface
Embedded 1.8V voltage regulator for core supply
Up to 50 MHz CPU operating frequency with external clock source and internal
PLL
Real-time clock for clock-calendar function
4 power saving modes: SLOW, WAIT, STOP and STANDBY
Fast interrupt handling with multiple vectors
32 vectors with 16 IRQ priority levels
2 maskable FIQ sources
Up to 48 I/O ports
16-bit watchdog timer
Four 16-bit timers each with: 2 input captures, 2 output compares, PWM and
pulses counter mode
2 I2C interfaces (1 multiplexed with SPI)
4 UART
Smart card ISO7816-3 interface on UART1
2 BSPI
CAN interface (2.0B Active)
Full speed USB (12Mbits/sec)
HDLC interface
Sampling frequency up to 1 KHz
Conversion range: 0 to 2.5V
JTAG with debug mode trigger request
●
Clock, Reset and Supply Management:
–
–
–
–
–
●
Nested Interrupt Controller:
–
–
–
●
●
I/O Ports:
–
–
–
5 Timers:
●
10 Communication Interfaces:
–
–
–
–
–
–
–
●
4 Channel 12-bit A/D Converter:
–
–
●
Development Tools Support:
–
4/19
AN2282
Hardware
1.2
EMI-ISA Interface
The CS8900A Ethernet controller includes a direct interface to the ISA bus. The ISA bus
(Industry Standard Architecture) has been the first standard in the IBM PC architecture;
detailed information and specification can be found in the following documents:
●
EISA Specification, Version 3.12. This document includes specifications for ISA as well
as the "Extended Industry Standard Architecture" that defines a 32-bit extension to the
ISA [2].
PS/2 Technical Reference - AT Bus Systems. This document includes signal definitions
and timing diagrams for the ISA bus used in some IBM computers [3].
●
At the same time, the CS8900A can be used for cost-effective, full-duplex Ethernet solutions
for non-ISA architectures as referenced in the application note AN83 from CIRRUS LOGIC®
Crystal LANTM CS8900A ETHERNET CONTROLLER TECHNICAL REFERENCE
MANUAL [4].
The reference schematic of the hardware interface between EMI and the ISA bus is shown
in
Figure 2.
The Chip Select 2 of EMI is used to address the Ethernet Controller; moreover
address line A23 of EMI is used together with CS.2 to enable read/write operations on
CS8900A. From a firmware point of view, this means that the Ethernet Controller is mapped
at base address 0x64800000; in this way the CS.2 is not committed only by the CS8900A
but it also can be used to address other devices.
Figure 2.
STR7 EMI Control Bus
CS.2
nRD
WE0
WE1
nWR
1
2
3
4
5
6
7
EMI-ISA glue logic reference schematic
IC6
U7
1 VDD
2
13
3
12
4
11
5
10
6
9
GND 8
+3V3
14
13
12
11
10
9
8
IC5
nA23
1
CS.2
2
3
nAE
4
5
nWR
MEMW
6
7
1A
1B
1Y
2A
2B
2Y
GND
vcc
4B
4A
4Y
3B
3A
3Y
+3V3
14
13
12
11
10
9
A12
8
IOW
nRD
nAE
MEMR
MEMR
A12
IOR
1
2
3
4
5
6
7
1A
1B
1Y
2A
2B
2Y
GND
vcc
4B
4A
4Y
3B
3A
3Y
+3V3
14
13
12
11
10
9
8
MEMW
IOW
MEMR
IOR
NIC ISA Control Bus
M74HC08TTR-TTSOP14
74LVC32ATTR-TSSOP14
74LVC32ATTR-TSSOP14
IC101
STR7 EMI Address Bus
A0
A1
A2
A3
A4
A5
A6
A7
GND
1
2
3
4
5
6
7
8
9
GND
10
OE
D0
D1
D2
D3
D4
D5
D6
D7
GND
VCC
Q0
Q1
Q2
Q3
Q4
Q5
Q6
Q7
LE
20
19
18
17
16
15
14
13
12
11
+3.3V
QA0
QA1
QA2
QA3
QA4
QA5
QA6
QA7
CS.2
NIC nSBHE
NIC ISA Address Bus
74LVX573T
IC100
GND
A8
A9
A10
A11
A12
U15
2
NOT
1
nA23
GND
1
2
3
4
5
6
7
8
9
10
OE
D0
D1
D2
D3
D4
D5
D6
D7
GND
VCC
Q0
Q1
Q2
Q3
Q4
Q5
Q6
Q7
LE
20
19
18
17
16
15
14
13
12
11
+3.3V
QA8
QA9
QA10
QA11
QA12
NIC SA13 to SA19, AEN,
CHIPSEL Grounded
CS.2
74LVX573T
STR7 EMI Data Bu s
D0
D1
D2
D3
D4
D5
D6
D7
D8
D9
D10
D11
D12
D13
D14
D15
NIC ISA Data Bus
The CS8900A can be accessed both in ISA IO mode and ISA memory mode; the glue logic
is designed to allow both access modes. The Address line A12 separates IO address space
and memory address space. When A12 is low the Ethernet Controller is accessed in IO
5/19