View previous topic :: View next topic |
Author |
Message |
pmuldoon
Joined: 26 Sep 2003 Posts: 218 Location: Northern Indiana
|
TCP/IP stack |
Posted: Mon Sep 20, 2010 9:12 am |
|
|
I have a customer (and therefore a reason) to learn how to put my PIC designs on the ethernet. They will eventually want to convert their entire product line.
I bought a PICDEM NET from Microchip a few years ago and went thru it's tutorial in anticipation of this day. I figured at least I will have been exposed to the concept and hopefully about 10% of the material will look familiar as I go thru it again now.
Microchip has a TCP/IP stack that has been around a while and, I assume, should be fairly robust by now. The problem is that I would have to use their C30 compiler which would add the bother of learning a new compiler in the middle of all of this. Or can the stack be modified fairly easily to work with CCS?
I plan to stick to the 18F chips as I've had too much trouble with the DSP's and know I can make the 18F's do what I need without any surprises.
Now I'm looking for you guys' vast experience to push me in the right direction:
1) Does CCS have a similar, royalty-free stack that is up to the task?
2) I want to pick either a chip or seperate controller that is sufficiently advanced to make the learning experience a bit easier than it was the last time. I'm thinking something like the ENC424J600 controller, or 18F97J60.
I've looked at CCS dev kits, but the parts seem a bit dated compared to what Mchip has.
If you had to learn it all over again, where would you start? |
|
|
newguy
Joined: 24 Jun 2004 Posts: 1907
|
|
Posted: Mon Sep 20, 2010 9:41 am |
|
|
I can't say whether the Microchip stack can be easily ported to CCS, but I'm supporting an application where the original author basically cut & pasted the mchip TCP/IP stack into a Freescale C project that runs on a DSP56F803. I'm betting that it won't be that tough to do.
Just one thing to look out for: it doesn't matter which ethernet "bridge" chip you choose, they all get REALLY FREAKING HOT!!! Design your PCB with really large ground plane(s) at a minimum and it's not a bad idea to leave space on the back of the board opposite the ethernet chip for a heatsink, just in case.
And do please read the errata for the ENC28J60 (if you choose it) because it's full of little gotcha's. |
|
|
pmuldoon
Joined: 26 Sep 2003 Posts: 218 Location: Northern Indiana
|
|
Posted: Mon Sep 20, 2010 10:16 am |
|
|
Excellent advice.
Just the kind of info I was looking for.
Unless someone has a better idea, I am planning on looking at the mchp stack and at least trying to compile it w/ccs and see how bad it gets. But before I bury myself in manuals and datasheets I figured I'd try and make sure I was starting off on a good path.
Luckily my contact with this customer gives me plenty of heads up, so I figure I've got most of the winter to develope my skills.
I'm glad you told me about the heat issue. I did notice a surprisingly high current requirement when I was looking at chips - thought about power supply requirements, but didn't even think about the power dissipation at the chip. |
|
|
smanzer
Joined: 14 Sep 2009 Posts: 24 Location: Ontario, Canada
|
Dont waste your time |
Posted: Mon Sep 20, 2010 10:42 am |
|
|
I went down that route, then I bought an EzWebLynx from CCS and was on line in one night.
My 2 cents worth
Steven _________________ "I am always doing that which I can not do, in order that I may learn how to do it."
- Pablo Picasso |
|
|
pmuldoon
Joined: 26 Sep 2003 Posts: 218 Location: Northern Indiana
|
|
Posted: Mon Sep 20, 2010 11:04 am |
|
|
EzWebLynx - I may do that, to start with. It would give my customer something to start playing with while I develop the embedded version.
Can you send data back and forth to a PIC with that - like config settings, datalogging results, or just IO pin states and AD channel results? |
|
|
bkamen
Joined: 07 Jan 2004 Posts: 1615 Location: Central Illinois, USA
|
Re: TCP/IP stack |
Posted: Mon Sep 20, 2010 11:00 pm |
|
|
pmuldoon wrote: |
If you had to learn it all over again, where would you start? |
CCS has the MCHP stack converted.. but it's 3.75 whereas MCHP is now on like 5.25.
I have the PICdem.net2 and have had both CCS and MCHP c18 demos running on it.
I also did some work for someone using C32 on a PIC32. (fun!)
I also started to convert 5.2 to CCS and just ran out of spare time to monkey with it.
So at think point, I would just use C18 and go with the latest stack.
Even though I would prefer CCS. _________________ Dazed and confused? I don't think so. Just "plain lost" will do. :D |
|
|
pmuldoon
Joined: 26 Sep 2003 Posts: 218 Location: Northern Indiana
|
|
Posted: Tue Sep 21, 2010 6:11 am |
|
|
Thanks, BK. You make a good point.
Sounds like converting the stack to CCS is a bit of work.
I just read part of mchips "ethernet theory of operation". It's a great read, although I'm still in the physical/electrical part (which i find very interesting, yet useless to the task at hand). I can't help but wonder how they thought up all that stuff and managed to make it work as reliably as it does.
After that I'll look at the mchip stack with the thought of possilby converting it to CCS. I may still go per your suggestion about the mchip compiler/stack, but if i have to choose between being frustrated learning a different compiler vs being frustrated converting something to CCS, I may just...keep my mouth shut til i've seen the volume of sourcecode.
So if the internet backbone goes down this winter, that'll just be me testing my code. |
|
|
bkamen
Joined: 07 Jan 2004 Posts: 1615 Location: Central Illinois, USA
|
|
Posted: Tue Sep 21, 2010 6:51 am |
|
|
Converting will only make you current until the next revision stack comes out. If the client wants CCS, they'll be converting the new stack ever time there's a new release.
C18 isn't so bad. You just have to do more stuff on your own whereas CCS probably has a function to do it for you. _________________ Dazed and confused? I don't think so. Just "plain lost" will do. :D |
|
|
pmuldoon
Joined: 26 Sep 2003 Posts: 218 Location: Northern Indiana
|
|
Posted: Tue Sep 21, 2010 7:33 am |
|
|
Do you know if the free version of mchips compiler would be able to handle it? I'm not sure if I can talk my company into supporting two C-compilers.
I agree that it would make it easy to update - and I would sure dread having to choose between converting a newer revision to ccs or converting all my source to mchip's compiler if it ever became necessary down the road.
I've gotta admit, that EzWebLynx is sounding better all the time.
On another point: Are all of the controllers power hogs? Certainly POE devices can't be portable space heaters, can they? |
|
|
andrewg
Joined: 17 Aug 2005 Posts: 316 Location: Perth, Western Australia
|
|
Posted: Tue Sep 21, 2010 8:41 am |
|
|
The CCS v3.75 stack may not be the latest, but it still works just fine for me. At least as far as web-enabling things and tossing UDP packets around. DHCP works too. However, I can forsee a time when I would like to play with the Microchip Wi-Fi module, and that requires their very latest stack. If that happens, I may end up switching compilers _________________ Andrew |
|
|
bkamen
Joined: 07 Jan 2004 Posts: 1615 Location: Central Illinois, USA
|
|
Posted: Tue Sep 21, 2010 9:28 am |
|
|
andrewg wrote: | The CCS v3.75 stack may not be the latest, but it still works just fine for me. At least as far as web-enabling things and tossing UDP packets around. DHCP works too. However, I can forsee a time when I would like to play with the Microchip Wi-Fi module, and that requires their very latest stack. If that happens, I may end up switching compilers |
I could go with that for starters, but he mentions "company" and implies long term because ALL the products will get switched to this TCP/IP Solution.
I found 1 bug for sure in 3.75 that involved partially read RX buffers got whacked pointers for the next time around coming back to finish reading them before being discarded.
MCHP confirmed it was a bug and "use the latest stack".
And that's when it was became a bummer.
-Ben _________________ Dazed and confused? I don't think so. Just "plain lost" will do. :D |
|
|
bkamen
Joined: 07 Jan 2004 Posts: 1615 Location: Central Illinois, USA
|
|
Posted: Tue Sep 21, 2010 9:41 am |
|
|
pmuldoon wrote: | Do you know if the free version of mchips compiler would be able to handle it? I'm not sure if I can talk my company into supporting two C-compilers.
I agree that it would make it easy to update - and I would sure dread having to choose between converting a newer revision to ccs or converting all my source to mchip's compiler if it ever became necessary down the road.
|
C18 comes with a lifetime upgrade, so it's really a buy once.
Honestly, think about how much time you'll spend converting the stack (I would have posted mine back to CCS, but I just didn't have the time...) only to get behind the curve on the next update.
And all for $750 of a compiler. Ouch. Not worth it.
There's a LOT of good business reasons why it's good to have PCH and C18.
Since I work in MPLAB (not PCW), switching between CCS and C18 is a one-time project setup.
Quote: |
I've gotta admit, that EzWebLynx is sounding better all the time.
On another point: Are all of the controllers power hogs? Certainly POE devices can't be portable space heaters, can they? |
I don't remember the PIC18FxxJ90 being a super power hog.. in a design I did... but I'd have to check again. _________________ Dazed and confused? I don't think so. Just "plain lost" will do. :D |
|
|
asmallri
Joined: 12 Aug 2004 Posts: 1634 Location: Perth, Australia
|
|
Posted: Wed Sep 22, 2010 1:29 am |
|
|
The free version of the C18 compiler works with the latest stack it means you lose optimization and therefore end up with a larger code footprint. The lastest Microchip IP stack is very large (large program memory footprint). The C18 compiler, even with full optimization, is larger than the equivalent footprint produced by CCS. If the features of the CCS stack meet your needs then stay with the CCS implementation. If you do need to use a PIC18F processor with Microchips current stack then ideally you need to be considering a PIC with 96K or 128K of program memory.
Personally I would not use the ENC28J60 for new designs - it (and the PIC18F97J60 family) are power hungry and limit you to 10M Ethernet environments. This may not seen like much of a limitation considering it is exceedingly unlikely an application can drive the Ethernet interface at full speed but you should be aware that some networking vendors are dropping 10Mbps Ethernet support from their products. The Microchip ENC424J600 family of Ethernet controllers is a cost effective alternative that consumes less power and delivers a 10/100M Ethernet solution. Unfortunately this controller is not supported in the CCS TCP/IP stack. _________________ Regards, Andrew
http://www.brushelectronics.com/software
Home of Ethernet, SD card and Encrypted Serial Bootloaders for PICs!! |
|
|
pmuldoon
Joined: 26 Sep 2003 Posts: 218 Location: Northern Indiana
|
|
Posted: Wed Sep 22, 2010 6:05 am |
|
|
Good points asmallri, thanks.
So basically, what I think i've heard is that there are tradeoffs either way.
Converting a stack once may be very educational for me, but that may result in a need to convert a future revision down the road, and that would be...unpleasant.
I've got a long weekend starting tomorrow. I'll make some time to try and compare the two stacks features, chip support, etc and plan on pulling the trigger on a dev kit next week. I think i'm biased a bit towards CCS just because I think I'd get better support and would get off the ground quicker cuz I understand the compiler.
Again, this is a learning experience out of my own pocket, so i'm trying to be a little thrifty. |
|
|
asmallri
Joined: 12 Aug 2004 Posts: 1634 Location: Perth, Australia
|
|
Posted: Wed Sep 22, 2010 11:00 am |
|
|
I forgot to add,
The Microchip stack is a very messy application stack to work with. This is because their compilers for each PIC family comes from different backgrounds so there are lots of conditional compiles to deal with this. It is a nightmare for a first time user and a real problem for ongoing product support unless you work with their stack frequently.
If the CCS stack meets your needs, go have a BBQ and watch a football match instead of wasting time.... _________________ Regards, Andrew
http://www.brushelectronics.com/software
Home of Ethernet, SD card and Encrypted Serial Bootloaders for PICs!! |
|
|
|