The transplant of the UIP on Nios

Source: Internet
Author: User

Transplant environment: Cyclone IV Development Board, NIC chip for enc28j60, browser (firefox_24.0.0.5001a)

First, you need to understand the NIC Chip enc28j60, a Chinese version of the manual: Http:// 79r8johigayag9kx9-foyirh41jfsyrkxpidaw9xizdpjit5jbh8gjiobjcsiekhym-4tisqnxfd74e2tf1be2wxupuiews0rfrdiw9prks

ENC28J60 is not a standard Ethernet PHY, it uses the SPI protocol and supports only 10Mbps Ethernet speeds. First, build the Nios SOPC system such as:

System Clock 100MHz, the program runs in SDRAM, with ENC28J60 related hardware connection, LAN is actually an SPI, in addition there are lan_cs (chip selection), Lan_nint (Receive interrupt).

The clock is a timer and the timing period is 1ms.


Is the system's BDF schematic connection, the PLL provides the clock, the C0 is the system clock, the C1 is the SDRAM clock (with phase deflection-73 degrees)



After the system compiles, download the corresponding SOF file.

Second, we want to download uIP source code, the address is: Http://, now UIP is already part of Thingsqure (Contiki).

The UIP is ported below, and the Web_server program provided by the tester for UIP is in the uIP app folder. ENC28J60 drivers for enc28j60.c and Enc28j60.h


NIOS II mainly modifies these files

TAPDEV.C: Add the NIC driver, don't forget to initialize the MAC address (Tapdev_init function)

Uip-confi.h configuration of the UIP function (Enable # include "Webserver.h")

CLOCK_ARCH.C has a UIP system time function, global variable G_runtime management system time

A timer is opened below to time the g_rumtime.


After compiling the program, run as Nios II hardware

After the program runs, use the Grab Kit tool (Wireshark) Netanalyzer to view the packet.

TCP Three-time handshake, the connection request is as follows:



The program is:

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.