CONFIG TCPIP

Top  Previous  Next

Action

Configures the TCP/IP W3100A chip.

 

 

Syntax

CONFIG TCPIP = int , MAC = mac , IP = ip, SUBMASK = mask, GATEWAY = gateway, LOCALPORT= port, TX= tx, RX= rx , NOINIT= 0|1 , TWI=address , Clock = speed [, baseaddress = address] [,TimeOut=tmOut]

 

 

Remarks

Int

The interrupt to use such as INT0 or INT1.

 

For the Easy TCP/IP PCB, use INT0.

MAC

The MAC address you want to assign to the W3100A.

 

The MAC address is a unique number that identifies your chip. You must use a different address for every W3100A chip in your network.

Example : 123.00.12.34.56.78

 

You need to specify 6 bytes that must be separated by dots. The bytes must be specified in decimal notation.

IP

The IP address you want to assign to the W3100A.

 

The IP address must be unique for every W3100A in your network. When you have a LAN, 192.168.0.10 can be used. 192.168.0.x is used for LAN’s since the address is not an assigned internet address.

SUBMASK

The submask you want to assign to the W3100A.

 

The submask is in most cases 255.255.255.0

GATEWAY

This is the gateway address of the W3100A.

 

The gateway address you can determine with the IPCONFIG command at the command prompt :

 

C:\>ipconfig

 

Windows 2000 IP Configuration

 

Ethernet adapter Local Area Connection 2:

 

Connection-specific DNS Suffix . :

IP Address. . . . . . . . . . . . : 192.168.0.3

Subnet Mask . . . . . . . . . . . : 255.255.255.0

Default Gateway . . . . . . . . . : 192.168.0.1

 

Use 192.168.0.1 in this case.

LOCALPORT

A word value that is assigned to the LOCAL_PORT internal variable. See also Getsocket.

 

As a default you can assign a value of 5000.

TX

A byte which specifies the transmit buffer size of the W3100A. The W3100A has 4 sockets.

 

A value of 00 will assign 1024 bytes, a value of 01 will assign 2048 bytes. A value of 10 will assign 4096 bytes and a value of 11 will assign 8192 bytes.

 

This is binary notation. And the Msbits specify the size of socket 3.

 

For example, you want to assign 2048 bytes to each socket for transmission : TX = &B01010101

 

Since the transmission buffer size may be 8KB in total, you can split them up in 4 parts of 2048 bytes : 01.

 

When you want to use 1 socket with 8KB size, you would use : TX = &B11. You can use only 1 socket in that case : socket 0.

RX

A byte which specifies the receive buffer size of the W3100A. The W3100A has 4 sockets.

 

A value of 00 will assign 1024 bytes, a value of 01 will assign 2048 bytes. A value of 10 will assign 4096 bytes and a value of 11 will assign 8192 bytes.

 

This is binary notation. And the Msbits specify the size of socket 3.

 

For example, you want to assign 2048 bytes to each socket for reception : RX = &B01010101

 

Since the receive buffer size may be 8KB in total, you can split them up in 4 parts of 2048 bytes : 01.

 

When you want to use 1 socket with 8KB size, you would use : RX = &B11. You can use only 1 socket in that case : socket 0.

 

Consult the W3100A pdf for more info.

Noinit

Make this 1 when you want to configure the TCP, MAC, Subnetmask and GateWay dynamic. Noinit will only make some important settings and you need to use SETTCP in order to finish the setup.

TWI

The slave address of the W3100A/NM7010. When you specify TWI, your micro must have a TWI interface such as Mega128, Mega88, Mega32.

Clock

The clock frequency to use with the TWI interface

Baseaddress

An optional value for the chip select of the W3100A. This is default &H8000 when not specified. When you create your own board, you can override it.

TimeOut

You can specify an optional timeout when sending UDP data. The Wiznet API does wait for the CSEND status. But it means that it will block your application. In such cases, you can use the timeout value. The timeout constant is a counter which decreases every time the status is checked. When it reaches 0, it will get out of the loop. Thus a higher value will result in a longer delay. Notice that it has nothing to do with the chip timeout registers/values. Without the software timeout, the chip will also time out.

 

The CONFIG TCPIP statement may be used only once.

Interrupts must be enabled before you use CONFIG TCPIP.

Configuring the W3100A will init the chip.

After the CONFIG TCPIP, you can already PING the chip!

 

The TWI mode works only when your micro support the TWI mode. You need to have 4k7 pull up resistors.

MCS Electronics has a small adapter PCB and KIT available that can be connected easily to your microprocessor.

The new TWI mode makes your PCB design much simpler. TWI is not as fast as bus mode. While you can use every  supported TCP/IP function, it will run at a lower speed.

 

 

See also

GETSOCKET , SOCKETCONNECT, SOCKETSTAT , TCPWRITE, TCPWRITESTR, TCPREAD, CLOSESOCKET , SOCKETLISTEN

 

 

Syntax Example

Config Tcpip = Int0 , Mac = 00.00.12.34.56.78 , Ip = 192.168.0.8 , Submask = 255.255.255.0 , Gateway = 192.168.0.1 , Localport = 1000 , Tx = $55 , Rx = $55

 

‘Now use PING at the command line to send a ping:

 

PING 192.168.0.8

 

Or use the easytcp application to ping the chip.