Problem with serial ethernet board (using tcp library)

Beta Testing discussion on mikroC PRO for dsPIC30/33 and PIC24.
Post Reply
Author
Message
progman86di
Posts: 36
Joined: 16 Jan 2012 18:39

Problem with serial ethernet board (using tcp library)

#1 Post by progman86di » 29 Feb 2012 12:29

Hi, I've bought a serial ethernet board (ENC24J600) and I'm just trying for a simple ping.
I've connected it directly to a PC throught a cross cable with following paramethers:

PC
ip 192.168.1.2
mask 255.255.255.0

board
ip 192.168.1.1
mask 255.255.255.0

this is the simple ping program:

Code: Select all

sfr sbit Net_Ethernet_24j600_CS at LATF0_bit;
sfr sbit Net_Ethernet_24j600_CS_Direction at TRISF0_bit;

unsigned char myMACAddress[6] = {0x00, 0x16, 0x36, 0x9B, 0xBC, 0x21};
unsigned char myIPAddress[4] = {192, 168, 1, 1};

//timer interrupt, it works and increments seconds
//udp and tcp procedures, do nothing

void main() {     
     ADPCFG = 0xFFFF;
     
     //initialization
     initTimer();
     SPI1_Init();
     Net_Ethernet_24j600_Init(myMACAddress,myIPAddress,Net_Ethernet_24j600_AUTO_NEGOTIATION);
     Net_Ethernet_24j600_stackInitTCP();

     while(1){
              Net_Ethernet_24j600_doPacket();
     }

I then try to ping from PC to 192.168.1.1 (my board) and nothing happens...ping is not received and sent back..am I missing something?

progman86di
Posts: 36
Joined: 16 Jan 2012 18:39

Re: Problem with serial ethernet board (using tcp library)

#2 Post by progman86di » 29 Feb 2012 13:04

Got in the wrong section, could you please delete this?
Sorry!

User avatar
janko.kaljevic
Posts: 3565
Joined: 16 Jun 2011 13:48

Re: Problem with serial ethernet board (using tcp library)

#3 Post by janko.kaljevic » 01 Mar 2012 14:39

Hello,

Have you used timer interrupt to increment Net_Ethernet_24j600_UserTimerSec?

Please, where did you wanted to post this topic?

Best regards.

Post Reply

Return to “mikroC PRO for dsPIC30/33 and PIC24 Beta Testing”