ChipCenter The Web's First Definitive Electronics Resource

These pages were originally posted in the Circuit Cellar Online section of
ChipCenter LLC's Web site in August 2000. ChipCenter LLC holds the copyright
to these pages and has expressly granted permission for them to be posted on
this site.  ChipCenter is a leading site for electronics engineers where
they can find a wide variety of editorial information and purchase
semiconductors online.  www.chipcenter.com


Circuit Cellar Online
THE MAGAZINE FOR COMPUTER APPLICATIONS
Circuit CellarOnline offers articles illustrating creative solutions
and unique applications through complete projects, practical
tutorials, and useful design techniques.
< ALT="" BORDER=0 height=16 width=13 align=ABSBOTTOM>INTERNET PIC 2000 CONTEST WINNERS

INTERNET CONNECTIVITY CATEGORY WINNERS

To meet the requirements of the Internet Connectivity category, contestants had to invent a new way for TCP/IP connectivity implementation other than the Microchip AN724 (or other previously published in Circuit Cellar) and incorporate additional protocols such as HTP, UDP, FTP or TFTP, IRC, and/or SMTP. The project could connect directly or via modem.

First Prize • Second Prize • Third Prize


THIRD PRIZE WINNER
PIC SLIP SERVER 
by Edward Cheung 

Edward Cheung
Mitchellville, MD

Internet-connected PIC processors have thus far used their serial ports for the physical connection to the outside world. Examples are the iPIC project [1] and an App Note from Microchip [2]. Unfortunately, the advantages of the small size of the PIC are reduced by the need for a desktop computer as the Internet gateway. The SLIP (Serial Line Internet Protocol) Server described in this project addresses this deficiency. 

An ordinary NE2000 compatible Ethernet card provides the network connection, and is interfaced directly to a PIC processor. The latter’s serial port is used to provide the SLIP line [3]. The Server allows almost any microprocessor to access the local IP resources (web and FTP servers, etc) using only its serial port.

Photo 1—The Ethernet network connects to the NE2000 card, and the SLIP client connects to the 9-pin serial port near the LEDs.

The versatile SLIP Server has many applications, among them are:

• Providing a wireless LAN connection. Using of-the-shelf wireless RS232 links, one can put together a wireless network connection.

• Connectivity for computers with a serial port and no network card such as PDAs, palmtops, and embedded computers.

• Remote Access Server. By connecting a standard modem to the SLIP Server, users can dial in and access the local network’s IP resources.

• Internet access for a great variety of other PIC projects, allowing these to send and receive data between ftp and web servers.

Using the Dial-Up Networking software, a Windows95 PC was used as the SLIP client during the development of this project. The serial port of the PC and the SLIP Server were connected together, and standard Internet clients on the PC (Netscape, ping, etc) were used to test the SLIP Server.

The main difference between IP data sent on the serial line versus Ethernet is the Ethernet header (a.k.a. Media Access Control header). This contains the six-byte hardware address of the source and destination nodes. Before any Ethernet data can be sent, the hardware address of the recipient must be determined by a protocol named Address Resolution Protocol (ARP). ARP requests are sent in broadcast mode, and the node that matches the addressing information responds with an ARP reply. Data obtained via the ARP protocol is stored in nonvolatile EEPROM memory. This can thus be retained between power cycles, or cleared on power up.

Serial characters from the SLIP client are examined for the modem "AT….<CR>" character sequence. If one is detected, an "OK" string is echoed back. This fools the PC into thinking that the modem has dialed and connected to the remote computer. The PIC continuously searches for the SLIP flag character that demarks the start and stop of all packets. If it is at the beginning of a packet (S_COUNT=0), the NE2000’s registers are readied for the loading of data. If the flag character marks the end of a packet, the packet is examined to see if the destination IP address is in the PIC’s ARP table. If the entry is not found, an ARP request is sent out to obtain the physical address. On the other hand, if the entry is found, the correct physical address is prepended to the IP packet and sent out on the Ethernet network.

On the Ethernet receiving end, new packets are checked for their type. A correct ARP reply will be stored in the PIC’s ARP table. If on the other hand, a remote IP node is querying the PIC for its hardware address, an ARP reply is sent back. Finally, IP packets are forwarded to the serial line with the correct flag and escape sequences.

In operation, the SLIP Server allows the client PC to access any IP service on the network such as HTTP, ping, and FTP. It also allows remote nodes to access any servers on the client PC, showing that the connection to the Ethernet has been bridged by the SLIP Server.

REFERENCES

[1] Serial-line PIC web server, http://www-ccs.cs.umass.edu/~shri/iPic.html

[2] Myron Loewen’s internet connected PIC, http://www.microchip.com/Download/Appnote/
Category/Internet/00724b.pdf

[3] Official SLIP description, http://www.cis.ohio-state.edu/htbin/rfc/rfc1055.html



Grand Prize Winner

Internet Application Catagory Winners


Circuit Cellar provides up-to-date information for engineers. Visit www.circuitcellar.com for more information and additional articles.
For subscription information, call (860) 875-2199, subscribe@circuitcellar.com or subscribe online. ©Circuit Cellar, the Magazine for Computer Applications. Posted with permission. 

 
Copyright ©1999 ChipCenter
About ChipCenter< ALT="" BORDER=0 height=7 width=7>Contact Us< ALT="" BORDER=0 height=7 width=7>Hot Jobs at ChipCenter< ALT="" BORDER=0 height=7 width=7> Privacy Statement Advertising Information