Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

PIC TCPIP stack problem

Status
Not open for further replies.

stoyanoff

Full Member level 4
Joined
Aug 10, 2011
Messages
195
Helped
8
Reputation
16
Reaction score
8
Trophy points
1,298
Activity points
2,725
I`m using 18F66J60. Here is my header for the tcpip stack adjustments:
Code:
#if STACK_USE_CCS_PICENS
 #define STACK_USE_MCPENC 1
#endif

#if STACK_USE_CCS_PICEEC
 #define STACK_USE_MCPINC 1
#endif


 #include <18F66J60.h>
 #fuses NOWDT, NODEBUG,HS, NOIESO, NOFCMEN, PRIMARY
 #use delay(clock=25M)



#use rs232(baud=9600, xmit=PIN_C6, rcv=PIN_C7)

#include "tcpip/stacktsk.c"    //include Microchip TCP/IP Stack


#if STACK_USE_CCS_PICEEC
 #include "tcpip/elcd.c"
 #define BUTTON1_PRESSED()  (!input(PIN_A4))
 #define USER_LED1    PIN_A0
 #define USER_LED2    PIN_A1
 #define USER_LED3    PIN_A2
 #define LED_ON       output_low
 #define LED_OFF      output_high
 #define STANDARD_ADC_STRING  "AN2"
 #define STANDARD_ADC_CHANNEL 2
 void init_user_io(void) {
 //  setup_adc(ADC_CLOCK_INTERNAL);
   //setup_adc_ports(AN0_TO_AN2);
 //  set_adc_channel(2);
   *0xF92=*0xF92 & 0x00;   //a0 and a1 output
  // *0xF93=*0xF93 & 0xC7;   //b3, b4 and b5 output
  LED_OFF(USER_LED1);
  LED_OFF(USER_LED2);
  LED_OFF(USER_LED3);
   //set_adc_channel(2);
 }


void MACAddrInit(void) {
   MY_MAC_BYTE1=0;
   MY_MAC_BYTE2=2;
   MY_MAC_BYTE3=3;
   MY_MAC_BYTE4=4;
   MY_MAC_BYTE5=5;
   MY_MAC_BYTE6=6;
}

void IPAddrInit(void) {
   //IP address of this unit
   MY_IP_BYTE1=192;
   MY_IP_BYTE2=168;
   MY_IP_BYTE3=0;
   MY_IP_BYTE4=7;

   //network gateway
   MY_GATE_BYTE1=192;
   MY_GATE_BYTE2=168;
   MY_GATE_BYTE3=0;
   MY_GATE_BYTE4=1;

   //subnet mask
   MY_MASK_BYTE1=255;
   MY_MASK_BYTE2=255;
   MY_MASK_BYTE3=255;
   MY_MASK_BYTE4=0;
}

char ExampleIPDatagram[] = {
   0x45, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00,
   0x64, 0x11, 0x2A, 0x9D, 0x0A, 0x0B, 0x0C, 0x0D,
   0x0A, 0x0B, 0x0C, 0x0E
};

char ExampleUDPPacket[] = {
   0x04, 0x00, 0x04, 0x01, 0x00, 0x08, 0x00, 0x00,
   0x01, 0x02, 0x03, 0x04
};
The complier compiles it. So I don`t know where is the problem. In my code or in the hardware. Here is a simple chart of my hardware. I`m using a RJ connector with integrated internet transformer. I`m uploading it`s pdf.
Can someone give me an advice where to look for the mistake??
Thanks!View attachment TS8P8C-PCB-ETH TRAF.pdfView attachment chart.pdf
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top