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

TCP2UART project in CCS

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



Joined: 06 May 2010
Posts: 33

View user's profile Send private message

TCP2UART project in CCS
PostPosted: Thu Nov 04, 2010 5:33 am     Reply with quote

Does anyone know if there is some TCP2UART project migrated to CCS? I would like to have some example code to implement a ethernet to serial converter based on PIC18F25j10 and ENC28j60. Thanks
andrewg



Joined: 17 Aug 2005
Posts: 316
Location: Perth, Western Australia

View user's profile Send private message Visit poster's website

PostPosted: Thu Nov 04, 2010 8:29 pm     Reply with quote

I've done this (for a commercial project, so I can't share the source), but as projects go, it was pretty easy. It was a couple of days work from scratch.

Start with the Telnet RFC0854. Telnet basically streams raw bytes back and forth on a TCP socket, except that it uses 255 as an 'escape' character to enable extra functionality. CCS TCPIP examples 13 and 13b cover TCP client/server comms.

Then read RFC2217. That's serial port emulation extensions to Telnet. It defines extra 'escape' commands to switch baud rates and flow control.
_________________
Andrew
bkamen



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

View user's profile Send private message

PostPosted: Fri Nov 05, 2010 8:28 am     Reply with quote

andrewg wrote:
I've done this (for a commercial project, so I can't share the source), but as projects go, it was pretty easy. It was a couple of days work from scratch.

Start with the Telnet RFC0854. Telnet basically streams raw bytes back and forth on a TCP socket, except that it uses 255 as an 'escape' character to enable extra functionality. CCS TCPIP examples 13 and 13b cover TCP client/server comms.

Then read RFC2217. That's serial port emulation extensions to Telnet. It defines extra 'escape' commands to switch baud rates and flow control.



I did the same thing (with an octal UART) but was also part of a paid project, so I can't share the source. I used RAW sockets which is a little easier and a telnet interface that allowed configuring the ports speeds and such.

It's pretty straight-forward.

I started with the CCS TCPIP Stack and just used that as a template. Study the example -- in a sense, everything you need is in there.
_________________
Dazed and confused? I don't think so. Just "plain lost" will do. :D
Manel28



Joined: 06 May 2010
Posts: 33

View user's profile Send private message

PostPosted: Fri Nov 12, 2010 4:00 am     Reply with quote

The problem is that this is my first experience with ethernet in PICs and I don't know exactly how to organize the hole thing. It would be pretty easy to buy a commercial device but I want to learn something by myself. Some example code would be nice. Anyway I have decided to bring it forward Smile.
bkamen



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

View user's profile Send private message

PostPosted: Fri Nov 12, 2010 2:17 pm     Reply with quote

Manel28 wrote:
The problem is that this is my first experience with ethernet in PICs and I don't know exactly how to organize the hole thing. It would be pretty easy to buy a commercial device but I want to learn something by myself. Some example code would be nice. Anyway I have decided to bring it forward Smile.


Example code?

Microchip's library. It has an example to model.

The CCS TCPIP library is Microchip's TCPIP library V3.75.

In fact, with a little cutting and pasting, I'd bet the Microchip files containing the UART "stuff" could be easily pasted over to CCS.

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



Joined: 17 Aug 2005
Posts: 316
Location: Perth, Western Australia

View user's profile Send private message Visit poster's website

PostPosted: Fri Nov 12, 2010 9:30 pm     Reply with quote

A first step could be to compile the CCS examples 13/13b I mentioned above and see if you can get them working. Your PC will have a telnet client you can use for testing. I forget exactly what the example do, but just getting your PIC to echo typed characters back would probably be enough for starters.

FYI, if you do decide to implement Telnet serial port (RFC2217), then a handy PC app is http://www.hw-group.com/products/hw_vsp/index_en.html which creates a virtual COM port to your device.
_________________
Andrew
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