WIZnet W5300 driver sample for Altera NiosII
The files under this folder are driver sample code for WIZnet W3500 TCP processor. The code is copied from the original driver sample provided by WIZnet, simpli
- HW spec
- Altera DE0
- wiz830mj (w5300)
Use altera DE0 with wiz830mj
control w5300 with avalon MM slave translator
function mapping
nios2e u0 (
.clk_clk (CLK),
.reset_reset_n (RST_N),
.wiz0_address (WIZ_A),
.wiz0_write (wiz_wr),
.wiz0_read (wiz_rd),
.wiz0_readdata (wiz_readdata),
.wiz0_writedata (wiz_writedata),
.wiz0_chipselect (wiz_cs),
.wiz0_byteenable (wiz_byteenable)
);
wire [15:0] wiz_readdata;
wire [15:0] wiz_writedata;
wire [1:0] wiz_byteenable;
wire wiz_cs, wiz_wr, wiz_rd;
assign WIZ_CS_N = !wiz_cs;
assign WIZ_WR_N = !(wiz_wr && wiz_byteenable[0] && wiz_byteenable[1]);
assign WIZ_RD_N = !(wiz_rd && wiz_byteenable[0] && wiz_byteenable[1]);
assign WIZ_D = (!WIZ_CS_N && !WIZ_WR_N) ? wiz_writedata : 15'bz;
assign wiz_readdata = (!WIZ_CS_N && !WIZ_RD_N) ? WIZ_D : 15'b0;
set w5300
setSIPR({ 192, 168, 1, 250 }); // set source IP address
setGAR({ 192, 168, 1, 1 }); // set gateway IP address
setSUBR({ 255, 255, 255, 0 }); // set subnet mask address
setSHAR({ 0x00, 0x08, 0xDC, 0x00, 111, 200 }); // set source hardware address
...
loopback_tcps(0, 5000, data_buf, 0);