Problem with enc28j60

Hi.

I can’t connect to ethernet modele’s ip adress. I connected directly to pc with a crossover cable.

Pinging 192.168.1.200 with 32 bytes of data:
Reply from 192.168.0.102: Destination host unreachable.
Reply from 192.168.0.102: Destination host unreachable.
Reply from 192.168.0.102: Destination host unreachable.
Reply from 192.168.0.102: Destination host unreachable.

Ping statistics for 192.168.1.200:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss)<

If i use arp -a command, i can’t find the ip adress.

// Present a "Will be back soon web page", as stand-in webserver.
// 2011-01-30 <jc@wippler.nl> http://opensource.org/licenses/mit-license.php
 
#include <EtherCard.h>

#define STATIC 0  // set to 1 to disable DHCP (adjust myip/gwip values below)

#if STATIC
// ethernet interface ip address
static byte myip[] = { 192,168,1,200 };
// gateway ip address
static byte gwip[] = { 192,168,1,1 };
#endif

// ethernet mac address - must be unique on your network
static byte mymac[] = { 0x74,0x69,0x69,0x2D,0x30,0x31 };

byte Ethernet::buffer[500]; // tcp/ip send and receive buffer

const char page[] PROGMEM =
"HTTP/1.0 503 Service Unavailable\r\n"
"Content-Type: text/html\r\n"
"Retry-After: 600\r\n"
"\r\n"
"<html>"
  "<head><title>"
    "Service Temporarily Unavailable"
  "</title></head>"
  "<body>"
    "<h3>This service is currently unavailable</h3>"
    "<p><em>"
      "The main server is currently off-line.
"
      "Please try again later."
    "</em></p>"
  "</body>"
"</html>"
;

void setup(){
  Serial.begin(57600);
  Serial.println("\n[backSoon]");
  
  if (ether.begin(sizeof Ethernet::buffer, mymac) == 0) 
    Serial.println( "Failed to access Ethernet controller");
#if STATIC
  ether.staticSetup(myip, gwip);
#else
  if (!ether.dhcpSetup())
    Serial.println("DHCP failed");
#endif

  ether.printIp("IP:  ", ether.myip);
  ether.printIp("GW:  ", ether.gwip);  
  ether.printIp("DNS: ", ether.dnsip);  
}

void loop(){
  // wait for an incoming TCP packet, but ignore its contents
  if (ether.packetLoop(ether.packetReceive())) {
    memcpy_P(ether.tcpOffset(), page, sizeof page);
    ether.httpServerReply(sizeof page - 1);
  }
}

The default gateway on your PC must be the address of your Arduino Ethernet shield, if you
don't have any router involved.
IO assume the IP address of tour PC is 192.168.0.102
You have to check your subnetmask too. if it is 255.255.255.0 you have to change the
IP address of the Arduino to 192.168.0.200.
With subnet mask 255.255.255.0 the adresses 192.168.0.xxx and 192.168.1.xxx will
be on two different nets.

Regs
ffur

More : When no router involved, your Arduino Gateway statement must point to your PC.
So Arduino Gateway points to PC's IP address, and PC's Gateway points to Arduino's IP address.
All this is only without router. With router all gateways must point to the router.

Regs
ffur