Altera Home Page
文档资料 许可
在线购买 下载

  主页   |   产品   |   支持   |   最终市场   |   技术中心   |   教育与活动   |   公司介绍   |   在线购买  
  mySupport   |   器件   |   软件   |   IP   |   设计范例   |   参考设计  

 产品
      MAX/MAX II
      Stratix/Stratix GX
      Nios II
  
 功能
      算法
      存储器
      总线及I/O
      逻辑
      接口与外设
      DSP
      通信
      PLL & Clocking
  
 设计输入方法
      Quartus II软件工程
      Tcl
      VHDL
      Verilog HDL
      C Code 范例
      DSP Builder
      TimeQuest
   片内调试
  
 仿真工具
      Mentor Graphics ModelSim
      Cadence NCsim
      Synopsys VCS
  
 旧范例
      图形编辑器
      AHDL
  

Network Time Protocol Client Design Example

The network time protocol (NTP) client design example demonstrates a user datagram protocol (UDP) client using the industry-standard sockets interface to transmission control protocol/Internet protocol (TCP/IP). This is a minimal implementation of a simple network time protocol (SNTP) client (RFC 2030). This design example serves as a good starting point for Lightweight IP (LWIP) designs running on Nios® II processors.

The design example displays the current UTC time on the LCD display. On startup, the LCD displays the epoch time. Once the current time is acquired, the system time is set, and the current time is displayed on the LCD. Periodically, the client sends another request to the NTP server for the current time.

Using This Design Example

Ensure that you have installed a Nios II development kit. Download the NTP Client design example and unzip the files into a directory under <Nios II kit path>/examples/software (for example, <Nios II kit path>/examples/software/ntp_client). If installed in this directory, the design example is available as a Nios II integrated development environment (IDE) project template. The NTP client design example includes the project settings required to run this design example on the supported target hardware configuration. To use the NTP client design example, simply create a new C/C++ application project in the IDE and choose the desired project template.

The use of this design is governed by, and subject to, the terms and conditions of the Altera Hardware Reference Design License Agreement.

Hardware Requirements

The NTP client design example requires the following devices to be present in the target hardware design:

  • JTAG UART
  • Timer
  • LCD character display

You can run the NTP client design example on the following Nios II hardware design examples:

  • Stratix® design examples
    • Standard
    • Full-featured
  • Cyclone® design examples
    • Standard
    • Full-featured

Host Machine Requirements

The Nios II development board used to run this design must have access to an NTP server. The NTP server can be a server on a network, or it can be connected directly to a host machine running NTP server software via a crossover cable. The NTP server must be on the same subnet as the Nios II development board. If there is no NTP server on the network, or a direct connection is being made, there is a freeware version of an NTP software package located here: http://sourceforge.net/projects/nettime or http://www.ntp.org/links.html.

The NTP client attempts to use DHCP to acquire an IP address. If there is no DHCP server on the network or a direct connection is being used, then the static IP address, gateway,and subnetmask must be set in user.h and recompiled.

Design Examples Disclaimer

These design examples may only be used within Altera Corporation devices and remain the property of Altera. They are being provided on an “as-is” basis and as an accommodation; therefore, all warranties, representations, or guarantees of any kind (whether express, implied, or statutory) including, without limitation, warranties of merchantability, non-infringement, or fitness for a particular purpose, are specifically disclaimed. Altera expressly does not recommend, suggest, or require that these examples be used in combination with any other product not provided by Altera.

 
Nios II Literature

Nios II IDE Tutorial

  请填写反馈意见