CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

enc28j60 + dsPIC30F4011

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
mazedm80



Joined: 18 Feb 2015
Posts: 12

View user's profile Send private message

enc28j60 + dsPIC30F4011
PostPosted: Wed Apr 08, 2015 7:34 am     Reply with quote

im new in tcp/ip, i just want to host a webpage in my mcu, i see the enc28j60.c library in ccs but i dont understand where to start and how to use the library...
can anybody give me any sample code ??
bkamen



Joined: 07 Jan 2004
Posts: 1615
Location: Central Illinois, USA

View user's profile Send private message

PostPosted: Wed Apr 08, 2015 7:37 am     Reply with quote

There's sample code with the TCPIP drivers available from CCS.

You can also go download the Microchip Applications Library from Microchip.

Those can give you a good start.

You'll also want to learn and understand the OSI Stack and how it relates to TCPIP.

And Ethernet.

And TCP/UDP.

You have a lot of learning ahead of you.. brace yourself.
_________________
Dazed and confused? I don't think so. Just "plain lost" will do. :D
mazedm80



Joined: 18 Feb 2015
Posts: 12

View user's profile Send private message

PostPosted: Wed Apr 08, 2015 11:39 pm     Reply with quote

Quote:
There's sample code with the TCPIP drivers available from CCS.

where is the sample code ?

so i need to use those in my code

remove those # tag and only those i need to change ?
Code:

#define MAC_USE_FULL_DUPLEX   TRUE
#define MAC_USE_LOOPBACK      FALSE
#define MAC_HALF_DUPLEX_ECHO  FALSE

//if you are not using the Microchip TCP/IP stack, this will define functions
//that would have been defined normally by MAC.H
#ifndef MAC_H
   #define MAC_IP      0
   #define MAC_ARP     0x6
   #define ETHER_IP        0x00
   #define ETHER_ARP       0x06

   #define MAC_UNKNOWN 0x0ff

   #define INVALID_BUFFER  0xff

   //int8 NICCurrentRdPtr;
   //#define MACGetRxBuffer()        (NICCurrentRdPtr)

   int8 NICCurrentTxBuffer;
   #define NICGetTxBuffer()        (NICCurrentTxBuffer)
   #define MACGetTxBuffer()        (NICCurrentTxBuffer)

   typedef struct _MAC_ADDR_ {
      int8 v[6];
   } MAC_ADDR;

   #define MY_MAC_BYTE1 0x11
   #define MY_MAC_BYTE2 0x22
   #define MY_MAC_BYTE3 0x33
   #define MY_MAC_BYTE4 0x44
   #define MY_MAC_BYTE5 0x55
   #define MY_MAC_BYTE6 0x66
#endif

the SPI CONFIG and BUFFER CONFIG and rest of the code works by itself...
and where is the mac.h file in ccs ?
and i want to use tcp not udp.
bkamen



Joined: 07 Jan 2004
Posts: 1615
Location: Central Illinois, USA

View user's profile Send private message

PostPosted: Thu Apr 09, 2015 8:45 am     Reply with quote

mazedm80 wrote:
Quote:
There's sample code with the TCPIP drivers available from CCS.

where is the sample code ?

so i need to use those in my code

remove those # tag and only those i need to change ?
Code:

#define MAC_USE_FULL_DUPLEX   TRUE
#define MAC_USE_LOOPBACK      FALSE
#define MAC_HALF_DUPLEX_ECHO  FALSE

//if you are not using the Microchip TCP/IP stack, this will define functions
//that would have been defined normally by MAC.H
#ifndef MAC_H
   #define MAC_IP      0
   #define MAC_ARP     0x6
   #define ETHER_IP        0x00
   #define ETHER_ARP       0x06

   #define MAC_UNKNOWN 0x0ff

   #define INVALID_BUFFER  0xff

   //int8 NICCurrentRdPtr;
   //#define MACGetRxBuffer()        (NICCurrentRdPtr)

   int8 NICCurrentTxBuffer;
   #define NICGetTxBuffer()        (NICCurrentTxBuffer)
   #define MACGetTxBuffer()        (NICCurrentTxBuffer)

   typedef struct _MAC_ADDR_ {
      int8 v[6];
   } MAC_ADDR;

   #define MY_MAC_BYTE1 0x11
   #define MY_MAC_BYTE2 0x22
   #define MY_MAC_BYTE3 0x33
   #define MY_MAC_BYTE4 0x44
   #define MY_MAC_BYTE5 0x55
   #define MY_MAC_BYTE6 0x66
#endif

the SPI CONFIG and BUFFER CONFIG and rest of the code works by itself...
and where is the mac.h file in ccs ?
and i want to use tcp not udp.



What do you mean "Where is the sample code"?

Aren't you quoting a sample of it right there!?
_________________
Dazed and confused? I don't think so. Just "plain lost" will do. :D
mazedm80



Joined: 18 Feb 2015
Posts: 12

View user's profile Send private message

PostPosted: Thu Apr 09, 2015 11:09 pm     Reply with quote

There is no sample code for tcp/ip in ccs. I search but nobody work with 16bit mcu in ccs...
and the code above is from enc28j60.c library.
Where is lots of function and parameter, so how to use the function and use it for my mcu ?
mazedm80



Joined: 18 Feb 2015
Posts: 12

View user's profile Send private message

PostPosted: Fri Apr 10, 2015 10:52 pm     Reply with quote

bump.
Ttelmah



Joined: 11 Mar 2010
Posts: 19537

View user's profile Send private message

PostPosted: Sat Apr 11, 2015 1:43 am     Reply with quote

There is sample code for TCP/IP. It comes with the TCP/IP development kit.
However CCS will often let users without the kit have it. You have to ask them for it.
bkamen



Joined: 07 Jan 2004
Posts: 1615
Location: Central Illinois, USA

View user's profile Send private message

PostPosted: Sat Apr 11, 2015 8:20 am     Reply with quote

Yes - What TTelmah said.

Just send an email to support @ CCS asking for the TCPIP libraries.

(I just saw this now else I would have replied sooner)
_________________
Dazed and confused? I don't think so. Just "plain lost" will do. :D
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Sat Apr 11, 2015 10:31 am     Reply with quote

This advice assumes that you are a registered owner of the compiler.
If you're not, CCS won't give it to you.
mazedm80



Joined: 18 Feb 2015
Posts: 12

View user's profile Send private message

PostPosted: Sat Apr 11, 2015 11:05 am     Reply with quote

sry im not registered...
can anybody give me the code ?
[email protected]
bkamen



Joined: 07 Jan 2004
Posts: 1615
Location: Central Illinois, USA

View user's profile Send private message

PostPosted: Sat Apr 11, 2015 11:11 am     Reply with quote

Negative.

Only registered users of CCS are eligible to use CCS's provided drivers and libraries.

Sorry.
_________________
Dazed and confused? I don't think so. Just "plain lost" will do. :D
juan



Joined: 21 Apr 2015
Posts: 3
Location: argentina

View user's profile Send private message AIM Address ICQ Number

Re: enc28j60 + dsPIC30F4011
PostPosted: Tue Apr 21, 2015 3:16 pm     Reply with quote

mazedm80 wrote:
im new in tcp/ip, i just want to host a webpage in my mcu, i see the enc28j60.c library in ccs but i dont understand where to start and how to use the library...
can anybody give me any sample code ??


Hello, you got an example? Seeking an example also
bkamen



Joined: 07 Jan 2004
Posts: 1615
Location: Central Illinois, USA

View user's profile Send private message

PostPosted: Wed Apr 22, 2015 8:35 pm     Reply with quote

If you want example/drivers -- without being a register CCS User - you can browse on over to Microchip.com and download the Microchip Application Libraries.

The drivers/examples are free to any and all.

Cheers,

-Ben
_________________
Dazed and confused? I don't think so. Just "plain lost" will do. :D
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group