Author Topic: how can i start with ethernet & pic?  (Read 11191 times)

0 Members and 1 Guest are viewing this topic.

Offline djlorenzTopic starter

  • Contributor
  • Posts: 43
how can i start with ethernet & pic?
« on: January 13, 2013, 10:31:40 pm »
i looked around but there's not a good "start guide", something to start looking for development...
they all say, have a look at microchip tcp/ip stack, but i cant understand the code and how use it...

there is something like a "guide" or a well written book about using this?

thank you

Lorenzo
 

Offline David_AVD

  • Super Contributor
  • ***
  • Posts: 2862
  • Country: au
Re: how can i start with ethernet & pic?
« Reply #1 on: January 14, 2013, 12:13:59 am »
Maybe purchase the Microchip PIC32 Ethernet development board and use the included examples as a start?

At least that way you have known working hardware and can always reprogram with the original code if you bugger it up during tinkering.
 

Offline Harvs

  • Super Contributor
  • ***
  • Posts: 1204
  • Country: au
Re: how can i start with ethernet & pic?
« Reply #2 on: January 14, 2013, 01:47:51 am »
If you get the pic32 starter kit, just be aware you need a break out board to hook anything else up to it. I know this sounds pretty obvious, but when I got one, I thought I'd at least be able to solder some leads to pads somewhere. But no, it's all too fine pitched. To me, that makes these starter kits too expensive considering the other boards out there.
 

Offline free_electron

  • Super Contributor
  • ***
  • Posts: 8550
  • Country: us
    • SiliconValleyGarage
Re: how can i start with ethernet & pic?
« Reply #3 on: January 14, 2013, 02:27:34 am »
whoa.... that is not an easy thing to do.... if you have never done it before.
your easiest bet is to use the microchip controller with a hardware stack.... there is a little chip from microchip that does all the heavy lifting for you. you open the port and simply pump data..

I've done some ethernet projects. The easiest way is to go and take a look at MikroE website. they have a full blown example where they use a pic running an embedded webserver with some buttons and led's and a display attached. it talks via a wifi link ( could be a fixed link as well )

Another pic has a GUI running a program that connects via WIFI and you can use a touchsreen to turn on the LED's and read the stratus of the buttons and an analog voltage from the 'server'.
They give you full sourcecode and you can get this sourcecode in C, Pascal and even Basic.
They have nice development boards for PIC , AVR , STM32 and other cpu;s as well as compilers and a whole bunch of 'click on boards' that help you get up and running. all schematics are provided.
I use their STM32 and PIC board to breadboard a 'base system' and play with the things i have no experience with. then i simply go off and make my own board.
Professional Electron Wrangler.
Any comments, or points of view expressed, are my own and not endorsed , induced or compensated by my employer(s).
 

Offline djlorenzTopic starter

  • Contributor
  • Posts: 43
Re: how can i start with ethernet & pic?
« Reply #4 on: January 14, 2013, 11:13:11 am »
thank you for all answers...

of course is not an easy thing... but i wanna try that... i used pic a little bit and i'm starting programming the 32 series reading the really done book from Lucio di Jasio

this night i bought this:


it was at cheap price on internet so i wanna test it, it has microchip ethernet controller on it (ENC28J60) and should work with spi

does anybody test this?

thanks
Lorenzo
 

Offline Nermash

  • Frequent Contributor
  • **
  • Posts: 257
Re: how can i start with ethernet & pic?
« Reply #5 on: January 14, 2013, 11:32:14 am »
I 've done a complete project with PIC 18F2685 and ENC28J60 (on the same board as the one you bought) connected via SPI, embedded web server with some basic monitoring and control.
As others have said, it is not easy or straightforward, and there is no step by step manual for TCP/IP stack deployment.

First step IMHO would be to study Microchip Ethernet webinars, TCP/IP parts 1,2,3, AN833, AN724, AN731 etc... Then you can start compiling demo project and start playing with it. But, you have to have pretty good command of C, and understanding of how cooperative multitasking is implemented. There is also a lot of time to be invested in figuring out where is what in the numerous files.

HW part is relatively simple, you just need to connect PIC to ENC via SPI (4 lines)...
 

Offline kripton2035

  • Super Contributor
  • ***
  • Posts: 2682
  • Country: fr
    • kripton2035 schematics repository
Re: how can i start with ethernet & pic?
« Reply #6 on: January 14, 2013, 11:42:33 am »
I second the MikroE web site
download a demo of the langage you're familiar with C or Basic
and there are lots of examples with, and it is simple.
it is not a good thing to learn microchip tcp ip stack for hobby purposes...
but mikroE basic to implant some ethernet things in your home is very nice.

there are also :
http://savannah.nongnu.org/projects/lwip/
http://picnic.sourceforge.net/
http://www.ljcv.net/projects/picweb1/index.html
http://members.home.nl/bzijlstra/software/examples/enc28j60.htm
http://www.wiznet.co.kr/Sub_Modules/en/
 

Offline nctnico

  • Super Contributor
  • ***
  • Posts: 27926
  • Country: nl
    • NCT Developments
Re: how can i start with ethernet & pic?
« Reply #7 on: January 14, 2013, 12:41:00 pm »
I'd rather start with something like FreeRtos ( www.freertos.org ) and a supported board with a 32 bit controller. Lots of ready-to-go examples and a 32 bit controller has enough resources to set your imagination free for a while.
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline ptricks

  • Frequent Contributor
  • **
  • Posts: 672
  • Country: us
Re: how can i start with ethernet & pic?
« Reply #8 on: January 14, 2013, 01:20:28 pm »
thank you for all answers...

of course is not an easy thing... but i wanna try that... i used pic a little bit and i'm starting programming the 32 series reading the really done book from Lucio di Jasio

this night i bought this:


it was at cheap price on internet so i wanna test it, it has microchip ethernet controller on it (ENC28J60) and should work with spi

does anybody test this?

thanks
Lorenzo

I use those all the time. It is pretty simple to use , the chip is just spi interface and it handles all the work for you. Very good and cheap way to get a pic on the network .
 

Offline Kremmen

  • Super Contributor
  • ***
  • Posts: 1289
  • Country: fi
Re: how can i start with ethernet & pic?
« Reply #9 on: January 14, 2013, 02:04:28 pm »
If you just want Ethernet on a PIC then i think you have your answer above. On the other hand if the idea was to understand about the workings of "Ethernet" then my suggestion would be to get your hands on LwIP and FreeRTOS and get a dev board for a MCU where the combo has been implemented. FreeRTOS.org should help you there.
You won't get very far with Ethernet (or other high speed multi purpose protocols) without understanding multitasking and how to implement your application in such an environment.
Nothing sings like a kilovolt.
Dr W. Bishop
 

Offline mrflibble

  • Super Contributor
  • ***
  • Posts: 2051
  • Country: nl
Re: how can i start with ethernet & pic?
« Reply #10 on: January 14, 2013, 03:55:42 pm »
thank you for all answers...

of course is not an easy thing... but i wanna try that... i used pic a little bit and i'm starting programming the 32 series reading the really done book from Lucio di Jasio

this night i bought this:


it was at cheap price on internet so i wanna test it, it has microchip ethernet controller on it (ENC28J60) and should work with spi

does anybody test this?

thanks
Lorenzo

I use those all the time. It is pretty simple to use , the chip is just spi interface and it handles all the work for you. Very good and cheap way to get a pic on the network .

Hey, I have a few of those as well on the todo list. Do you happen to have any links to working example code? If it happens to be stm32f4 flavor C/C++ code that would be a real bonus, but I'm not being too picky here. ;-) Any decent + readible code will do the trick.

 

Offline free_electron

  • Super Contributor
  • ***
  • Posts: 8550
  • Country: us
    • SiliconValleyGarage
Re: how can i start with ethernet & pic?
« Reply #11 on: January 14, 2013, 04:28:59 pm »
If you gonna use stm32 simply get the one with the MAC I side. No need for the microchip device. St has a stack based on uCrtos.
Professional Electron Wrangler.
Any comments, or points of view expressed, are my own and not endorsed , induced or compensated by my employer(s).
 

Offline djlorenzTopic starter

  • Contributor
  • Posts: 43
Re: how can i start with ethernet & pic?
« Reply #12 on: January 14, 2013, 05:19:18 pm »
really thank for all answers...
is nice to see a lot of people helping...

i usually use pic18 and i started with 32 now, i usually use microchip libraries but i didn't make a lot of projects...
most only learning to program...
i'm still looking for a "good" project to build but my dreams are still too high...  ;D

i think i will start looking for the links you write here and have a general look and choose were i can start...
i'm happy that the board i bought is ok... bought from china so it will take a long for get here... i have time to think about..
(and i need also time for study... this is exams period)

thank you all, any information is good for me ;)
 

Offline djlorenzTopic starter

  • Contributor
  • Posts: 43
Re: how can i start with ethernet & pic?
« Reply #13 on: January 14, 2013, 06:05:56 pm »
I second the MikroE web site
download a demo of the langage you're familiar with C or Basic
and there are lots of examples with, and it is simple.
it is not a good thing to learn microchip tcp ip stack for hobby purposes...
but mikroE basic to implant some ethernet things in your home is very nice.

there are also :
http://savannah.nongnu.org/projects/lwip/
http://picnic.sourceforge.net/
http://www.ljcv.net/projects/picweb1/index.html
http://members.home.nl/bzijlstra/software/examples/enc28j60.htm
http://www.wiznet.co.kr/Sub_Modules/en/

i'm looking to mikroC website... newer watched it... seems to be goo... but... 299$ for their development software and library? i always used mplab...
 

Offline mrflibble

  • Super Contributor
  • ***
  • Posts: 2051
  • Country: nl
Re: how can i start with ethernet & pic?
« Reply #14 on: January 14, 2013, 06:08:49 pm »
If you gonna use stm32 simply get the one with the MAC I side. No need for the microchip device. St has a stack based on uCrtos.

Yes, I have that one as well. The microchip one is intended for the cheapo solutions where 10 mbit is sufficient.
 

Offline ptricks

  • Frequent Contributor
  • **
  • Posts: 672
  • Country: us
Re: how can i start with ethernet & pic?
« Reply #15 on: January 14, 2013, 10:16:22 pm »

Hey, I have a few of those as well on the todo list. Do you happen to have any links to working example code? If it happens to be stm32f4 flavor C/C++ code that would be a real bonus, but I'm not being too picky here. ;-) Any decent + readible code will do the trick.

The code is in the microchip application libraries.

The app libraries contain lots of demo apps for things like servers, power meter reading, bootloaders programmable by internet, internet radio. Most of the apps are for pic32 targets, but some also work for pic18. One note on using the microchip TCP code, the licensing forbids its use on any non-microchip host chips.
Quote
ONLY the Software driver source files ENC28J60.c, ENC28J60.h,
 *      ENCX24J600.c and ENCX24J600.h ported to a non-Microchip device
 *      used in conjunction with a Microchip ethernet controller for
 *      the sole purpose of interfacing with the ethernet controller.

http://www.microchip.com/SoftwareLib.aspx
 

Offline djlorenzTopic starter

  • Contributor
  • Posts: 43
Re: how can i start with ethernet & pic?
« Reply #16 on: January 16, 2013, 12:00:33 pm »
i also think i'll start with microchip stack.. i don't wanna pay 300$ for mikroE...

now i have only to fine some time  ;D
 

Offline mrflibble

  • Super Contributor
  • ***
  • Posts: 2051
  • Country: nl
Re: how can i start with ethernet & pic?
« Reply #17 on: January 16, 2013, 02:28:32 pm »
The code is in the microchip application libraries.

Thanks. I'll take a look at it.

Quote
... One note on using the microchip TCP code, the licensing forbids its use on any non-microchip host chips.

Good to know. Should this get used, I'll be sure to define a conformal mapping in the comment section such that the code can be said to "run on microchip hardware" in a topological sense. :p
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf