Page 2 - Figures
SLAA137A 2 MSP430 Internet Connectivity 4.1 Ethernet Module .......................................................................................................................... 4 4.2 TCP/IP Module ....................................................................................................
Page 3 - Introduction; ISO/OSI vs Internet Reference Model
SLAA137A MSP430 Internet Connectivity 3 1 Introduction While known for its use in PC networks, the ethernet also offers a robust, well-understood and reasonably priced technology for networking applications beyond the desktop computer. The goal of this design is to show how easy it is to implement a...
Page 4 - Functions of Internet Reference Model Layers; Send; Data Encapsulation; Ethernet; carrier
SLAA137A 4 MSP430 Internet Connectivity Table 1. Functions of Internet Reference Model Layers Layer Name Function Example Application layer Contains a lot of protocols defined by different applications to provide their services. HTTP, telnet, e -mail (SMTP, POP) Transport layer Makes the communicati...
Page 5 - media; Address Resolution Protocol; The destination host is not connected to the network
SLAA137A MSP430 Internet Connectivity 5 Every network node has its own unique physical address. It is 48 bits long and called the media access control (MAC) address. The maximum length possible for an Ethernet frame is 1518 bytes. This size covers the whole frame, excluding the preamble. The preambl...
Page 6 - Internet Control Message Protocol; Transmission Control Protocol; The
SLAA137A 6 MSP430 Internet Connectivity 2.4 Internet Control Message Protocol The internet control message protocol (ICMP) provides a mechanism for reporting problems and generating diagnostic messages, e.g., when a datagram cannot reach its des tination, when a gateway does not have the buffering c...
Page 7 - Hypertext Transfer Protocol; Important HTTP Methods; Hardware Description; The CS8900A is a low -cost ethernet LAN controller optimized for
SLAA137A MSP430 Internet Connectivity 7 2.6 Hypertext Transfer Protocol The hypertext transfer protocol (HTTP) is an application level protocol. It is a generic, stateless, object oriented protocol that can be used for many tasks, such as name servers and distributed object management systems, throu...
Page 8 - Hardware Block Diagram; Interfacing to the LAN Controller
SLAA137A 8 MSP430 Internet Connectivity MSP430F149 CS8900A D[7..0] A[3..0] IOR I O W Isolation Transformer RJ45 Connector LEDs: Power, Link, LAN 20 MHz 8 MHz JTAG Figure 3. Hardware Block Diagram 3.1 Interfacing to the LAN Controller The most interesting thing is the connection between the LAN contr...
Page 9 - Circuit Description
SLAA137A MSP430 Internet Connectivity 9 3.2 Circuit Description The analog circuitry around the CS8900A is built as further described in Resource [8]. A 20-MHz crystal is connected between the pins XTAL1 (pin 97) and XTAL2 (pin 98) of the CS8900A. Because of the built-in loading capacitance on the X...
Page 10 - Prototype Board With Components Installed; Connection to the Network
SLAA137A 10 MSP430 Internet Connectivity Figure 4. Prototype Board With Components Installed Appendix A shows the schematic and Appendix B provides a list of components that are needed to build the module. For each of the discrete parts, there are several manufacturers available. 3.3 Connection to t...
Page 11 - Software Description; Overview of the Software Modules; Ethernet Module
SLAA137A MSP430 Internet Connectivity 11 4 Software Description This chapter describes the implemented TCP/IP stack, the ethernet driver, and the HTTP server. The entire software is written in C and therefore porting to other MCU systems should be quite easy. For reasons of better understanding, the...
Page 12 - Functions of the Ethernet Module
SLAA137A 12 MSP430 Internet Connectivity Table 4. Functions of the Ethernet Module Name, Parameters Description void Init8900(void) Initializes important MCU port pins, does a software reset of the LAN controller, and sets up the LAN controller MAC interface. void Write8900(unsigned char Address, un...
Page 13 - Using the Ethernet Module; A frame is received over the LAN
SLAA137A MSP430 Internet Connectivity 13 Init8900() User Program Write8900(ADD_PORT, PP_RxEvent) (Read8900(DATA_PORT) & RX_OK)? CopyFromFrame8900(...) Application Wants to Send Data? RequestSend(FrameSize) Rdy4Tx()? RequestSend(FrameSize) Yes No No Yes Yes No Figure 5. Using the Ethernet Module ...
Page 14 - A time-out is exceeded
SLAA137A 14 MSP430 Internet Connectivity • A time-out is exceeded • An error occurs (network error, connection is reset by the opponent) The software implements the essential parts of the standards RFC 791, 792 and 793. The most important function of this stack is DoNetworkStuff(). This function mus...
Page 15 - Buffer Memory; Buffer Concept; Global Variables
SLAA137A MSP430 Internet Connectivity 15 4.2.1 Buffer Memory To work with incoming and outgoing frames, three memory buffers are reserved in the MCU SRAM. The size of these buffers can be adapted by changing the appropriate symbolic constants in tcpip.h. Increasing the size of the buffers leads to a...
Page 16 - Demultiplexing of Received Frames
SLAA137A 16 MSP430 Internet Connectivity Frame Was Received. Individually Addressed? Broadcast? ARP, Opcode REPLY? IP? Process Frame. ICMP? TCP? ProcessICMPFrame() ProcessTCPFrame() Figure 8. Demultiplexing of Received Frames If the frame was individually addressed, it is first checked to determine ...
Page 17 - Opening a Connection; maximum segment size; Data Transfer
SLAA137A MSP430 Internet Connectivity 17 To prevent the receive buffer from corruption while receiving data, a handshake mechanism is implemented. This mechanism uses the SOCK_DATA_AVAILABLE flag of the SocketStatus register. The TCP stack only copies data to RxTCPBuffer if the SOCK_DATA_ AVAILABLE ...
Page 18 - Closing a Connection; initial sequence number; Retransmission of Data
SLAA137A 18 MSP430 Internet Connectivity 4.2.6 Closing a Connection A TCP connection can be closed on different events. Normally this is done either locally by calling the user function TCPClose() or remotely by the other TCP. During the termination of a connection, segments carrying FIN flags are e...
Page 19 - Compatible Communication Systems; Only one TCP session possible at one time; API
SLAA137A MSP430 Internet Connectivity 19 Table 5. Compatible Communication Systems Computer System / CPU Operating System, TCP/IP Stack PC / Athlon™/ 1 GHz Windows 2000 PC / Athlon / 1 GHz Linux, kernel v 2.2.16 PC / Pentium™ / 233 MHz Windows 98 PC / 486DX2 / 66 MHz Windows 95 Apple™ Macintosh™ / 6...
Page 20 - The blocks containing
SLAA137A 20 MSP430 Internet Connectivity Very important for the proper function of the stack is the periodic calling of the function DoNetworkStuff() by the application. A typical program flow chart using this TCP/IP API is shown in Figure 9. DoNetworkStuff() Open or Close Connection Process Incomin...
Page 21 - Functions; flash emulation tool
SLAA137A MSP430 Internet Connectivity 21 4.3.1 Functions void TCPLowLevelInit(void) This function does a basic setup of the ethernet controller and numerous variables; it also configures ports and timer_A of MSP430. It must be called before any data transmission via TCP/IP can take place. void TCPPa...
Page 22 - Transmitting of Data; Flags
SLAA137A 22 MSP430 Internet Connectivity void TCPClose(void) Use this API function to close an open connection. Before disconnecting, the stack ensures that a packet that still resides in the output buffer is transmitted and acknowledged properly. After closing, the application may reconfigure IP ad...
Page 23 - SocketStatus Register; Data Reception
SLAA137A MSP430 Internet Connectivity 23 Bit 7 SOCK_ ERROR Bit 6 SOCK_ERROR Bit 5 SOCK_ERROR Bit 4 SOCK_ERROR Bit 3 SOCK_TX_BUF_ RELEASED Bit 2 SOCK_DATA_ AVAILABLE Bit 1 SOCK_ CONNECTED Bit 0 SOCK_ACTIVE Figure 11. SocketStatus Register SOCK_ACTIVE (Bit 0) This flag is set when the TCP is busy open...
Page 24 - Stack Error Codes; HTTP Server Application Example
SLAA137A 24 MSP430 Internet Connectivity SOCK_TX_BUF_RELEASED (Bit 3) This flag indicates whether the application can change the contents of the transmit buffer or modify the TCPTxDataCount variable. This flag is set by the stack if the previous packet sent was acknowledged properly. This realizes a...
Page 25 - Web Server Main Module
SLAA137A MSP430 Internet Connectivity 25 SOCK_ACTIVE? Yes No TCPPassiveOpen() TCPLowLevelInit() Initialize HTTP Server's Flag-Register TCPLocalPort = TCP_PORT_HTTP Initalizing of Clock System Configure MCU's I/O Ports DoNetworkStuff() HTTPServer() Figure 13. Web Server Main Module
Page 26 - AD; Dynamic Web Page Example
SLAA137A 26 MSP430 Internet Connectivity After initializing some hardware and the stack itself, the local TCP port is set to 80 (default for an HTTP server). The server is now waiting for a client to be connected. During the first jump to HTTPServer() after connecting, the flag HTTP_SEND_PAGE in reg...
Page 28 - Internet Explorer Screen
SLAA137A 28 MSP430 Internet Connectivity By using the REFRESH statement in the HEAD section of the page’s source code, an Internet browser c an be advised to reload the page after a specified timeout period. In the demonstration HTTP server, the page is reloaded each five seconds. The HTML code show...
Page 29 - References
SLAA137A MSP430 Internet Connectivity 29 5 References 1. TCP/IP Running a Successful Network by Washburn, K., Evans, J. Addison Wesley, 1996 2. Internet Protocol (IP) by Postel, J., RFC 791† 3. Internet Control Message Protocol by Postel, J., RFC 792† 4. Transmission Control Protocol by Postel, J., ...
Page 30 - Appendix A. Application Schematic
SLAA137A 30 MSP430 Internet Connectivity Appendix A. Application Schematic
Page 31 - Appendix B. Parts List
SLAA137A MSP430 Internet Connectivity 31 Appendix B. Parts List Part Name Value / Description Package C1 560 pF SMT 0805 C2, C3, C6, C13, C14, C15, C16, C17, C18, C19, C20, C21, C22 0.1 µF (100n) SMT 0805 C4, C5 15 pF SMT 0805 C24, C25 4700 pF / 2 kV (4n7) D1 LED red, 3 mm, 2 mA (rt) D2 LED yellow, ...
Page 32 - IMPORTANT NOTICE
IMPORTANT NOTICE Texas Instruments Incorporated and its subsidiaries (TI) reserve the right to make corrections, enhancements, improvements and otherchanges to its semiconductor products and services per JESD46, latest issue, and to discontinue any product or service per JESD48, latestissue. Buyers ...