ethernet: it pings at least

This commit is contained in:
Vince Weaver 2016-11-23 16:33:28 -05:00
parent 1004701ad5
commit 794e8bb654
2 changed files with 62 additions and 0 deletions

23
ethernet/setup.bas Normal file
View File

@ -0,0 +1,23 @@
1 REM *** Setup UTHERNET II - W5100
2 REM *** Assumes slot 5 ($C0D0)
10 REM *** Init W5100
12 POKE 49364,128 : REM RESET W5100
14 POKE 49364,3 : REM AUTOINCREMENT
20 REM *** Setup MAC Address
21 REM *** 41:50:50:4c:45:32
22 POKE 49365,0:POKE 49366,9
23 POKE 49367,65
23 POKE 49367,80
23 POKE 49367,80
23 POKE 49367,76
23 POKE 49367,69
23 POKE 49367,50
30 REM *** Setup IP Address
31 REM *** 192.168.8.15
32 POKE 49366,15
33 POKE 43367,192
34 POKE 43367,168
35 POKE 43367,8
36 POKE 43367,15
40 PRINT "UTHERNET II READY: 192.168.8.15"

39
ethernet/webserver.bas Normal file
View File

@ -0,0 +1,39 @@
1 REM *** Setup UTHERNET II - W5100
2 REM *** Assumes slot 5 ($C0D0)
10 REM *** Init W5100
12 POKE 49364,128 : REM RESET W5100
14 POKE 49364,3 : REM AUTOINCREMENT
20 REM *** Setup MAC Address
21 REM *** 41:50:50:4c:45:32
22 POKE 49365,0:POKE 49366,9
23 POKE 49367,65
23 POKE 49367,80
23 POKE 49367,80
23 POKE 49367,76
23 POKE 49367,69
23 POKE 49367,50
30 REM *** Setup IP Address
31 REM *** 192.168.8.15
32 POKE 49366,15
33 POKE 43367,192
34 POKE 43367,168
35 POKE 43367,8
36 POKE 43367,15
40 PRINT "UTHERNET II READY: 192.168.8.15"
100 *** Setup Socket
105 POKE 43365,0:POKE 43366,26: REM RX MEMSIZE
110 POKE 43367,3: REM 8kB RX buffer
115 POKE 43367,3: REM 8kB TX buffer
START:
/* sets TCP mode */
Sn_MR = 0x01;
/* sets source port number */
Sn_PORT = source_port;
/* sets OPEN command */
Sn_CR = OPEN;
if (Sn_SR != SOCK_INIT) Sn_CR = CLOSE; goto START;
}
{
If (Sn_SR == SOCK_ESTABLISHED) goto ESTABLISHED stage;