how can i start with ethernet & pic? - Page 1
Forum section: electronics / general

author: djlorenz
author_rank: Contributor
timestamp: January 13, 2013, 10:31:40 pm
content: 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 youLorenzo

author: David_AVD
author_rank: Super Contributor
timestamp: January 14, 2013, 12:13:59 am
content: 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.

author: Harvs
author_rank: Super Contributor
timestamp: January 14, 2013, 01:47:51 am
content: 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.

author: free_electron
author_rank: Super Contributor
timestamp: January 14, 2013, 02:27:34 am
content: 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.

author: djlorenz
author_rank: Contributor
timestamp: January 14, 2013, 11:13:11 am
content: 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 Jasiothis 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 spidoes anybody test this?thanksLorenzo

author: Nermash
author_rank: Frequent Contributor
timestamp: January 14, 2013, 11:32:14 am
content: 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)...

author: kripton2035
author_rank: Super Contributor
timestamp: January 14, 2013, 11:42:33 am
content: I second the MikroE web sitedownload a demo of the langage you're familiar with C or Basicand 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.htmlhttp://members.home.nl/bzijlstra/software/examples/enc28j60.htmhttp://www.wiznet.co.kr/Sub_Modules/en/

author: nctnico
author_rank: Super Contributor
timestamp: January 14, 2013, 12:41:00 pm
content: 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.

author: ptricks
author_rank: Frequent Contributor
timestamp: January 14, 2013, 01:20:28 pm
content: Quote from: djlorenz on January 14, 2013, 11:13:11 amI 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 .

author: Kremmen
author_rank: Super Contributor
timestamp: January 14, 2013, 02:04:28 pm
content: 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.

author: mrflibble
author_rank: Super Contributor
timestamp: January 14, 2013, 03:55:42 pm
content: Quote from: ptricks on January 14, 2013, 01:20:28 pmHey, I have a few of those as well on the todo list. Do you happen to have any links toworkingexample 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.

author: free_electron
author_rank: Super Contributor
timestamp: January 14, 2013, 04:28:59 pm
content: 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.

author: djlorenz
author_rank: Contributor
timestamp: January 14, 2013, 05:19:18 pm
content: 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...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

author: djlorenz
author_rank: Contributor
timestamp: January 14, 2013, 06:05:56 pm
content: Quote from: kripton2035 on January 14, 2013, 11:42:33 ami'm looking to mikroC website... newer watched it... seems to be goo... but... 299$ for their development software and library? i always used mplab...

author: mrflibble
author_rank: Super Contributor
timestamp: January 14, 2013, 06:08:49 pm
content: Quote from: free_electron on January 14, 2013, 04:28:59 pmYes, I have that one as well. The microchip one is intended for the cheapo solutions where 10 mbit is sufficient.

author: ptricks
author_rank: Frequent Contributor
timestamp: January 14, 2013, 10:16:22 pm
content: Quote from: mrflibble on January 14, 2013, 03:55:42 pmThe 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.Quotehttp://www.microchip.com/SoftwareLib.aspx

author: djlorenz
author_rank: Contributor
timestamp: January 16, 2013, 12:00:33 pm
content: 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

author: mrflibble
author_rank: Super Contributor
timestamp: January 16, 2013, 02:28:32 pm
content: Quote from: ptricks on January 14, 2013, 10:16:22 pmThanks. I'll take a look at it.QuoteGood 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