AddThis Social Bookmark Button

03 The configuration


The choice of the IP address depends on the network in which the device is used, therefore it can be easily modified in the file StackTsk.h, changing the following define:

  // esempio: 10.0.0.6
#define MY_DEFAULT_IP_ADDR_BYTE1        (10)
#define MY_DEFAULT_IP_ADDR_BYTE2        (0)
#define MY_DEFAULT_IP_ADDR_BYTE3        (0)
#define MY_DEFAULT_IP_ADDR_BYTE4        (6)

In the same way, it is also possible to change theMAC address:

 // esempio: 00:04:A3:00:00:00
#define MY_DEFAULT_MAC_BYTE1            (0x00)
#define MY_DEFAULT_MAC_BYTE2            (0x04)
#define MY_DEFAULT_MAC_BYTE3            (0xA3)
#define MY_DEFAULT_MAC_BYTE4            (0x00)
#define MY_DEFAULT_MAC_BYTE5            (0x00)
#define MY_DEFAULT_MAC_BYTE6            (0x00)

The IP address can automatically be assigned by a DHCP server. To do that, uncomment the following line in file

//#define STACK_USE_DHCP

always in the StackTsk.h. file

In the example, the Ethernet module LEDs are used like generic LEDs; to make the configuration bit ETHLED is set to OFF; so, to restore the normal utilizing of these LED, modify the configuration to theON.

#pragma config XINST=OFF, WDT=OFF, FOSC2=ON, FOSC=HSPLL, ETHLED=ON

At this point is possible to recomplete the firmware and charge in the PIC.