【科研论文】基于FPGA和W5100的以太网通信系统设计

摘要:

给出了一种基于以太网和单向光纤的数据通信实现方法.结合特定需求,利用W5100和Xilinx公司的Virtex5系列FPGA(现场可编程门阵列)实现了PC机到远端PC机的光纤以太网数据通信.说明了以太网接口和光模块接口的具体设计方法和实现过程.给出了测试结果,并且使用VC++编写的服务器进行数据包的收发验证,实时视频传输和播放证明了系统的可行性和正确性.

 

作者:梁中英,苏涛,武荣伟,郭文伟

单位:西安电子科技大学雷达信号处理重点实验室

链接:http://d.wanfangdata.com.cn/Periodical_txjs201011035.aspx

注:来自万方数据知识服务平台

 

感谢您的关注! 

更多WIZnet信息请登录:WIZnet官方主页:        http://www.iwiznet.cn/ 

                                          WIZnet企业官方微博:http://e.weibo.com/wiznet2012
w5100驱动程序。 /* * (c)COPYRIGHT * ALL RIGHT RESERVED * * FileName : main.c * Brief : source codes for W5100E01-AVR * This code is optimized at AVR-GCC 4.3.2(20081118). * Revision History : * ---------- ------- ------------------------------------------------ * Date version Description * ---------- ------- ------------------------------------------------ * 03/28/2007 1.0.0.0 Release version * ---------- ------- ------------------------------------------------ * 01/08/2008 1.1.0.0 Check if W5100 register and EEPROM are the same value * before displaying network information. Changed W5100 Driver(v1.2). Removed WinAVR-20050214 codes(UART). Changed check_leaseIP() function in DHCP.C. * ---------- ------- ------------------------------------------------ * 11/21/2008 1.2.0.0 optimized at Compiler WinAVR 20081118rc2 version Changed wait_1us() function delay.c Changed lcd_ready() function in lcd.c * ---------- ------- ------------------------------------------------ */ #include <string.h> #include "../util/myprintf.h" #include "../mcu/types.h" #include "../mcu/timer.h" #include "../mcu/delay.h" #include "../mcu/serial.h" #include "../iinchip/socket.h" #include "../iinchip/w5100.h" //for debug 2008.02.20 #include "../evb/lcd.h" #include "../evb/evb.h" #include "../evb/manage.h" #include "../evb/channel.h" #include "../evb/config.h" #include "../inet/dhcp.h" #include "../app/webserver.h" #include "../app/loopback.h" #include "../app/ping_app.h" extern CHANNELHANDLER ChannelHandler[MAX_SOCK_NUM]; extern NETCONF NetConf; extern CHCONF ChConf; extern u_char SRC_MAC_ADDR[6]; /**< Source MAC Address */ extern u_char GET_SN_MASK[4]; /**< Subnet mask received from the DHCP server */ extern u_char GET_GW_IP[4]; /**< Gateway IP address received from the DHCP server */ extern u_char GET_DNS_IP[4]; /**< DNS server IP address received from the DHCP server */ extern u_char GET_SIP[4]; /**< Leased source IP address received from the DHCP server */ extern char uart0_getchar(FILE *f); /** @mainpage W5100 Firmware Source @section intro Introduction - Introduction : @section CREATEINFO Author - author : wiznet co. - Released date : 2006.12.20 - Last Updated date : 2008. 11. 21 */ int main(void) { u_char key; SOCKET i; evb_init(); check_manage(); /* administration mode check */ init_timer(); for (i = 0; i < MAX_SOCK_NUM; i++) { switch(ChConf.ch[i].type) { case NOTUSE: unregister_channel_handler(i); break; case DHCP_CLIENT: PRINTLN1("%d : DHCP Client Start.",i); evb_set_lcd_text(0,(u_char*)"< DHCP CLIENT >"); evb_set_lcd_text(1,(u_char*)" Wait a minute "); get_netconf(&NetConf); memcpy(SRC_MAC_ADDR,NetConf.mac,6); init_dhcp_client(i, evb_soft_reset,evb_soft_reset); if(!getIP_DHCPS()) { evb_set_lcd_text(1,(u_char*)" Fail to get IP "); PRINTLN("Fail to get a IP adress from DHCP server"); PRINTLN("Apply the default network information!!!"); ChConf.ch[i].type = NOTUSE; // Disable DHCPC; unregister_channel_handler(i); wait_10ms(100); } else { NetConf.sip = *((u_long*)GET_SIP); NetConf.gwip = *((u_long*)GET_GW_IP); NetConf.sn = *((u_long*)GET_SN_MASK); NetConf.dns = *((u_long*)GET_DNS_IP); PRINTLN("Get network information from DHCP Server..."); register_channel_handler(i,check_DHCP_state); } set_netconf(&NetConf); break; case LB_TCPS: register_channel_handler(i,loopback_tcps); break; case LB_TCPC: register_channel_handler(i,loopback_tcpc); break; case LB_UDP: register_channel_handler(i,loopback_udp); break; case WEB_SERVER: register_channel_handler(i,web_server); break; } } net_init(); evb_logo(); while (1) { for (i = 0 ; i < MAX_SOCK_NUM ; i++ ) if(ChannelHandler[i].Handler) (*ChannelHandler[i].Handler)(i); //for ISR test if(uart_keyhit(0)) { key = uart0_getchar(NULL); if(key == 'c') { for(i=0;i<4;i++) IINCHIP_WRITE(Sn_IR(i), 0xFF); IINCHIP_WRITE(IR, 0xFF); PRINTLN("all interrupt register cleared!!!!"); } } } }
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值