1. Kumbhar Trupti Sambhaji, Prof. Patil S.B./ International Journal of Engineering Research and
Applications (IJERA) ISSN: 2248-9622 www.ijera.com
Vol. 2, Issue 4, July-August 2012, pp.977-979
Design of PIC Based Ethernet Interface to Control the Industrial
Parameters
Kumbhar Trupti Sambhaji1, Prof. Patil S.B.2
1
(Department of Electronics & Telecommunication , D.Y.Patil college of Engg. & Tech., Kolhapur)
2
(Department of Electronics & Telecommunication, D.Y.Patil college of Engg. & Tech., Kolhapur)
ABSTRACT
Currently device with microcontroller everywhere‟. No computer should be island. With
has been widely used in industrial field. Ethernet file sharing and printer sharing among
However a large number of devices don’t have machines become possible. Again, installation of
the network interface and data from them can Ethernet is easier and less expensive than other
not be transmitted in network. A design of PIC network protocol. It offers efficient ways to
–microcontroller interfaced with the Ethernet is connect across MAC.PC, Linux, UNIX
presented. In the design, existing SPI serial workstations.
devices can be converted into a network Thus this paper suggests LAN to SPI
interface peripheral to obtain compatibility with communication using Ethernet. To monitor
the network. The design mainly consists of SPI industrial parameters like temperature, speed etc
communication module, controller module and numbers of monitoring equipments are used. Here
Ethernet interface module. This paper will we proposed LAN to SPI interface to monitor these
implement LAN to SPI communication using industrial parameters with the help of different
Ethernet module. sensors.
The other target application can be
Keywords--PIC-microcontroller, SPI, Ethernet, industrial automation, building automation, home
LAN control etc.
I. INTRODUCTION
Data collection is a complete system, II.STRUCTURE OF HARDWARE
which the sensor and other measure equipment and SYSTEM
the digital measure cell are contact with each other.
It is the board used in weather, electric power, PC
chemical engineering etc. However, many
applications bring forward many rigorous demands.
How to found a useful, extensively, agility, high
efficiency data collection system is a important and
difficult problem. Data collection technique is a
significant fact of a modern science research and Ethernet
Signal
technology development. controller conditioner
Traditional data collection systems use the PIC-micro
single-chip as the kernel of the system. The
precision and the operation ability of the system is Controller
finite, the interface is not easy. Again, the distance
of data transferring, capability of the data storage is Sensor
also finite. With the embedded new technology
development, data collection system import
multitask operation system. This have many
characteristics, such as rapidness of the collection
velocity, easy interface etc. The technology will
bring into play important effect on industry Display
development.
LAN supplies networking capability to Figure 1. Structure of hardware system
group of computers in close proximity to each
other such as in an office, school or a home. Most As shown in above diagram the sensor
LANs are built with relatively inexpensive output will be given to the signal conditioner.
hardware. Again the output of the signal conditioner is given
Ethernet is a physical and data link layer to the PIC-microcontroller, where PIC-
technology for LANs. Ethernet means „network of microcontroller will convert hexadecimal data to
977 | P a g e
2. Kumbhar Trupti Sambhaji, Prof. Patil S.B./ International Journal of Engineering Research and
Applications (IJERA) ISSN: 2248-9622 www.ijera.com
Vol. 2, Issue 4, July-August 2012, pp.977-979
BCD & BCD to ASCII. After converting the data may be microcontrollers, serial EEPROMs, shift
to the ASCII format, it will be displayed on the registers, display drivers, A/D converters etc. SPI
LCD. The data transfer between PC & PIC- module has flexible operating modes as 8-bit data
microcontroller will be done through the Ethernet. transmission/reception., Master and slave mode,
For this purpose the necessary initialization for the Framed SPI mode. The purposed mode in this
Ethernet will be done through the PIC- paper is Master and Slave mode.
microcontroller. In master/slave mode, master device
PIC-microcontroller is commonly used in initiates the data frame. Multiple slave devices are
robotics and control applications. Its potential use allowed with individual salve select (chip select).
is in data acquisition and measurements. The SPI bus can operate with a single master
PIC family is logical choice for many device with one or more salve devices.
performance applications where cost is preliminary
considerations.
SCLK SCLK
MOSI MOSI
MISO MISO
SS SS
Master Slave
Figure 3. Single master and single slave
Above figure shows single master &
single slave. At start of the communication, master
first configures the clock, where the frequencies
range from 1-70 MHz. Master sends a bit on MOSI
line and slave reads it from that same line. Again,
slave sends a bit on MISO line and master reads it
from that same line.
Ethernet controller is designed to serve as
an Ethernet network interface for any controller
equipped with SPI.
Here we suggest Ethernet controller
ENC28J60 which meets all of the IEEE 802.3
Figure 2. Various features of 16F877A PIC specifications. It incorporates a number of packet
filtering schemes to limit incoming packets. It also
PIC-microcontroller mentioned in this provides an internal DMA module for fast data
paper is 18F877A having features like, high throughput and hardware assisted IP checksum
performance RISC (Reduced Instruction Set CPU) calculations. Communication with the host
architecture, operating frequency is 20MHz, only controller is implemented via two interrupt pins
35 single word instructions, two 8-bit and one 16- and the SPI, with data rates of up to 10 Mb/s. Two
bit Timers, fifteen Interrupts, built in support for dedicated pins are used for LED link and network
SPI, USART, A/D etc., 8K programmable memory activity indication.
& 368 data bytes, five I/O Ports as A, B, C, D, E The ENC28J60 consists of seven major
etc. functional
Serial Peripheral Interface (SPI) will be blocks:
used to interface the sensor to PIC. With SPI we
can connect as many devices as many as pins we 1. An SPI interface that serves as a communication
have on the PIC-microcontroller. The speed of the channel between the host controller and the
communication between ICs is much faster as SPI ENC28J60.
can be used in full duplex mode. SPI is 2. Control Registers which are used to control and
synchronous serial interface useful for monitor the ENC28J60.
communicating with the other peripheral or 3. A dual port RAM buffer for received and
microcontroller devices. These peripheral devices transmitted data packets.
978 | P a g e
3. Kumbhar Trupti Sambhaji, Prof. Patil S.B./ International Journal of Engineering Research and
Applications (IJERA) ISSN: 2248-9622 www.ijera.com
Vol. 2, Issue 4, July-August 2012, pp.977-979
4. An arbiter to control the access to the RAM it is transferred to the PC through Ethernet
buffer when requests are made from DMA, controller with the help of the SPI communication.
transmit and receive blocks. Thus we can see the web page which includes the
5. The bus interface that interprets data and necessary title and the run time real temperature.
commands received via the SPI interface.
6. The MAC (Medium Access Control) module IV.RESULTS
that Thus after implementing the system we
implements IEEE 802.3 compliant MAC logic. can observe the temperature on the LCD as shown
7. The PHY (Physical Layer) module that encodes in diagram below:-
and decodes the analog data that is present on
the twisted pair interfaces.
The device also contains other support
blocks, such as the oscillator, on-chip voltage
regulator, level translators to provide 5V tolerant
I/Os and system control logic.
The controller communicates with the
Ethernet controller via its data and address lines to
initialize the chip, poll it for packet status and
send/receive data.
The primary use of a signal conditioner
is to convert a signal that may be difficult to read
by conventional instrumentation into a more easily V. CONCLUSION
read format. Many applications require In this paper, the system is implemented
environment or structural measurements such as to monitor industrial parameters like temperature,
temperature and vibration from sensors. These speed etc. with the help of the different sensors
sensors, in turn require signal conditioning before a which can act as a network node using LAN to SPI
data acquisition device can effectively and communication. LAN provides higher data transfer
accurately measure the signal. Signal conditioning rates and lack of leased telecommunication lines.
provides more accurate sensor measurements. The Workstations can share peripheral devices thus
other functions that may take place such as, cheaper. Again installation of Ethernet is easier and
amplification, electrical isolation that breaks the less expensive than the other network protocols,
galvanic path between the input and output signal, also provides connectivity to backbone.SPI
linearization, cold junction compensation, provides full duplex communication, higher
excitation, filtering etc. throughput, simple hardware interfacing and
A sensor is a device that measures a typically requires lower power. The system
physical quantity and converts it into a signal designed in this paper provides the characteristics
which can be read by an observer or by an of low cost and strong processing ability while the
instrument. It responds to an input quantity by electronic unit is simple and reliable.
generating a functionally related output usually in
the form of an electrical or optical signal. REFERENCES
Commonly monitored parameters are temperature, [1] Zhao Ruimei; Wang Mei; “Design of ARM-based
humidity, pressure, wind direction and speed, embedded Ethernet interface” Computer
Engineering and Technology (ICCET), 2010 2nd
sound intensity etc. The various applications
International Conference.
include cars, machines, aerospace, medicine, [2] Szekacs, A.; Szakall, T.; Hegykozi, .; “Realising
manufacturing and robotics etc. the SPI communication in a multiprocessor system”
Intelligent Systems and Informatics, 2007. SISY
II. SOFTWARE DESIGN 2007. 5th International Symposium.
With the help of MikroC compiler the [3] dev.emcelettronica.com/i2c-or-spi-ser,”An
code for PIC16F877A can be written. MikorC is introduction to I2C and SPI protocols”.
[4] Ganz, A.; Phonphoem, A.; Llopis, N.; Kim, I.;
designed to provide the programmer with the
Wongthavarawat, K.; Ganz, Z.;” Converged voice,
easiest possible solution for developing application video and data wired-wireless LANs testbed”.
for the embedded systems. It allows user to quickly Military Communications Conference Proceedings,
develop and deploy complex application. We can 1999. MILCOM 1999. IEEE
write C source code using the built I code editor. [5] Chen Xiao-long Zhou Wen-hua, “ENC28J60
Here MikroC libraries can be use to speed up the Ethernet controller applied in the network's three-
development. In this code we used the syntaxes ad phase Electric Energy meter” Networked
functions provided by MikroC compiler. Computing (INC), 2010 6th International
The html code is written in the PIC- Conference.
[6] Microchip, “ENC28J60 Datasheet”
microcontroller memory as per the requirement and
[7] Microchip, “PIC16F87XA Datasheet”.
979 | P a g e