Pic Ethernet. Anyone could provide info?

Thread Starter

TCOP

Joined Apr 27, 2011
94
Hello everyone,
I am just trying to dig into the pic ethernet area. I have some very basic understanding of ENC28J60 ethernet controller and I've read AN833 (The Microchip TCP/IP Stack). I've downloaded the legacy MLA files from microchip (TCP/IP stack v5.42.08) and started trying a few things. I am using MPLAB 8.86 and Hitech C 18.
Till now...only frustration.
I really can't even compile the Demo App, I'm struglling to find the way out, hopefully today and I can't find any tutorial on the net regarding PIC ethernet. On the other hand, I can find a lot of material for arduino and this time, it is a little tempting to switch to AVR (please don't let me)
My goal for now is just to blink a led through http.
I really need some guidance so If anyone has experience on the PIC ethernet , please help me out.
 

Thread Starter

TCOP

Joined Apr 27, 2011
94
I've been struggling all day to get the demo app to compile. I only get errors. Has anyone tried it before? Any help please will be welcomed
 

Thread Starter

TCOP

Joined Apr 27, 2011
94
No progress till now
I've download TCPIP stack 2.2 and tried again. This is what I get:

Executing: "C:\Program Files\HI-TECH Software\PICC-18\9.80\bin\mcc18.exe" -p=18F452 /i"C:\MCHPStack2.20" -I"C:\MCHPStack2.20\Source" "xeeprom.c" -fo="xeeprom.o" -D__DEBUG -Ou- -Ot- -Ob- -Op- -Or- -Od- -Opa-
"C:\Program Files\HI-TECH Software\PICC-18\9.80\bin\picc18" --cmode=c18 -q --asmlist --pass1 -I. --chip=18F452 -IC:\MCHPStack2.20 -IC:\MCHPStack2.20\Source xeeprom.c -Oxeeprom.o -D__DEBUG
xeeprom.c:
51: #define StartI2C() SSPCON2_SEN=1
^ (111) redefining preprocessor macro "StartI2C" (C:\Program Files\HI-TECH Software\PICC-18\9.80\include\plib/i2c.h: 821) (warning)
52: #define RestartI2C() SSPCON2_RSEN=1
^ (111) redefining preprocessor macro "RestartI2C" (C:\Program Files\HI-TECH Software\PICC-18\9.80\include\plib/i2c.h: 835) (warning)
53: #define StopI2C() SSPCON2_PEN=1
^ (111) redefining preprocessor macro "StopI2C" (C:\Program Files\HI-TECH Software\PICC-18\9.80\include\plib/i2c.h: 807) (warning)
54: #define NotAckI2C() SSPCON2_ACKDT=1, SSPCON2_ACKEN=1
^ (111) redefining preprocessor macro "NotAckI2C" (C:\Program Files\HI-TECH Software\PICC-18\9.80\include\plib/i2c.h: 850) (warning)
78: #define MASTER 8 /* I2C Master mode */
^ (111) redefining preprocessor macro "MASTER" (C:\Program Files\HI-TECH Software\PICC-18\9.80\include\plib/i2c.h: 38) (warning)
80: #define SLEW_OFF 0xC0 /* Slew rate disabled for 100kHz mode */
^ (111) redefining preprocessor macro "SLEW_OFF" (C:\Program Files\HI-TECH Software\PICC-18\9.80\include\plib/i2c.h: 44) (warning)
81: #define SLEW_ON 0x00 /* Slew rate enabled for 400kHz mode */
^ (111) redefining preprocessor macro "SLEW_ON" (C:\Program Files\HI-TECH Software\PICC-18\9.80\include\plib/i2c.h: 45) (warning)
83: SCK, SDO, SDI */
^ (111) redefining preprocessor macro "SSPENB" (C:\Program Files\HI-TECH Software\PICC-18\9.80\include\plib\spi.h: 63) (warning)
xeeprom.c:
56: static unsigned char ReadI2C( void );
^ (367) identifier is already extern; can't be static (warning)
57: static unsigned char WriteI2C( unsigned char data_out );
(367) identifier is already extern; can't be static ^ (warning)
460: {
^ (367) identifier is already extern; can't be static (warning)
480: {
^ (367) identifier is already extern; can't be static (warning)
Executing: "C:\Program Files\HI-TECH Software\PICC-18\9.80\bin\mcc18.exe" -p=18F452 /i"C:\MCHPStack2.20" -I"C:\MCHPStack2.20\Source" "xlcd.c" -fo="xlcd.o" -D__DEBUG -Ou- -Ot- -Ob- -Op- -Or- -Od- -Opa-
"C:\Program Files\HI-TECH Software\PICC-18\9.80\bin\picc18" --cmode=c18 -q --asmlist --pass1 -I. --chip=18F452 -IC:\MCHPStack2.20 -IC:\MCHPStack2.20\Source xlcd.c -Oxlcd.o -D__DEBUG
Executing: "C:\Program Files\HI-TECH Software\PICC-18\9.80\bin\mcc18.exe" -p=18F452 /i"C:\MCHPStack2.20" -I"C:\MCHPStack2.20\Source" "arp.c" -fo="arp.o" -D__DEBUG -Ou- -Ot- -Ob- -Op- -Or- -Od- -Opa-
"C:\Program Files\HI-TECH Software\PICC-18\9.80\bin\picc18" --cmode=c18 -q --asmlist --pass1 -I. --chip=18F452 -IC:\MCHPStack2.20 -IC:\MCHPStack2.20\Source arp.c -Oarp.o -D__DEBUG
Executing: "C:\Program Files\HI-TECH Software\PICC-18\9.80\bin\mcc18.exe" -p=18F452 /i"C:\MCHPStack2.20" -I"C:\MCHPStack2.20\Source" "ARPTsk.c" -fo="ARPTsk.o" -D__DEBUG -Ou- -Ot- -Ob- -Op- -Or- -Od- -Opa-
"C:\Program Files\HI-TECH Software\PICC-18\9.80\bin\picc18" --cmode=c18 -q --asmlist --pass1 -I. --chip=18F452 -IC:\MCHPStack2.20 -IC:\MCHPStack2.20\Source ARPTsk.c -OARPTsk.o -D__DEBUG
Executing: "C:\Program Files\Microchip\MPASM Suite\MPASMWIN.exe" /q /p18F452 "C18Cfg.asm" /l"C18Cfg.lst" /e"C18Cfg.err" /o"C18Cfg.o" /d__DEBUG=1
Warning[230] C:\MCHPSTACK2.20\SOURCE\C18CFG.ASM 83 : __CONFIG has been deprecated for PIC18 devices. Use directive CONFIG.
Warning[230] C:\MCHPSTACK2.20\SOURCE\C18CFG.ASM 84 : __CONFIG has been deprecated for PIC18 devices. Use directive CONFIG.
Warning[230] C:\MCHPSTACK2.20\SOURCE\C18CFG.ASM 85 : __CONFIG has been deprecated for PIC18 devices. Use directive CONFIG.
Warning[230] C:\MCHPSTACK2.20\SOURCE\C18CFG.ASM 86 : __CONFIG has been deprecated for PIC18 devices. Use directive CONFIG.
Executing: "C:\Program Files\HI-TECH Software\PICC-18\9.80\bin\mcc18.exe" -p=18F452 /i"C:\MCHPStack2.20" -I"C:\MCHPStack2.20\Source" "delay.c" -fo="delay.o" -D__DEBUG -Ou- -Ot- -Ob- -Op- -Or- -Od- -Opa-
"C:\Program Files\HI-TECH Software\PICC-18\9.80\bin\picc18" --cmode=c18 -q --asmlist --pass1 -I. --chip=18F452 -IC:\MCHPStack2.20 -IC:\MCHPStack2.20\Source delay.c -Odelay.o -D__DEBUG
Executing: "C:\Program Files\HI-TECH Software\PICC-18\9.80\bin\mcc18.exe" -p=18F452 /i"C:\MCHPStack2.20" -I"C:\MCHPStack2.20\Source" "DemoSNMPAgent.c" -fo="DemoSNMPAgent.o" -D__DEBUG -Ou- -Ot- -Ob- -Op- -Or- -Od- -Opa-
"C:\Program Files\HI-TECH Software\PICC-18\9.80\bin\picc18" --cmode=c18 -q --asmlist --pass1 -I. --chip=18F452 -IC:\MCHPStack2.20 -IC:\MCHPStack2.20\Source DemoSNMPAgent.c -ODemoSNMPAgent.o -D__DEBUG
DemoSNMPAgent.c: main()
295: XLCDGoto(1, 0);
^ (361) function declared implicit int (warning)
296: XLCDPutROMString(SetupMsg);
^ (361) function declared implicit int (warning)
388: XLCDPut(myDHCPBindCount + '0');
^ (361) function declared implicit int (warning)
DemoSNMPAgent.c: SNMPSetVar()
558: XLCDPutString(LCDDisplayString);
^ (361) function declared implicit int (warning)
DemoSNMPAgent.c: DisplayIPValue()
715: itoa(IPVal->v[0], IPDigit);
^ (357) illegal conversion of integer to pointer (warning)
^ (358) illegal conversion of pointer to integer (warning)
^ (187) too few function arguments
727: itoa(IPVal->v[1], IPDigit);
^ (357) illegal conversion of integer to pointer (warning)
^ (358) illegal conversion of pointer to integer (warning)
^ (187) too few function arguments
739: itoa(IPVal->v[2], IPDigit);
^ (357) illegal conversion of integer to pointer (warning)
^ (358) illegal conversion of pointer to integer (warning)
^ (187) too few function arguments
751: itoa(IPVal->v[3], IPDigit);
^ (357) illegal conversion of integer to pointer (warning)
^ (358) illegal conversion of pointer to integer (warning)
^ (187) too few function arguments
DemoSNMPAgent.c: InitializeBoard()
909: XLCDInit();
^ (361) function declared implicit int (warning)
DemoSNMPAgent.c:
1048: "\r\nSerial Number (",
^ (359) illegal conversion between pointer types (warning)
pointer to const char -> pointer to rom char
1049: "\r\nDefault IP Address (",
^ (359) illegal conversion between pointer types (warning)
pointer to const char -> pointer to rom char
1050: "\r\nDefault Gateway Address (",
^ (359) illegal conversion between pointer types (warning)
pointer to const char -> pointer to rom char
1051: "\r\nDefault Subnet Mask (",
^ (359) illegal conversion between pointer types (warning)
pointer to const char -> pointer to rom char
1052: "\r\nDHCP & IP Gleaning enabled.\r\n",
^ (359) illegal conversion between pointer types (warning)
pointer to const char -> pointer to rom char
1053: "\r\nDHCP & IP Gleaning disabled.\r\n",
^ (359) illegal conversion between pointer types (warning)
pointer to const char -> pointer to rom char
1054: "\r\nReady to download MPFS image - Use Xmodem protocol.\r\n",
(359) illegal conversion between pointer types ^ (warning)
pointer to const char -> pointer to rom char
1056: };
^ (359) illegal conversion between pointer types (warning)
pointer to const char -> pointer to rom char
DemoSNMPAgent.c: ExecuteMenuChoice()
1152: itoa(AppConfig.SerialNumber.Val, response);
^ (357) illegal conversion of integer to pointer (warning)
^ (358) illegal conversion of pointer to integer (warning)
(187) too few function arguments ^
(908) exit status = 1
(908) exit status = 1
Halting build on first failure as requested.
----------------------------------------------------------------------
Debug build of project `C:\MCHPStack2.20\Source\DemoSNMPAgent.mcp' failed.
Language tool versions: MPASMWIN.exe v5.46, mplink.exe v9.80, mcc18.exe v9.80, mplib.exe v9.80
Preprocessor symbol `__DEBUG' is defined.
Sat Jan 17 21:07:33 2015
----------------------------------------------------------------------
BUILD FAILED
 

Thread Starter

TCOP

Joined Apr 27, 2011
94
Grrrrrr.......
After spending two days just trying to figure out the problem, guess what, I didn't....
I managed to get things to work by downloading the TCP/IP Stack v4.02 and with language tool versions: MPASMWIN.exe v5.46, mplink.exe v4.45, mcc18.exe v3.44, mplib.exe v4.45, everything worked.
I did nothing fancy this time. Just fixed the include paths and when I pressed ctr+F10, everything compiled properly.
I don't know what to say....
At least it works now!
 

Brownout

Joined Jan 10, 2012
2,390
Looks like the original problem was in the MCHPStack2.20. The code might have been OK. I've had a lot of difficulty not being able to compile perfectly good code on PIC compilers.
 

Thread Starter

TCOP

Joined Apr 27, 2011
94
Looks like the original problem was in the MCHPStack2.20. The code might have been OK. I've had a lot of difficulty not being able to compile perfectly good code on PIC compilers.
Well, I just realized that if you plan to work with a small 16F or 18F then probably v2.2 is your only solution since it needs just about 12k of mem. Current version needs more than 60k so probably not a good choice more mid range mcus!
 

Brownout

Joined Jan 10, 2012
2,390
What kind of help do you need? So if I'm right, you have the stack compiled and running, and you just need some code, right? Ok well, I never wrote any code for your particular stack; however, I wrote a simple socket server for a Windows computer, and made a little blog entry for testing it. It won't run for you without some edits, at least you'll need a different #include directive. Anyway, here is the link. Let me know if this helps.

http://www.electro-tech-online.com/blog-entries/simple-socket-server.190/
 
Top