ethernet using embedded systems

Upload: venkateshmukharji

Post on 08-Aug-2018

213 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/22/2019 Ethernet Using Embedded Systems

    1/15

    ETHERNET USING EMBEDDED

    SYSTEMS

    PRESENTED BY

    B.KOTI

    REDDY

    K.NARENDRA

    REDDY

    III ECE

    LAKIREDDY BALIREDDY COLLEGE OF

    ENGINEERNG

    MYLAVARAM-521230

  • 8/22/2019 Ethernet Using Embedded Systems

    2/15

    ABSTRACT

    Ethernet is a LAN Technology that is widely used in the networking field. It

    is considered that Ethernet has two main drawbacks. The first one is that

    transmitting host does not know whether the destination host is alive or not. The

    second one is that the receiving host does not send acknowledgement to the

    source informing that the data has been received. This makes the data

    communication unreliable.

    To overcome these two drawbacks, we go for Embedded Ethernet. It has

    two ICs as its main components namely CrystalCS8900A and PIC16C74.

    CrystalCS8900A IC has integrated memory to store packets temporarily while

    PIC16C74 IC can be programmed to make decisions according to the

    instructions of the host, to issue acknowledgements to the source, etc..,. This

    paper explains how data communication using Embedded Ethernet takes place.

  • 8/22/2019 Ethernet Using Embedded Systems

    3/15

    ETHERNET

    Ethernet is a popular L A N technology

    A coaxial cable(Ether) carries signals at 10 Mbps

    The connection between a computer and the cable requires a hardware

    device called transceiver for sensing and sending signals.

    A Host interface of Host adapter plugs into the computer bus and

    connects to the transceiver.

    Host interface controls the operation of transceiver according to

    instructions of computer

    Ethernet has a bus topology because all hosts share a single

    communication channel

    Costly of this assembly are replaced by an Embedded Ethernet board

    which is a special high speed digital circuits

    NEED FOR EMBEDDED ETHRNET

    There are two main drawbacks in the existing Ethernet .They are

    The transmitting host does not know whether the destination host is alive or not.

    Acknowledgement is not issued by the receiving host to inform the source that the

    data has been received.

  • 8/22/2019 Ethernet Using Embedded Systems

    4/15

    Hence the communication is supposed to be unreliable. To overcome these drawbacks,

    Embedded Ethernet is used.

    EMBEDDED ETHERNET

    The Embedded Ethernet board consists of two ICs namely

    1. Crystal CS8900A IC

    2. PIC16C74 IC

    Embedded Ethernet board enables microcontroller based projects to

    communicate over 10baseT Ethernet.

    Any controller that has two 8-bit bidirectional I/O ports can use this board.

    IMPLEMENTATION OF BOARD

    Collecting the components

    of correct specification

    Draw the circuitry on the PCB

    using the automated board

    design software

    Place the IC, crystal and various

    components in the PCB

    Embed the program for interface

    into the IC PIC16C74

  • 8/22/2019 Ethernet Using Embedded Systems

    5/15

    COLLECTION OF COMPONENTS

    Quantity Part

    1 Crystal CS8900A-CQ

    1 Valor ST7011/ST7010T

    2 24.9 Ohm

    1 100 Ohm

    2 680 Ohm resistor

    1 4.7K Ohm

    1 4.99K

    1 68pf Cap

    9 .1 mfd Cap

    1 Link LED (Green)

    1 LAN LED (Red)

    1 20Mhz crystal

    1 RJ45 Connector

    1 Right angle header

  • 8/22/2019 Ethernet Using Embedded Systems

    6/15

    THE PIN DIAGRAM 0F IC CS8900A

  • 8/22/2019 Ethernet Using Embedded Systems

    7/15

    CONNECTIONS

    16 pins of IC CS8900A is connected to the PIC16C74.

    8 pin data bus

    4 pin address bus

    4 pin control pins

    4 pins are connected with the RJ45 Connector to connect this IC with the

    ether cable.

    This board is supplied with a 5V power supply.

    CRYSTAL CS8900A IC

    It is the heart of our Embedded Ethernet board

    Low cost ,Powerful Ethernet controller

    It has the 4 K B integrated memory allowing it to receive and send the

    packets asynchronous to microcontroller.

    Crystal has an 8 Bit mode allowing it to interface to microcontroller.

    There is no capacitor in the IC CS8900A.

    Default setting of the CS8900A is I/O mode

    Interrupts in 8 BIT mode are not supported. So we are using the polling

    process for checking the interrupts.

    POLLING OVER INTERRUPTS

    Polling is the process of repeatedly asking the chip if any events has

    occurred

    CS8900A chip offers the choice of polling when notifying of events like

    incoming packets

  • 8/22/2019 Ethernet Using Embedded Systems

    8/15

    Interrupts are another method like polling. Until now interrupt process is

    used for checking the incoming events

    Interrupts are a way of notifying the surrounding circuitry of an event when

    occurs.

    If interrupts are used, under heavy traffic, ISQ (interrupt service queue)

    register will break. So interrupt line will stop going active.

    If we use polling process this type, of registry breaking will not happen.

    CS8900A CHECKING

    To ensure that the CS8900A is connected & Packetpage pointer value is

    0x3XXX

    Test that the most significant byte is = 3:

    1) Address = PacketPage Pointer = 0x000a

    2) Enable AEN pin and IOR pin

    3) ValueL = DataPin[8]

    4) Disable AEN pin and IOR pin

    5) Address = PacketPage Pointer + 1 = 0x000b

    6) Enable AEN pin and IOR pin

    7) ValueH = DataPin[8]

    8) Disable AEN pin and IOR pin

    9) Check ValueH[7 to 4] = 3, to indicate a good connection

    8-BIT MODE

    I/O mode is the default configuration and is enabling after reset.

    To access the CS8900A in 8-bit mode, 8 I/O ports are used. Each I/O port

    is 16 bits.

    The following table gives a brief summary of each port:

  • 8/22/2019 Ethernet Using Embedded Systems

    9/15

    Offset Type Description

    0x0000 Read/Write Receive/Transmit

    Data0x0002 Read/Write Receive/Transmit

    Data

    0x0004 Write Transmit Command

    0x0006 Write Transmit Length

    0x0008 Read Interrupt Status

    Queue

    0x000a Read/Write PacketPage Pointer

    0x000c Read/Write PacketPage Data

    0x000e Read/Write PacketPage Data

    INITIALISING THE CS8900A

    Before any operation can be performed, the CS8900A must be configured

    at power up or after a reset.

    For each reset, the chip checks whether EEPROM is present or not

    If the EEPROM is present, it can be used to initialize the CS8900A. Other

    wise default configuration is loaded in the registers.

    PIC16C74

    PIC PERIPHERAL INTERFACE CONTROLLER

    It is the backbone of the embedded Ethernet board.

    It has the 40 pins.

    Within the 40 pins, we need only 16 I/O pins.

    3 pins for short of interfacing to the board.

  • 8/22/2019 Ethernet Using Embedded Systems

    10/15

    PORT A has 5 pin wide

    The PIC drives the Embedded Ethernet board and implements some very

    basic TCP/IP functionality.

    The PIC doesn't really have the SRAM needed to fully implement even a

    minimal TCP/IP stack but the application can be specialized to a particular

    task (such as reading transducers).

    Windows Sockets program is included that connects to the test circuit,

    who is listening on UDP port 7 (echo). The echo service sends back any

    data that it receives.

    The programs are all setup to use IP address and Ethernet address (also

    called an OUI- Organizationally Unique Identifier) of any address number

    sequence. Since these are fictitious numbers, you may need to change

    them.

    For examples IP address 192.168.1.2 , Ethernet address-

    00:00:00:12:34:56

  • 8/22/2019 Ethernet Using Embedded Systems

    11/15

    THE CIRCUIT DIAGRAM

    PROGRAMMING THE IC

    Program the microcontroller in the circuit through a parallel attachment to

    pc.

    Controller drives the embedded ether board and implements TCP/IP

    functionality.

    LOADING THE CODE

  • 8/22/2019 Ethernet Using Embedded Systems

    12/15

    Write the program in C language or any other.

    Compile it using the compiler.

    Using the simulators produce the error free program.

    Using interfacing kit and driver transfer the program to the IC .

    Run this program at command prompt.

    This program will send five packets to the board, and the board will send

    them back to the program for testing and then display it.

    WORKING

    Packet is a physical structure that is transmitted over the Ethernet LAN.

    The packet includes the Preamble, Destination Address, Source Address,

    Frame Type, Frame data, CRC.

    Destination Source Frame

    Preamble Address Address Type Frame data

    C R C

    8 octets 6 octets6

    octets2 octets 64-1500 octets 4 octets

    Frame - portion of the packet that contains data to be sent.

    Preamble- contains alternate 1s & 0s for synchronization.

    CRC- Cyclic Redundancy Check for error detection.

    Internal registers of CS8900A are accessed by the Packetpageconfiguration.

    The default configuration of the crystal is I/O mode.

    To access the CS89000A in 8 bit mode 8 I/O ports are used. Each I/O port

    is 16 bit

  • 8/22/2019 Ethernet Using Embedded Systems

    13/15

    PACKET TRANSMITTING

    Writing the transmit command to the CMD port and the length to TX length

    port, ST register is checked.

    PIC16C74 sends the address enable (AEN) control signal to the CS8900A

    for checking the transmitting memory for free space.

    If space is available, CS8900A sends a write (WR) control signal to the

    PIC IC.

    Then PIC begin to writing the data in the order of a data at a time, to

    Receive/Transmit data port 0

    The data is transmitted to the transmitting memory through the 8BIT data

    bus.

    CS8900A sends the data to the Ethernet line to destination, at the traffic

    free time.

    PACKET RECEIVING

    Polling process is used for checking the incoming signal.

    This process is continuously going on until an event is occurred.

    If the packet is available in the Ethernet, then the CS8900A gets in thepacket and store in the receiving memory.

    CS8900A sends destination address of the packet to the PIC16C74

    through the 4BIT address pin.

    PIC16C74 compares the packet address with the already stored address

    in the program.

  • 8/22/2019 Ethernet Using Embedded Systems

    14/15

    If the address is matched, then the PIC16C74 sends the read control

    signal to the CS8900A.

    CS8900A strips the preamble field in the Ethernet packet that is received.

    Then the remaining of the packet is sent to PIC IC through the 8BIT data

    bus.

    This PIC16C74 picks up the data in that packet and then transmit in to the

    host system.

    UDP (echo or ack)

    This is one of the TCP/IP functionality

    This is for checking the remote host is alive or not.

    For this, the system sends a signal to PIC IC

    IC processes it & produces an echo signal, and spreads out in ether

    If the remote host is alive, then it receives the signal, and sends back

    acknowledgement to the transmitting end.

    The transmitting end receives the signal and conforms that the remote

    host is alive.

    Similarly we can implement any basic TCP/IP functionality by

    programming the IC.

    APPLICATIONS

    We can use this where the TCP/IP functionalities are required.

    Embedded Ethernet boards can be mostly used in LAN technology.

    They can be used for accessing remote appliances.

    The data loss in this technology is very minimum.

  • 8/22/2019 Ethernet Using Embedded Systems

    15/15

    It is applied where the data security is required because the internal

    registers are accessed by packet page configuration.

    CONCLUSION

    Ether technology has wide applications in the Local Area Network.

    Ethernet board designed by embedded PIC IC makes handling the board very

    easy. The program of the IC can be changed according to our requirements.

    Since this board is used to determine whether a particular host is alive or not &

    acknowledgements can be issued, this board on LAN enables fast signal transfer

    between computers and we can perform many operations on remote appliances,

    and thus making the communication reliable.

    REFERENCES

    INTERNETWORKING WITH TCP/IP VOLUME I

    -DOUGLAS E.COMER CCNA STUDY GUIDE

    -TODD LAMMLE

    COMPUTER NETWORKS

    -ANDREW S.TANENBAUM

    www.embedded.com

    www.embeddian.com

    www.ethernet.com

    www.esmertec.com

    http://www.embedded.com/http://www.embeddian.com/http://www.ethernet.com/http://www.embeddian.com/http://www.ethernet.com/http://www.embedded.com/