View previous topic :: View next topic |
Author |
Message |
mazedm80
Joined: 18 Feb 2015 Posts: 12
|
enc28j60 + dsPIC30F4011 |
Posted: Wed Apr 08, 2015 7:34 am |
|
|
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: 1614 Location: Central Illinois, USA
|
|
Posted: Wed Apr 08, 2015 7:37 am |
|
|
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
|
|
Posted: Wed Apr 08, 2015 11:39 pm |
|
|
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: 1614 Location: Central Illinois, USA
|
|
Posted: Thu Apr 09, 2015 8:45 am |
|
|
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
|
|
Posted: Thu Apr 09, 2015 11:09 pm |
|
|
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
|
|
Posted: Fri Apr 10, 2015 10:52 pm |
|
|
bump. |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19494
|
|
Posted: Sat Apr 11, 2015 1:43 am |
|
|
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: 1614 Location: Central Illinois, USA
|
|
Posted: Sat Apr 11, 2015 8:20 am |
|
|
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
|
|
Posted: Sat Apr 11, 2015 10:31 am |
|
|
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
|
|
Posted: Sat Apr 11, 2015 11:05 am |
|
|
sry im not registered...
can anybody give me the code ?
mazedm80@gmail.com |
|
|
bkamen
Joined: 07 Jan 2004 Posts: 1614 Location: Central Illinois, USA
|
|
Posted: Sat Apr 11, 2015 11:11 am |
|
|
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
|
Re: enc28j60 + dsPIC30F4011 |
Posted: Tue Apr 21, 2015 3:16 pm |
|
|
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: 1614 Location: Central Illinois, USA
|
|
Posted: Wed Apr 22, 2015 8:35 pm |
|
|
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 |
|
|
|