View previous topic :: View next topic |
Author |
Message |
jgschmidt
Joined: 03 Dec 2008 Posts: 184 Location: Gresham, OR USA
|
Latest TCP/IP stack from Microchip |
Posted: Wed Dec 17, 2008 4:59 pm |
|
|
I just got my PCWH compiler, primarilly so I can use TCP/IP. My compiler version is 4.082 and the TCP/IP stack seems to be based on Microchip's 3.75 version.
When I go to Microchip I find that they are up to version 4.55. The new documentation looks pretty good, it shows DNS, sockets, and other goodies.
I particularly like the DNS because I develop mostly client applications and currently have to hardcode the IP addresses I want to talk to.
Has anyone ported this latest version to work with PCH?
Are there any plans for CCS to upgrade their version of the stack?
Thanks |
|
|
andrewg
Joined: 17 Aug 2005 Posts: 316 Location: Perth, Western Australia
|
|
Posted: Thu Dec 18, 2008 3:12 am |
|
|
The ported 3.75 stack has DNS and sockets. See the examples folder. What other features do you need? _________________ Andrew |
|
|
jgschmidt
Joined: 03 Dec 2008 Posts: 184 Location: Gresham, OR USA
|
TCP/IP Client Applications |
Posted: Thu Dec 18, 2008 10:44 am |
|
|
I found the DNS module, thanks. I'll see what I can do with it.
Most of the CCS examples are server-oriented. I want to write a ping (ICMP client) application that uses DNS, that runs on the PIC. At the same time, I want the option of disabling ICMP server routines so the PIC does NOT respond to a ping, and to save memory.
Microchip's AN833 refers to a STACK_CLIENT_MODE option. I cannot find any reference to this in the CCS code. Did this not make it across?
Some good client-side examples would be nice, showing DNS and sockets.
I have searched this forum for information and not found what I needed, perhaps someone knows of some posts I missed.
Thanks |
|
|
libor
Joined: 14 Dec 2004 Posts: 288 Location: Hungary
|
|
Posted: Thu Dec 18, 2008 10:44 am |
|
|
There are 1382 lines of text added to the 'what's new' .txt file between versions 3.75 and the current 4.55 on the Microchip website.
...about half of the issues are about new features added, and half of them are about bugs removed.
Not getting deep into any particular feature (or bug) I am just curious about what do we really miss using a version frozen more than 2 years ago... |
|
|
leejok2003 Guest
|
|
Posted: Thu Dec 18, 2008 10:46 am |
|
|
does anyone tried the examples in the CCS TCP IP stack tutorial?
i was having lots of error while compiling example 7b...help... |
|
|
jgschmidt
Joined: 03 Dec 2008 Posts: 184 Location: Gresham, OR USA
|
TCP/IP Tutorial |
Posted: Thu Dec 18, 2008 11:13 am |
|
|
to Leejok2003...
I have been working through the tutorials myself and have been successful through exercise 13. I'll be glad to help you if I can. I amusing the CCS Embedded Ethernet development board (PICENS). Which board are you using? |
|
|
leejok2003 Guest
|
Re: TCP/IP Tutorial |
Posted: Thu Dec 18, 2008 8:44 pm |
|
|
jgschmidt wrote: | to Leejok2003...
I have been working through the tutorials myself and have been successful through exercise 13. I'll be glad to help you if I can. I amusing the CCS Embedded Ethernet development board (PICENS). Which board are you using? |
Thanks jgschmidt...actually I didn't have the real PICNES board but I am using simulator that includes a PIC18F4620 and enc28j60 which are also contained in the PICNES (if I am not mistaken). I am having problem when compiling the code bellow:
Code: |
#include <18f4620.h>
#use delay(clock=20 000 000)
#USE rs232(baud=9600, xmit=PIN_C6,rcv=PIN_C7)
#fuses HS, NOWDT, NOLVP,NODEBUG
#define STACK_USE_CCS_PICNES TRUE
#define STACK_USE_MCPENC TRUE
#include "drivers\stacktsk.c"
#include "ccstcpip.h"
void main(void) {
MAC_ADDR mac_dest;
printf("\r\n\nCCS TCP/IP TUTORIAL 7B\r\n");
MACAddrInit();
MACInit();
mac_dest.v[0]=0xFF;
mac_dest.v[1]=0xFF;
mac_dest.v[2]=0xFF;
mac_dest.v[3]=0xFF;
mac_dest.v[4]=0xFF;
mac_dest.v[5]=0xFF;
while(TRUE) {
if (MACIsTxReady(TRUE)) {
MACPutArray(ExampleIPDatagram, sizeof(ExampleIPDatagram));
MACPutArray(ExampleUDPPacket, sizeof(ExampleUDPPacket));
MACPutHeader(
&mac_dest, ETHER_IP,
sizeof(ExampleIPDatagram) + sizeof(ExampleUDPPacket)
);
MACFlush();
output_toggle(USER_LED2);
delay_ms(1000);
}
}
}
|
The error mainly related to the "helpers.c" file and some indicate "duplicated #"... can you help me with this? Thanks... |
|
|
jgschmidt
Joined: 03 Dec 2008 Posts: 184 Location: Gresham, OR USA
|
TCP/IP and Simulator |
Posted: Fri Dec 19, 2008 10:52 am |
|
|
to Leejok2003:
I am not familiar with simulators but at first glance it looks like you have duplicated code that is already in CCSTCPIP.H Also, check your spelling - the board name is PICENS.
Your main file should ONLY include CCSTCPIP.H, just like the example in the exercise book. Take out the first seven lines.
Then, go to CCSTCPIP.H and select only one of the development boards listed. If your simulator can not simulate one of these boards you will have to add your own. Just follow the example of one of the existing boards.
You will also have to go into HARDWARE.H to define the pin connections for your simulated board.
If you want your simulator to behave like one of the defined boards then use the information in CCSTCPIP.H and HARDWARE.H to set up the simulator. Critical are the connections between the PIC and the ethernet chip.
For the exercises using the LCD display, if you want to simulate that, look at drivers/MLCD.C for the pin connections to the LCD.
I hope that helps.
What is the simulator you are using? |
|
|
andrewg
Joined: 17 Aug 2005 Posts: 316 Location: Perth, Western Australia
|
|
Posted: Fri Dec 19, 2008 10:44 pm |
|
|
To disable ping, search for ICMP_ECHO_REQUEST and disable the relevant code. It looks like you need to comment out one block in stacktsk.c.
If there's one thing I've noticed about CCS "libraries" in general, is that they aren't designed for reuse. They're more like examples that you are expected to modify as needed.
I'm dreading any possible future stack upgrade, as I've got tweaks scattered all over the TCP/IP stack where I've needed to fix bugs and add features. _________________ Andrew |
|
|
leejok2003 Guest
|
Re: TCP/IP and Simulator |
Posted: Sat Dec 20, 2008 12:21 am |
|
|
jgschmidt wrote: | to Leejok2003:
I am not familiar with simulators but at first glance it looks like you have duplicated code that is already in CCSTCPIP.H Also, check your spelling - the board name is PICENS.
Your main file should ONLY include CCSTCPIP.H, just like the example in the exercise book. Take out the first seven lines.
Then, go to CCSTCPIP.H and select only one of the development boards listed. If your simulator can not simulate one of these boards you will have to add your own. Just follow the example of one of the existing boards.
You will also have to go into HARDWARE.H to define the pin connections for your simulated board.
If you want your simulator to behave like one of the defined boards then use the information in CCSTCPIP.H and HARDWARE.H to set up the simulator. Critical are the connections between the PIC and the ethernet chip.
For the exercises using the LCD display, if you want to simulate that, look at drivers/MLCD.C for the pin connections to the LCD.
I hope that helps.
What is the simulator you are using? |
Thanks for the advice. Well, I have removed the 7 lines and remain the rest as in the example 7b, but I am still having error messages such as identifier duplication between the "enc28j60" and "eth97j60" file. Where can I disable the eth97j60 options ? |
|
|
jgschmidt
Joined: 03 Dec 2008 Posts: 184 Location: Gresham, OR USA
|
compile errors |
Posted: Sat Dec 20, 2008 10:52 am |
|
|
Check your settings in CCSTCPIP.H. From your error messages, it looks like you have selected too many items and mutually exclusive header files are being pulled in.
This is what the beginning of CCSTCPIP.H should look like:
Code: |
#define STACK_USE_CCS_PICENS 1 //18f4620 + enc28j60
#define STACK_USE_CCS_PICNET 0 //18f6722 + realtek
#define STACK_USE_CCS_PICEEC 0 //18f97j60
|
If it still does not compile I recommend you refresh your files from the distribution media. Perhaps in your experimenting something got changed. For me, the code compiles straight out of the box after selecting the correct board.
Jurgen |
|
|
jgschmidt
Joined: 03 Dec 2008 Posts: 184 Location: Gresham, OR USA
|
TCP/IP Upgrades |
Posted: Sat Dec 20, 2008 11:00 am |
|
|
Thanks Andrew,
Yeah, I dread having to make mods to the source code. According to Darren Rook, CCS is aiming to get the compiler to work with the Microchip code directly so porting will not be necessary. This would be a great step forward in being able to use other code libraries as well. No delivery date available. |
|
|
leejok2003 Guest
|
|
Posted: Sat Dec 20, 2008 12:48 pm |
|
|
Thanks jgschmidt!
I got it correct after referring your post. I will continue my tutorial on CCS after struggling in MPLAB to learn the TCP IP stack. |
|
|
leejok2003 Guest
|
|
Posted: Sat Dec 20, 2008 1:08 pm |
|
|
I am having display problem in ex7b again. It seems that I can't include the rs232 use in the code, else I am getting error. The display in the terminal shows incorrect char...what happened? |
|
|
asmallri
Joined: 12 Aug 2004 Posts: 1634 Location: Perth, Australia
|
Re: TCP/IP Upgrades |
Posted: Sat Dec 20, 2008 1:52 pm |
|
|
jgschmidt wrote: | Thanks Andrew,
Yeah, I dread having to make mods to the source code. According to Darren Rook, CCS is aiming to get the compiler to work with the Microchip code directly so porting will not be necessary. This would be a great step forward in being able to use other code libraries as well. No delivery date available. |
Based on my experience of porting code from C30 to PCD I would not hold my breath. _________________ Regards, Andrew
http://www.brushelectronics.com/software
Home of Ethernet, SD card and Encrypted Serial Bootloaders for PICs!! |
|
|
|