EmbeddedRelated.com
Forums

Embedded webserver on an 8 bit MCU

Started by zalzon July 17, 2004
Back from the grave.

To advance my knowledge of embedded systems, I would like to build an
embedded webserver on an 877 PIC microcontroller.  Nothing fancy as
far as the webserver is concerned.   

From what I gather, i need to impliment a tcp/ip stack on the MCU and
somehow hook it up to an ethernet card.  For now, I've focused my
efforts at learning TCP/IP in as much detail as I can.

Have any of you guys done such a project and if so what advice can u
give me.  I'm just trying to learn so go easy on the abuse...  
On Sat, 17 Jul 2004 07:34:41 GMT, zalzon <zalzonishappy@zalll.com>
wrote:

>Back from the grave. > >To advance my knowledge of embedded systems, I would like to build an >embedded webserver on an 877 PIC microcontroller. Nothing fancy as >far as the webserver is concerned. > >From what I gather, i need to impliment a tcp/ip stack on the MCU and >somehow hook it up to an ethernet card. For now, I've focused my >efforts at learning TCP/IP in as much detail as I can. > >Have any of you guys done such a project and if so what advice can u >give me. I'm just trying to learn so go easy on the abuse...
Take a look at the following link: http://www.ethernut.de I think the Atmel AVR is a much better choice than PIC 16 series for any application that requires the use of C language. regards, Johnny.
>Back from the grave. > >To advance my knowledge of embedded systems, I would like to build an >embedded webserver on an 877 PIC microcontroller. Nothing fancy as >far as the webserver is concerned. > >From what I gather, i need to impliment a tcp/ip stack on the MCU and >somehow hook it up to an ethernet card. For now, I've focused my >efforts at learning TCP/IP in as much detail as I can. > >Have any of you guys done such a project and if so what advice can u >give me. I'm just trying to learn so go easy on the abuse...
Apart from the good link to ethernut which the other poster provided, there are many such projects around. In particular I can recommend you the Book from Jeremy Bentham "TCP/IP lean" which contains a PIC Webserver example and all TCP/IP related information source code etc. The best piece of information to get me started was the slaa137.pdf / slaa137.zip technote from TI which describes how to implement the very subject on one of their MPU's. I found the TCP/IP stack there (including all source) a very good starting point in that it really focuses on the "bare bones" of the topic. It's therefore easyier to understand. Reading the related RFC's (start with RFC 793) will also help a great deal. Understanding the TCP state engine - while not rocket sience - is not that easy at the first glance. You therefore may have to use multiple sources. If you want to go the easy route or find it too dificult to implement all by yourself you may also want to take a look at what Rabbit Semiconductor offers ( www.rabbitsemiconductor.com ). There you can get Core Modules all ready including a complete developement envireonement with a TCP/IP stack, Webserver code etc. etc. Another probably similar aproach is the EZ80 stuff from Zillog. They don't work with PIC's though. If you intend to do more stuff with your developement except for switching two or three things on and off through the webserver, you probably should consider using something other than a PIC. In other words - it's doable with the PIC, but apart from the webserving there are probably not much resources left to do other things. HTH Markus
"Markus Zingg" <m.zingg@nct.ch> wrote in message
news:abthf0posrae1bj441r2pfdssucpc3p1kl@4ax.com...
> >Back from the grave. > > > >To advance my knowledge of embedded systems, I would like to build an > >embedded webserver on an 877 PIC microcontroller. Nothing fancy as > >far as the webserver is concerned. > > > >From what I gather, i need to impliment a tcp/ip stack on the MCU and > >somehow hook it up to an ethernet card. For now, I've focused my > >efforts at learning TCP/IP in as much detail as I can. > > > >Have any of you guys done such a project and if so what advice can u > >give me. I'm just trying to learn so go easy on the abuse... > > Apart from the good link to ethernut which the other poster provided, > there are many such projects around. In particular I can recommend you > the Book from Jeremy Bentham "TCP/IP lean" which contains a PIC > Webserver example and all TCP/IP related information source code etc. > > The best piece of information to get me started was the slaa137.pdf / > slaa137.zip technote from TI which describes how to implement the very > subject on one of their MPU's. I found the TCP/IP stack there > (including all source) a very good starting point in that it really > focuses on the "bare bones" of the topic. It's therefore easyier to > understand. Reading the related RFC's (start with RFC 793) will also > help a great deal. Understanding the TCP state engine - while not > rocket sience - is not that easy at the first glance. You therefore > may have to use multiple sources.
Olimex sells a ready-made version of the above: http://www.olimex.com/dev/msp-easyweb2.html Leon
"zalzon" <zalzonishappy@zalll.com> wrote in message
news:v0lhf051arjtgu6lstocj60rhhbtu7hrtb@4ax.com...
> Back from the grave. > > To advance my knowledge of embedded systems, I would like to build an > embedded webserver on an 877 PIC microcontroller. Nothing fancy as > far as the webserver is concerned. > > From what I gather, i need to impliment a tcp/ip stack on the MCU and > somehow hook it up to an ethernet card. For now, I've focused my > efforts at learning TCP/IP in as much detail as I can. > > Have any of you guys done such a project and if so what advice can u > give me. I'm just trying to learn so go easy on the abuse...
http://www-ccs.cs.umass.edu/~shri/iPic.html
zalzon <zalzonishappy@zalll.com> wrote in message news:<v0lhf051arjtgu6lstocj60rhhbtu7hrtb@4ax.com>...
> Back from the grave. > > To advance my knowledge of embedded systems, I would like to build an > embedded webserver on an 877 PIC microcontroller. Nothing fancy as > far as the webserver is concerned.
I don't think you'll be able to implement a robust TCP/IP stack and HTTP server on that microcontroller without external RAM and probably external flash. Rabbit Semiconductor has complete development kits for Ethernet-enabled core modules starting under $200. A full version of the compiler and TCP/IP stack with source code is included with all dev kits. You won't get to implement your own stack (a very non-trivial task), but you can still learn a lot. Here is a live web server demo running on a core module: http://demo.zweng.com:8147 http://www.rabbitsemiconductor.com http://www.zworld.com http://www.imaginetools.com
Thanks guys but I should have added to my original message that I intend
to stick with the PIC.  I know there are other microcontrollers out there
which might be better suited for this task.  My objective however is to
learn more about TCP/IP and struggle through it.

My idea for this project was fired when I heard a couple years back of a
guy who built the smallest webserver by using the smallest 8051 chip he
could get his hands on.  I figured if he could do it on such a small chip,
I should be able to do it on a much larger 40 pin PIC 877.

I'll check out the resources you recommended for learning this.  Right now
I'm studying the basics of TCP/IP.
On Sat, 17 Jul 2004 12:32:18 -0700, DM McGowan II wrote:

> http://www-ccs.cs.umass.edu/~shri/iPic.html
That's exactly what I had in mind except I plan not to use an external EEPROM to store webserver files. In fact I remember visiting the guy's iPIC server when he first got it up. It attracted so many visitors that the little iPIC crashed. He had to take it offline and set up a simulated version of it on a webpage. I remember reading the text file 'History of the World' on his iPIC though. :) Now if only he had provided the TCP/IP code and explained it. He claims the TCP/IP code fits in just 256 bytes with the EEPROM chip holding the server's files. Pretty impressive little gizmo.
zalzon <zalzonishappy@zalll.com> wrote in message news:<pan.2004.07.18.06.06.20.341246@zalll.com>...
> On Sat, 17 Jul 2004 12:32:18 -0700, DM McGowan II wrote: > > > http://www-ccs.cs.umass.edu/~shri/iPic.html > > > That's exactly what I had in mind except I plan not to use an external > EEPROM to store webserver files. In fact I remember visiting the guy's > iPIC server when he first got it up. It attracted so many visitors > that the little iPIC crashed. He had to take it offline and set up a > simulated version of it on a webpage. I remember reading the text file > 'History of the World' on his iPIC though. :) > > Now if only he had provided the TCP/IP code and explained it. He > claims the TCP/IP code fits in just 256 bytes with the EEPROM chip > holding the server's files. Pretty impressive little gizmo.
Actually you can find on the net the sources of Russian guy who did the same. There is mirror of his page at PICLIST: http://piclist.com/techref/piclist/petrovwwwpic/index.htm Note that this is hard to say TCP/IP stack. It handles very limited features of TCP/IP and allow only single connection. Best regards Tsvetan --- PCB prototypes for $26 at http://run.to/pcb (http://www.olimex.com/pcb) PCB any volume assembly (http://www.olimex.com/pcb/protoa.html) Development boards for ARM, AVR, PIC, and MSP430 (http://www.olimex.com/dev)
On Sat, 17 Jul 2004 07:34:41 GMT, zalzon <zalzonishappy@zalll.com>
wrote:

>Back from the grave. > >To advance my knowledge of embedded systems, I would like to build an >embedded webserver on an 877 PIC microcontroller. Nothing fancy as >far as the webserver is concerned. > >From what I gather, i need to impliment a tcp/ip stack on the MCU and >somehow hook it up to an ethernet card. For now, I've focused my >efforts at learning TCP/IP in as much detail as I can. > >Have any of you guys done such a project and if so what advice can u >give me. I'm just trying to learn so go easy on the abuse...
You may also want to look at the Wiznet chip. This is a chip that runs a TCP/IP stack which you can access as am 8 bit peripheral or via an I2C Bus. It can handle up to 4 simultaneous links, which should be fine for any sort of web based user interface. With the W3100A you need in the order of 10 instruction lines to be able to ping your device. Regards Anton Erasmus