Connecting a PIC18F67J60 to a PC via Ethernet

Discussion in 'Embedded Systems and Microcontrollers' started by rhermes, Jul 2, 2009.

  1. rhermes

    Thread Starter New Member

    Jul 2, 2009
    3
    0
    Hello,

    I need to communicate via my PC with a PIC18F67J60 (which has embedded Ethernet). The PIC will send data to the PC (using TCP), the PC will process it and send it back.

    I found the Microchip TCP/IP stack v5.0 program but i was unsuccessful using it.

    Anyone has an idea how should I do it?
    I read the whole datasheet of the pic and many other papers, and tried several codes (C language) but with no success.

    thank you for your time.
     
  2. n9352527

    AAC Fanatic!

    Oct 14, 2005
    1,198
    4
    Unsuccessful how? You should elaborate more to allow others to see what's going on.
     
  3. rhermes

    Thread Starter New Member

    Jul 2, 2009
    3
    0
    unsuccessful in the meaning nothing was happening on the ethernet port. I used a packet sniffer and it didn't catch anything, the leds of the port were not blinking (they were off).

    If anybody is familiar with the microship's TCP/IP stack, here is the first code i tried which is an example taken from the documentation of the stack. All functions used comes predefined with the TCP/IP stack:

    #include<p18f67j60.h>


    #pragma config WDT = OFF
    #pragma config FOSC = HSPLL
    #pragma config DEBUG = OFF
    #pragma config XINST = OFF
    #pragma config ETHLED = ON


    // Declare this file as main application file
    #define THIS_IS_STACK_APPLICATION
    #include "StackTsk.h"
    #include "Tick.h"
    #include "dhcp.h"


    void main(void)
    {
    // Perform application specific initialization
    // Initialize Stack components.

    TickInit();
    StackInit();

    // Enter into infinite program loop
    while(1)
    {
    // Update tick count. Can be done via interrupt.
    TickUpdate();
    // Let Stack Manager perform its task.
    StackTask();

    StackApplication(); // test the connection by sending random packets.
    }
    }
     
  4. n9352527

    AAC Fanatic!

    Oct 14, 2005
    1,198
    4
    First you should check that the hardware is correct. Are you building your own hardware or using a ready-made dev board?
     
  5. rhermes

    Thread Starter New Member

    Jul 2, 2009
    3
    0
    I am using a ready-made dev board. It's the OLIMEX P67J60.
    And all the connection are good and as instructed
     
  6. AlexR

    Well-Known Member

    Jan 16, 2008
    735
    54
    The first question that springs to mind is how are you connecting to the PC. Are you going through a switch/hub or do you have a direct connection? If its a direct connection are you using a crossover cable?

    Next, are you configuring the IP address manually or through DHCP. If DHCP, then do you have a DHCP server and can it communicate with your PIC.

    Probable to get the board running you would be better off manually configure the IP address, network mask, gateway etc. That way you know what its address is and can do pings to see if its alive.
     
Loading...