Elektronik / Mikrodenetleyici Projeleri/

PIC16F84 Eeprom Basit Web Server Assembly Ccs C

Sponsorlu Bağlantılar

Merak ettiğim ve denemek istediğim bir proje web server 16f84 ile iki adet proje var devreler seri ve paralel port bağlantılı ve devrelerde 24c256 eeprom kullanılmış uygulamasanızda pic ve epprom haberleşmesi örnek olabilir


WWW server in a PIC16F84 (Assembly)

web-server-pic16f84 www-server-in-a-pic16f84-24c256-eeprom



Soft UART baud rate : up to 38400
HTTP port : 1..255
Maximum TCP window size :128 (up to 255)
Program ROM use :about 400×14
RAM use : 32×8
Internal storage for www-pages :1K
External storage for www-pages : up to 8M


PIC Web Server (CCS-C)


* HTTP 1.0 web server
* miniature TCP/IP implementation
* RS232 level SLIP interface
* 32kB file storage for up to 99 files

Description : Inspired by the ongoing ‘world’s smallest webserver’ thread, though definitely not a contender, this small HTTP server uses a PIC16F84 microcontroller to serve files stored in a serial EEPROM over an RS-232 Serial Line IP (SLIP) connection.

Hardware : The project hardware includes 3 main components: a Maxim MAX233 RS232 transmitter/receiver to provide a true RS232-level serial interface, a 10 MHz 16F84 PIC microcontroller which provides the operational heart of the server, and a 256kb serial (I2C bus) EEPROM which contains the server’s file system. LEDs signal incoming and outgoing data.

I socketed the microcontroller and EEPROM to allow them to be removed for reprogramming, but you might want to add some provision for in-circuit programming of these parts, especially if using surface mount construction.


Software : The PIC code was written in C using the PCM compiler from Custom Computer Services. The server code implements a minimum subset of the TCP/IP standards, sufficient to provide basic functionality but relying on the SLIP server and client application to fill in the gaps. A stateless TCP/IP model is used; the only information maintained across requests is the server IP packet identification number, which increments each time a packet is served and the initial server TCP sequence number, which is increased by 64000 each time a new connection is requested.

As a packet arrives at the server, the incoming bytes are SLIP decoded and those fields required to reply to the packet are stored. A 20-byte IP header is assumed and any TCP options are ignored – a standard MTU of 576 if used. Non-TCP packets received are silently discarded, while connection attempts to TCP ports other than the defined HTTP port (usually 80) generate a TCP ReSeT reply.

The server’s files have 2-digit identifiers in the range 01 – 99. The file system used in the external EEPROM is described in detail below. A default ‘/’ request is served file 01, while requests for non-existent files or invalid filenames receive a correctly headed ‘404 error’ page. Files of multiple MTU length may be served, but the stateless TCP/IP requires that each requested file is served in its entirety before more packets can be answered. Therefore larger files are best avoided if the server is not to appear unresponsive.

The server does not retransmit lost packets and client ACKs are ignored – it is assumed that the client will retransmit its request if a reply is not received. Client FINs are not handled; these are not expected as in normal operation the server closes the connection after the requested file has been served, while if the client aborts the connection (e.g. the browser is closed) an RST is received which does not require acknowledgement.
Network Connection

The server hex file in the download package is configured with the HTTP port as 80 and IP as local address – these values are defined at the top of the C listing.

The PIC server relies on a host SLIP server (typically running Linux or a flavour of BSD) to provide its network connection. The exact commands to set up the SLIP server on the host machine will depend on which OS you use. These work for FreeBSD 3.3:

slattach -h -l -n -s 19200 /dev/cuaa3
ifconfig sl0 up

(The first IP number defines the address of the server side of the SLIP link). To make the PIC server accessible to other machines on the network, it is also necessary to set up routing and add an ARP entry on the SLIP server.

tcpshow, a freely downloadable BSD / Linux utility which decodes tcpdump output, is a great help when observing the packets travelling across the SLIP connection – in FreeBSD with tcpshow installed, this command gives a live human-readable display of the data being exchanged between the PIC and the SLIP server:

tcpdump -s 1518 -lenx -i sl0 -S | tcpshow -pp -cooked -track

EEPROM File System : The first 400 bytes of the EEPROM contain the File Allocation Table. Each file has a 4 byte entry: the first two bytes hold the start byte of the file, and the second two bytes hold the length of the file.

* The first four bytes (i.e. 0h-3h) should point to the ‘File not found’ page
* The second four bytes (i.e. 4h-7h) point to the index page (01)
* Bytes 8h-18Fh reference files 02 – 99
* Unused file entries should point to the ‘File not found’ page

Each file begins with its HTTP header, followed by two CR/LF pairs (The HTTP header is not generated by the server so a valid header must begin each file. See [2] for HTTP header format).

Alteration of the file system contents is most easily achieved by editing a binary copy of the supplied EEPROM image in a decent window-based hex editor such as Hex Workshop. PonyProg will convert between binary and Intel hex formats.

last update – 3/March/2000 (c)2000 Richard Beales

Alternatif link PIC16F84 Eeprom Basit Web Server Assembly Ccs C

Dosya indirme LINK listesi (TXT formatında) link-5279.zip şifre-pass: 320volt.com

  • kankos

    bu projeniz ilgimi çekti.:)
    bilgisayar açık olmadan da işlevine devam edebiliyor mu?
    ve bir flash bellek ile alanı büyültülebilir mi ?

  • eyüp

    bu devre hakkında acıklayıcı bir bilgi veririmisiniz. modemede bağlamak mümkünmüdür?

  • Hasan

    Bu devreyi nasıl yapacağımız anlamadım. Devre kaç parça ? 2şema var.. Neler programlanıyor ? Fazla zor bir devre değil ama çok karışık.