| Attention
Creative Design Engineers: Getting Connected To The Internet Can Earn You Cash. |
|
|
Internet Connectivity Category Winners First Prize • Second Prize • Third Prize Internet Application Category Winners First Prize • Second Prize • Third Prize
|
INTERNET PIC 2000 CONTEST WINNERS MAKING THE CONNECTION THIRD
PRIZE WINNER Edward Cheung 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.
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/ [3] Official SLIP description, http://www.cis.ohio-state.edu/htbin/rfc/rfc1055.html |
|
![]() |