Development of Prototype for Ethernet port with ARM Cortex-M3 Processor for Web Application

DOI : 10.17577/IJERTV4IS090288

Download Full-Text PDF Cite this Publication

Text Only Version

Development of Prototype for Ethernet port with ARM Cortex-M3 Processor for Web Application

Kavya M P

Dept of VSLI Design and ES VTU,Belagavi, India

Dr T C Thanuja

Dept of VSLI Design and ES VTU,Belagavi, India

Nishant G Angadi

Dept of VSLI Design and ES VTU,Belagavi, India

Abstract: ARM Cortex-M3 processor is used in the field of advanced micro-controllers applications. Developing device driver software and compatible hardware platform for peripheral devices with ARM Cortex-M3 processor is a challenging task. ARM processors have rich features, which are essential for processor to meet the performance parameters. LPC1768 is a 32-bit microcontroller that embeds ARM Cortex-M3 processor which is chosen for implementation. The paper describes about providing the Web access facility on the embedded board which can be extended to many applications that make use of Internet. The paper presents the software and hardware implementation of Ethernet port for web applications. Hardware design includes circuit design, placement and routing of circuit components on Printed Circuit Board (PCB). The PCB design rules are considered to achieve the design parameters. Orcad Release

    1. is used for circuit design and to generate Netlist. EDwinXp is the software tool used for PCB designing and generating Gerber files.

      Keywords: ARM Cortex-M3, Ethernet, MAC, CMSIS core, RMII and PCB.

      Ethernet is a part of computer networking technology, consists of group of computers which shares the information among them. Among the group of Computer systems, server system commands client systems[3]. As the technology progressed, there is a great demand to have Ethernet port on the embedded systems. Because of this added facility, it is possible to develop the new applications.

      For any communication system, the basic model for the communication layer is Open Source Interface (OSI) model where the Ethernet works in the Media Access Control (MAC) layer of Data Link layer. The Ethernet block of ARM Cortex-M3 (as shown in fig 1) contains featured 10Mbps or 100 Mbps Ethernet MAC designed to provide optimized performance through DMA hardware accelerator.

      I.INTRODUCTION

      Embedded Systems and Ethernet were existing in separate worlds over many years. Ethernet was available only for computers to provide Internet facility. As the technology is developed, the embedded systems require Internet facilities for Web/Online applications. To provide these facilities, the presence of Ethernet port on embedded system is essential which makes the embedded system more powerful.

      As microcontrollers are growing day by day, their performance is expected to increase. ARM (Advanced RISC Machine) processors are widely used low power microprocessors whose efficiency and performance is high compared to other processors [1]. They work on different low power techniques to achieve the low power consumption.

      ARM Cortex M3 is ARM family processor targeted at microcontroller applications. LPC1768 is an IC of ARM family which embeds Cortex M3 core inside. It has many extra features such as dedicated pins for Ethernet, USB and Serial Peripheral Interface (SPI) protocol. It has Ethernet MAC (Media Access Control) layer to communicate with Web Server. Ethernet block has dedicated registers and memory for programming purpose. [2]

      Fig 1: Ethernet block in Cortex M3

      Ethernet MAC layer of ARM Cortex M3 include a set of dedicated registers, half or full duplex operation, flow control, control frames, hardware acceleration for transmit retry, receive packet filtering and Wake-up on LAN activity. Ethernet block uses Reduced Media Independent Interface (RMII) protocol to interface with an off-chip Ethernet PHY and on chip Media Independent Interface Management (MIIM). Ethernet block is designed to provide optimized performance via DMA hardware acceleration.[4]

      The hardware part includes designing of PCB, manufacturing, component assembly and testing. PCB is the board where it embeds the components and metal traces. PCB rules are followed to avoid the crosstalk,

      Electro-Magnetic Interference (EMI) and other noises. The PCB design of Ethernet is accomplished along with the design parameters, as follows:

      • Distance between the Ethernet port and magnetic IC

      • Via in between the Ethernet port and magnetic IC

      • Trace width of power and signal line

      • Difference in the distance of transmit (TX) and receive (RX) traces.

        The section II presents the implementation part. The brief explanation is taken up in section III as software and hardware part. Section III deals with the results of the implementation and last section provides the conclusion.

        1. METHODOLOGY

          The development of device driver for Ethernet port for web applications and also hardware prototyping of the Ethernet module is accomplished. The fig 2 shows the block diagram of Ethernet with ARM Cortex-M3 processor.

          Fig 2: Block diagram of the system

          The system consists of ARM Controller (NXP LPC1768), Physical IC (Micrel KSZ8031rnl), and Ethernet jack (RJ- 45). ARM controller is used to process the data and it is made to act as mini Web Server. Physical IC is used to establish the communication between Ethernet port and ARM processor. Ethernet port is responsible for establishing connection with physical media. Hardware module also requires USB Type B jack and USB to UART converter to dump hex code on processor chip. After dumping the hex code, the ARM processor acts as a mini Web Server to establish communication between the RJ-45 and ARM Cortex-M3.

          The device driver is developed in LPCXpresso tool using Embedded C and converted it into hex format which is acceptable format of ARM processor. The hex file is flashed on the ARM processor through USB cable. The USB cable carries the parallel data but ARM processor accepts the data serially. Hence to convert the parallel data into serial data, USB to UART converter interfacing IC is placed between USB type B jack and ARM processor.

          Ethernet works on low level layer of TCP/IP model which is equivalent to data link and physical layers in OSI model. Data link layer is divided into media access controller (MAC) layer and logical link layer. Ethernet uses MAC layer for network communication. But in order to establish connection between MAC layer and physical interface, physical layer acts as intermediate layer. Here Ethernet block in ARM Cotex-M3 processor is analogous to MAC and Ethernet port to the physical interface. To establish the communication between Ethernet port and ARM controller, PHY chip is used as intermediate IC to provide the communication using Reduced Media Independent Interface (RMII). RMII is the interfacing that provides access to the registers of PHY IC. Here Microcontroller (LPC1768) acts as hub. To provide the physical connection between Microcontroller and PC, a physical medium is required. As per Ethernet standard, an Ethernet serial cable is chosen as a physical media. There are two types of cables, Straight-through and Crossover. The straight-through Ethernet serial cable is used to connect PC and Server and crossover cable is used to establish the communication between PC to PC. Hence straight-through cable is used to provide the communication between PC and microcontroller, which acts as a Web server.

          Both software and hardware development is based on the block diagram shown in the fig 3. The Cortex Microcontroller software interface standard (CMSIS) core available in the ARM library is used to develop the driver for Ethernet which is briefly explained in next section

          Once Software development is done, hardware platform is created to implement the software developed. Hence there is a need to design the PCB for Ethernet [5,6]. Aim of the paper is to provide web accessibility to ARM processor by providing Ethernet interface. The details of PCB design for Ethernet port is explained in next section along with the outputs of the PCB design.

        2. SOFTWARE AND HARDWARE DESIGN

          1. Software Development

            The device driver development for different peripheral device is made easier by ARM due to CMSIS core which includes set of Application Program Interfaces (APIs). The section also includes the description of HTML code used to create the Web page. The flow of the software programming is shown in figure 3.

            a) UART0 Initialization:

            LPC 1768 has four UART port, UART0 to UART4. By default, UART0 (port0) is chosen for the initialization to dump the hex code on the microcontroller core. UART0 have dedicated registers for enabling and disabling different functioning pins whose API is available in the library. Master clock (60MHz) is divided by the factor of (1/4) to clock the UART port. Power up the UART port by setting the power bit of UART0

            Fig 3: Main flow diagram

            in the (Power Configuration) PCON register of ARM processor. The Transmit and receive pins of UART0, pin 2 and 3 respectively, are enabled to transmit and receive the data.

            b).TCP lower level Initialization:

            To develop driver software for Ethernet port it is important to have the knowledge of register architecture of Ethernet block of ARM Cortex M3. Initialization of TCP/IP low layers is done to establishing communication between PC and Hub.

            c).To check the connection at the Ethernet port and to perform transmitting and receiving events

            After Ethernet MAC initialization, clear HTTP servers status flag (available in API) before checking the Ethernet port. Check the connection between Ethernet socket and ARM microcontroller for busy. If connection established, check for data availability and store it in the receive buffer. Then check for the availability of transmit buffer. The data to be transmitted is in the form of HTML code written in array format in header file and a pointer is pointed to the array. Then transmit the data present in buffer.

            To create Web page, HTML is used in the program. There are separate set of commands used to create text fonts, paragraphs, pictures and graphics. These commands are known as tags. The general format is as follows,[7,8,9]

            <tag name> write text </tag name>

          2. Hardware Development

          The device driver developed, virtually implements the Web accessibility of the system. But to have a real implementation , hardware (Printed Circuit Board- PCB) should be designed and driver code is implanted on the ARM processor. Fig 4 shows the arrangement of the components on the PCB board. ARM processor have a dedicated flash memory to store the driver of Ethernet. The data to be sent are stored in the TX buffers Register. The data here is HTML code which displays the Web page in Web browser.

          Fig 4: Block diagram of hardware design

          To transmit or receive the data, a interfacing IC i.e PHY IC (KSZ8031rnl) is used in between Ethernet connector and ARM processor. Auto-negotiation is an important event which establishes the communication between the PHY IC and the ARM processor. A Magnetic IC (A8245) is inserted in between the PHY IC and RJ-45 to provide the electrical isolation.

          PCB is the board that embeds the electronic circuit components and metal routings. Electronic components are connected mechanically using conductive tracks and pads. Routing on PCB can be done on Single side, Double Side or multi-layer. For simple circuits single or Double side routing is for low component density, but whereas for large component density multi-layer routing is preferred. Routing lines on different layers will be connected with Plated-Through holes called Vias.

          There are several basic steps involved in the Printed Circuit Board designing. The design flow is as shown in the fig 5. Initially designs start with hand drawn circuit diagrams. Then, using any electronic circuit design software, circuit is captured in schematic editor and netlist is created along with the bill of materials. Then importing the netlist into the layout editor, physical routing of the PCB is done according to the PCB design rules. Next, Gerber file is generated. This Gerber file is a format, used to drill, mill and cut the substrate board. Then components are placed and soldered to the substrate board. Finally, the board is tested for correct operation.

          Schematic capture (shown in fig 6) defines the all interconnections between the components, but this file cannot be directly given for fabrication. Fabrication requires exact footprint of the components, trace thickness, pad thickness and many more information. So Physical layout plays an important role in PCB designing. If the required component library is not available, one can create the part, symbol and package. These files can be made use while doing schematic and layout. EDwinXp is used to draw physical layout and component placement [10](fig 7).

          The routing is done for four layered PCB. They are component layer, power layer, ground layer and solder layer. For correct operation of the Ethernet, the parameters to be considered while drawing the traces are shown in the table 1

          Fig 5: PCB Design flow

          Fig 6: Schematic Capture in orcad

          Table 1: Design Parameters

          Fig 7: Placement and routing of the Ethernet circuit

          Fig 8: Snapshot of Execution of the driver code without error

          Fig 9: Netlist of Schematic

        3. RESULTS

          Device driver software for Ethernet is developed using the CMSIS core, which is available in the form of APIs in the library. The code is developed in LPCXpresso Integrated Development Environment (IDE) tool which helps to generate and download the application on the microcontroller. The driver code is tested for errors which are shown in fig 8.

          The outputs of the schematic capture are Netlist and bill of material shown in fig 9 and 10 respectively. These files are useful at the time of assembling the components on the bare PCB board.

          Parameters

          Maximum(mm)

          Pair Length Miss-macth

          >1.27

          Distance to other signal and

          ground

          >2.54

          Length between module and

          Magnetic

          100

          Length between RJ-45 and

          Magnetic module

          25

          Fig 10: Bill of material

          Fig 11: Gerber image of Component Layer

          Fig 12:3D board view

          The output result of the hardware design tool is the Gerber image of different layers. They are component mask, component layer, power layer, ground layer and solder mask. The Gerber image of component layer is shown in the fig 11. Likewise Gerber images are generated for all the layers of the PCB. The Fabrication of the PCB takes the Gerber file as input. The design parameters to be achieved for Ethernet PCB design is shown in table 2

          EdwinXP also have an unique feature of displaying the PCB board in 3 Dimensional view (shown in fig 12) which helps the user to visualize the hardware board so that he/she can take care of look of the board. The board can be viewed in 3600. The 3D trace view is as shown in the fig 13 which can be used to verify the short circuits in between the layers and routing in the different layers.

          Fig 13: 3D trace view

          Table 2: Achieved Design Parameters

          Parameters

          Maximum(mm)

          Achieved(mm)

          Pair Length Miss-macth

          >1.27

          20.7125

          Distance to other signal

          and ground

          >2.54

          Length between module

          and Magnetic

          100

          83.5788

          Length between RJ-45

          and Magnetic module

          25

          9.1979

          Fig 14: LPC1768 hardware board having facility of Ethernet, USB, SD card and other peripherals

          The paper presented is the part of the ARM embedded board. The design is made to fit in the ARM board which is designed by the company. The PCB board which have Ethernet facility is shown in the fig 14.The board consists of other facilities like USB interfacing and SD card interfacing. Code is transferred on the microcontroller board which acts as a mini Web server. The experimental setup is shown in the fig 15.

          After LAN settings, search engine is opened and IP address of the board is entered. Then the web page is displayed according to the HTML code as shown in the fig

          16. Hence board is verified for Web accessibility.

          Fig 15: Experimental Setup

          Fig 16: Snapshot of the web page

        4. CONCLUSION AND FUTURE SCOPE

Device driver for Ethernet port with ARM Cortex- M3 processor is developed using the dedicated pins present on LPC1768 MCU device which eliminates the use of separate MAC IC and also allows for easy interfacing. The device driver for Ethernet is developed using CMSIS core which includes APIs provided by ARM Company. Code is checked for syntax and fatal errors. To have a real implementation, hardware platform is designed i.e. PCB for Ethernet is developed. The basic design rules for PCB design are followed to avoid the EMI and crosstalk. The design parameters are met to achieve the Ethernet specification. The multilayer PCB is designed in order to avoid the complexity of the circuit.

The Gerber files are generated for each of the four layers which are shipped to the fabrication unit. The PCB is tested for continuity, short circuit and functionality i.e. Web access. There is no limit for the future scope. Since the main source of the information is Internet, the Ethernet design developed has many advantages which enables the embedded board to access the Internet. Further this facility can be extended to develop the different application based on Web access like Online monitoring and controlling the data.

REFERENCE

  1. S.M. ShamsheerDaula, Dr.K.ESreenivasa Murthy, G Amjad Khan,A Survey on Performance Improvement of Embedded systems designed using ARM family processors, International Journal of Engineering Research and Applications (IJERA) ISSN: 2248-9622, Vol. 2, Issue 1, Jan-Feb 2012, pp. 887-890.

  2. Cortex-M for Beginners ,An overview of the ARM Cortex-M processor family and comparison, ARM White paper. http://community.arm.com/docs/DOC-8587.

  3. NTT Communication, Evolution of Ethernet, White paper,June 2010.

    http://www.us.ntt.net/downloads/papers/VLink.pdf.

  4. UM10360,LPC176x/5x, User manual. http://www.nxp.com/documents/user_manual/UM10360.pdf

  5. Tan Yan and Martin D. F. Wong , Recent Research Development in PCB Layout.International Conference on Computer-Aided Design (ICCAD'10), November 7-11, 2010, San Jose, CA, USA, pp.398-403

  6. S Muralikrishna, S. Sathyamurthy, An Overview of Digital Circuit Design and PCB Design Guidelines – An EMC Perspective. 10th International Conference on Electromagnetic Interference & Compatibility, 2008. INCEMIC 2008, pp. 567-573.

  7. Anders Møller and Michael I. Schwartzbach, An Introduction to XML and Web Technologies,The HTTP Protocol, © 2006 Addison-Wesley.

    http://www.slidefinder.net/h/http/32566098.

  8. Windy Willard, A Beginners Guide HTML, fourth Edition. http://www.easons.com/p-1745596-html-a-beginners-guide-fifth- edition.aspx.

  9. Jeffrey C. Mogul, Clarifying the Fundamentals of HTTP.http://www2002.org/CDROM/refereed/444.pdf.

  10. PCB Layout for the Ethernet PHY Interface, Rabbit, Technical note.

  11. ARM®v7-M Architecture, Reference Manual

  12. Joseph Yiu, The Definitive guide to the ARM Cortex M3.

  13. LPCXpresso user Manual.

  14. Micrel, KSZ8031RNL/KSZ8021RNL, datasheet. [15] LPC1769/68/67/66/65/64/63, Product data sheet

Leave a Reply