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.
THIRD PRIZE WINNER
Internet-connected PIC processors have thus far used their serial ports for the physical connection to the outside world. Examples are the iPIC project  and an App Note from Microchip . 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 . The Server allows almost any microprocessor to access the local IP resources (web and FTP servers, etc) using only its serial port.
The versatile SLIP Server has many applications, among them are:
• 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.
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.
 Official SLIP description, http://www.cis.ohio-state.edu/htbin/rfc/rfc1055.html
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, email@example.com or subscribe online. ©Circuit Cellar, the Magazine for Computer Applications. Posted with permission.
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