Embedded Wireless Communication Using Irda Standard Protocol
Embedded Wireless Communication Using Irda Standard Protocol
On
Submitted by
J.Ravi Kiran
065006
carried at
Central Electronics Engineering Research Institute
Pilani, Rajasthan
Department of Physics
National Institute Of Technology
Warangal-506004
CERTIFICATE
J.Ravi Kiran, bearing Roll. No. 065006 in partial fulfillment of the degree M.Sc. [Tech]
Engineering physics, with specialization in ELECTRONICS. This report embodies the work
Department of Physics
NIT-Warangal
CERTIFICATE
by Mr. J. Ravi Kiran for the partial fulfilment of the requirement for the award of
degree “MSc tech Engg Physics with specialization Electronics” awarded by
National Institute Of Technology, Warangal embodies work carried out by him
under my supervision at Central Electronics Engineering Research Institute,
Pilani (Rajasthan) from December 2008 to May 2009.
Dr S.S.Sadistap,
Scientist ‘EII’
Agri Electronics Group,
CEERI, Pilani, Rajasthan.
ACKNOWLEDGEMENTS
Words , indeed are inadequate to express my deep sense of gratitude to Dr. Sashikanth
Sadistap Scientist ‘EII’, Agri Electronics Group, CEERI, Pilani for suggesting the problem
for Dissertation work and guidance at every stage of the work. It is a great privilege to have an
opportunity to work and learn a lot under his guidance.
I am also very thankful to my colleagues Mr. Satish Bindal, Ms. Rita Nagar and Ms. Chandni
Anand for their extended cooperation and suggestion.
I also thank Mr. Arun Sharma (STA), Mr. Pankaj Kumar (JTA) and Mr.K.K Pande (TOC)
and all other AEG group members for their concern for our well being from time to time and
helping in completing my project successfully.
Finally I want to acknowledge my thanks to Mr. Vinod Verma, planning and coordination cell
for allowing me to work here and overcome all personal problems faced in Pilani.
I would like to thank Dr. M Sai Shankar project coordinator, Department of Physics, National
Institute of Technology, Warangal for giving me an opportunity to work with elite institute of
Indian scientists.
I would also like to thank my college guide Dr.RLN Sai Prasad for his extended co- operation
during my project work and Head of department of Physics Dr. SVS Ramana Reddy and all
staff members.
Last but not the least, I would like to thank my classmates and friends who directly or indirectly
helped me and made my stay at Pilani memorable and pleasant event.
Abstract
Products embedding the communication technology IrDA defines have been around for over five
years, starting with printers and portable PCs. IrDA is cheap to embed, uses unregulated
spectrum, and is increasingly pervasive in a wide range of devices. From its roots in portable PCs
and printers, IrDA technology is present in virtually all new PDAs, it is emerging in mobile
phones, pagers, digital cameras, and image capture devices. We are sitting on the cusp of the
information appliance age, and IrDA is playing a significant role in enabling the interaction
between information appliances, between information appliances and the information
infrastructure, and between appliances communicating across the information infrastructure.
The Embedded system uses powerful RISC processor PIC18F8722 for developing this system.
The developed system reduces the number of components and thus the overall development cost.
To validate developed system, applied various voltages and tested programs and simulated using
Microchip’s MPLAB simulator and programmed target device using ICD (In circuit Debugger)
successfully. This is very cost- effective system over the existing system.
Contents
1. Introduction
2. Selecting MCP device for infrared applications
3. IrDA protocols
4. How devices connect
5. Using MCP215X/40 developers daughter board with the PICDEM HPC explorer
demo board
6. What is embedded system
7. Introduction to PIC micro controller
8. Results and conclusion
9. Future scope
Appendix
1. Development tools
2. Flow chart
3. Components list
1. Introduction
The two most popular mediums in the wireless arena are Infrared (IR) and Radio Frequency
(RF). When asked to develop a wireless system, you may be concerned about cost, ease
of- design, and distance requirements. IR technologies are better suited for short distance,
low-to-medium data throughput, wireless communication channels. Two common types
of IR technologies are currently in use. These are the TV Remote (TVR) and the IrDA
(Infrared Data Association) standard protocol. The lowest cost wireless connection
technology is TVR. The trade-off with this technology is between distance and bit-rate.
Usually this interface is also unidirectional. If a bidirectional, higher data bandwidth is
required in your application, you may opt to design an IrDA system. This infrared
communication standard has been defined by the IrDA industry-based group. This group has
developed communication standards that are well suited for low-cost, short-range, point-
to-point infrared channels. These types of channels operate over a wide range of speeds
under a cross-platform environment. IrDA standards have been used to install over 300
million low-cost, short-range communication systems in laptops, printers, handheld PCs, and
PDAs, to name a few.
An example of an IrDA standard embedded system is shown in Figure 1. In this system, the
Primary device (PDA) searches for other IrDA standard devices. The Secondary device
(Host Controller and MCP2150) will respond to queries from the Primary device.
The host controller controls the MCP2150 by sending and receiving data through its
UART interface port. The MCP2150, which is positioned between the host controller
UART device and infrared optical transceiver, decodes and encodes the signal. The MCP2150
has two independent baud rates. One of the baud rates is for communication with the
Primary device (PDA). The Primary device negotiates this baud rate with the MCP2150, as
defined in the IrDA standard. The second baud rate is set with the two hardware pins, BAUD1
and BAUD0. This second baud rate is for communication with the host controller. The
IrDA standard is a network protocol and follows a layered approach in its definition.
A model of the IrDA protocol stack is shown in Figure 2. These protocols deal with a
manageable set of responsibilities and also supply needed capabilities to the layers above and
below. The MCP2150 is an IrDA standard Protocol Stack Controller, which provides support
for the IrDA standard protocol “stack” plus bit encoding/decoding. One of the functions of
the MCP2150 is to encode and decode the asynchronous serial data stream
The encode/decode translation format is shown in Figures 3 and 4. Figure 3 shows how the
received IR data from the PDA is decoded to UART-formatted data. Figure 4 demonstrates
how data is taken from the Host Controller, into the MCP2150, and encoded in preparation of
transmission to the PDA. The IrDA bit format is the NAND of the UART signal. The bits are
inverted and high pulses are shortened in order to reduce the optics power consumption. The
MCP2150 decodes the IR data, which is then handled by the protocol handler state machine.
The protocol handler sends the appropriate data bytes to the Host Controller in UART-
formatted serial data. The MCP2150 replaces a wired serial connection with a wireless
solution. The MCP2150 allows designers to add IrDA wireless connectivity to their embedded
system designs easily and cost effectively. With this device, the host UART interface allows
easy connections to PC serial ports. Another product available is the MCP2155, which is best
suited for serial port interfaces (ie., modems). In all cases, these point-to-point systems
connect to devices of “higher intelligence”, such as PCs, PDAs, etc.. This minimizes the cost
of MCP215X type devices. The MCP215X can also serve as a primary device in these point-to-
point applications. Both devices provide support for the IrDA standard protocol “stack” plus
bit encoding and decoding capability.
Another product in this family from Microchip is the MCP2140, which is an IrDA standard
protocol stack controller with a fixed baud communication rate of 9600. Adding IR
connectivity to cost-sensitive, high volume, embedded applications was not really feasible
prior to the introduction of the MCP215X and MCP2140 parts. These parts remove the
requirement of the system designer needing to implement the complex IrDA stack. Finally, the
MCP2120 is an infrared encoder/decoder chip. Sending data using IR light requires some
hardware and specialized communication protocols. These protocol and hardware
requirements are described, in detail, in the IrDA standard specifications. The
encoding/decoding functionality of the MCP2150 is designed to be compatible with the
physical layer component of the IrDA standard. This part of the standard is often referred to as
“IrPHY”.Additionally, the MCP2150 handles the specialized communication protocol,
IrCOMM (9-wire “cooked” service class). A complete list of IrDA standard specifications is
available on the IrDA website (www.irda.org).
Figure 3- Decoding from PDA to MCP
Selecting the appropriate MCP device is very important according to our desired characteristics
and specifications. Table 1 shows the encoder/decoder devices specifications and table 2 shows
the IRCOMM protocol handler devices specifications. According to our needs we will choose
the proper and suitable MCP device.
MCP 21XX selection decision tree
MCP212x selection decision tree
2.1 MCP 2150
The MCP2150 is a cost effective, low pin count (18-pin), easy to use device for
implementing IrDA standard wire- less connectivity. The MCP2150 provides support for
the IrDA standard protocol “stack” plus bit encoding/ decoding. The serial interface baud
rates are user selectable to one of four IrDA standard baud rates between 9600 baud and
115.2 kbaud (9600, 19200, 57600, 115200). The IR baud rates are user selectable to one
of five IrDA standard baud rates between 9600 baud and 115.2 kbaud (9600, 19200,
37400, 57600, 115200). The serial interface baud rate will be specified by the
BAUD1:BAUD0 pins, while the IR baud rate is specified by the Primary Device (during
Discover phase). This means that the baud rates do not need to be the same. The MCP2150
operates in Data Terminal Equipment (DTE) applications and sits between a UART and
an infrared optical transceiver. Figure 5 shows pin diagram of MCP 2150
The MCP2150 encodes an asynchronous serial data stream, converting each data bit to
the corresponding infrared (IR) formatted pulse. IR pulses received are decoded and
then handled by the protocol handler state machine. The protocol handler sends the
appropriate data bytes to the Host Controller in UART formatted serial data. The
MCP2150 supports “point-to-point” applications. That is, one Primary device and one
Secondary device. The MCP2150 operates as a Secondary device. It does not support
“multi-point” applications.
Sending data using IR light requires some hardware and the use of specialized
communication protocols. These protocol and hardware requirements are described,
in detail, by the IrDA standard specifications. The encoding/decoding functionality
of the MCP2150 is designed to be compatible with the physical layer component of the
IrDA standard. This part of the standard is often referred to as “IrPHY”.
2.3 Modulation
The data that the MCP2150 UART received (on the TX pin) that needs to be transmitted (on
the TXIR pin) will need to be modulated. This modulated signal drives the IR transceiver
module. Figure 6 shows the encoding of the modulated signal. Each bit time is comprised of
16-bit clocks. If the value to be transmitted (as determined by the TX pin) is a logic low,
then the TXIR pin will output a low level for 7-bit clock cycles, a logic high level for 3-
bit clock cycles or a minimum of 1.6 µsec. The remaining 6-bit clock cycles will be
low. If the value to transmit is a logic high, then the TXIR pin will output a low level for the
entire 16-bit clock cycles.
Figure 6 - Encoding
2.4 Demodulation
The modulated signal (data) from the IR transceiver module (on RXIR pin) needs to be
demodulated to form the received data (on RX pin). Once demodulation of the data byte
occurs, the data that is received is transmitted by the MCP2150 UART (on the RX
pin). Figure 7 shows the decoding of the modulated signal. Each bit time is comprised
of 16-bit clocks. If the value to be received is a logic low, then the RXIR pin will be a low
level for the first 3-bit clock cycles or a minimum of 1.6 µs. The remaining 13-bit clock
cycles (or differ- ence up to the 16-bit clock time) will be high. If the value to be received is
a logic high, then the RXIR pin will be a high level for the entire 16-bit clock cycles. The
level on the RX pin will be in the appropriate state for the entire 16 clock cycles
Figure 7 – Decoding
3. IrDA Protocols
IrTran-P
IrOBEX
IrLAN
IrCOMM
IrMC
IrDA Lite
Figure 8 shows the IrDA data protocol stack and which components are implemented by
the MCP2150.
The MCP2150 also supports some of the optional protocols for IrDA data. The optional
protocols that the MCP2150 implements are:
Tiny TP
IrCOMM
The MCP2150 provides the following Physical Signal Layer specification support:
o Bidirectional communication
• Communication Range, which sets the end user expectation for discovery, recognition
and performance.
Figure 9 identifies the key parts and hierarchy of the IrDA protocols. The bottom layer is the
Physical layer, IrPHY. This is the part that converts the serial data to and from pulses of IR
light. IR transceivers can’t transmit and receive at the same time. The receiver has to wait
for the transmitter to finish sending. This is some times referred to as a “Half-Duplex”
connection. The IR Link Access Protocol (IrLAP) provides the structure for packets (or
“frames”) of data to emulate data that would normally be free to stream back and forth.
Figure 10 shows how the IrLAP frame is organized. The frame is proceeded by some
number of Beginning of Frame characters (BOFs). The value of the BOF is generally
0xC0, but 0xFF may be used if the last BOF character is a 0xC0. The purpose of multiple
BOFs is to give the other station some warning that a frame is coming.
The IrLAP frame begins with an address byte (“A” field), then a control byte (“C”
field). The control byte is used to differentiate between different types of frames and is also
used to count frames. Frames can carry status, data or commands. The IrLAP protocol has a
command syntax of its own. These commands are part of the control byte. Lastly, IrLAP
frames carry data. This data is the information (or “I”) field. The integrity of the frame is
ensured with a 16-bit CRC, referred to as the Frame Check Sequence (FCS). The 16-bit
CRC value is transmitted LSB first. The end of the frame is marked with an EOF character,
which is always a 0xC1. The frame structure described here is used for all versions of
IrDA protocols used for serial wire replacement for speeds up to 115.2 kbaud.
In addition to defining the frame structure, IrLAP provides the “housekeeping” functions
of opening, closing and maintaining connections. The critical parameters that determine
the performance of the link are part of this function. These parameters control how
many BOFs are used, identify the speed of the link, how fast either party may change from
receiving to transmitting, etc. IrLAP has the responsibility of negotiating these parameters
to the highest common set so that both sides can communicate as quickly, and as
reliably, as possible.
3.4 IrLMP
The MCP2150 implements the IrLMP protocol. The IrLMP protocol provides:
Protocol and service discovery. This is via the Information Access Service
(IAS).
When two devices that contain the IrDA standard feature are connected, there is generally
one device that has something to do and the other device that has the resource to do it. For
example, a laptop may have a job to print and an IrDA standard compatible printer has the
resources to print it. In IrDA standard terminology, the laptop is a Primary device and the
printer is the Secondary device. When these two devices connect, the Primary device must
determine the capabilities of the Secondary device to determine if the Secondary device is
capable of doing the job. This determination is made by the Primary device asking the
Secondary device a series of questions. Depending on the answers to these questions,
the Primary device may or may not elect to connect to the Secondary device.
The queries from the Primary device are carried to the Secondary device using IrLMP. The
responses to these queries can be found in the Information Access Service (IAS) of the
Secondary device. The IAS is a list of the resources of the Secondary device. The
Primary device compares the IAS responses with its requirements and then makes the
decision if a connection should be made. The MCP2150 identifies itself to the Primary
device as a modem.
The MCP2150 implements the LM-IAS. Each LM-IAS entity maintains an information
database to provide:
Information on services for other devices that contain the IrDA standard
feature (Discovery).
This is required so that clients on a remote device can find configuration information
needed to access a service.
3.6 Tiny TP
Tiny TP provides the flow control on IrLMP connections. An optional service of
Segmentation and Reassembly can be handled.
3.7 IrCOMM
IrCOMM provides the method to support serial and parallel port emulation. This is useful
for legacy COM applications, such as printers and modem devices. The IrCOMM standard
is just a syntax that allows the Primary device to consider the Secondary device as a serial
device. IrCOMM allows for emulation of serial or parallel (printer) connections of
various capabilities. The MCP2150 supports the 9-wire “cooked” service class of
IrCOMM. Other service classes supported by IrCOMM are shown in Figure 11.
Figure 11-.Service classes supported by IrCOMM
Other IrDA data protocols have been developed to specific application requirements. These
optional protocols are not supported by the MCP2150. These IrDA data protocols are briefly
described in the following sub-sections.
IrTran-P
IrTran-P provides the protocol to exchange images with digital image capture devices/cameras
IrOBEX
IrOBEX provides OBject EXchange services. This is similar to HTTP.
IrLAN
IrLAN describes a protocol to support IR wireless access to a Local Area Network (LAN).
IrMC
IrMC describes how mobile telephony and communications devices can exchange information.
This information includes phonebook, calendar and message data. Also how to control and real
time voice are handled.
IrDA Lite
IrDA Lite describes how to reduce the application code requirements, while maintaining
compatibility with the full implementation.
4. How devices connect
When two devices implementing the IrDA standard feature establish a connection using the
IrCOMM protocol, the process is analogous to connecting two devices with serial ports
using a cable. This is referred to as a "point-to-point" connection. This connection is
limited to half-duplex operation because the IR transceiver cannot transmit and receive at
the same time. The purpose of the IrDA protocol is to allow this half-duplex link to emulate,
as much as possible, a full-duplex connection. In general, this is done by dividing the data
into “packets”, or groups of data. These packets can then be sent back and forth, when
needed, without risk of collision. The rules of how and when these packets are sent
constitute the IrDA protocols. The MCP2150 supports elements of this IrDA protocol to
communicate with other IrDA standard compatible devices.
When a wired connection is used, the assumption is made that both sides have the same
communications parameters and features. A wired connection has no need to identify
the other connector because it is assumed that the connectors are properly connected. In
the IrDA standard, a connection process has been defined to identify other IrDA
compatible devices and establish a communication link. There are three steps that these
two devices go through to make this connection. They are:
o Discovery Mode
o Normal Connect Mode (NCM)
When a Primary device polls for another device, a nearby Secondary device may
respond. When a Secondary device responds, the two devices are defined to be in the
Normal Disconnect Mode (NDM) state. NDM is established by the Primary device
broadcasting a packet and waiting for a response. These broadcast packets are numbered.
Usually 6 or 8 packets are sent. The first packet is number 0, the last packet is usually
number 5 or 7. Once all the packets are sent, the Primary device sends an ID packet,
which is not numbered.
The Secondary device waits for these packets and then responds to one of the packets. The
packet it responds to determines the “time slot” to be used by the Secondary device. For
example, if the Secondary device responds after packet number 2, then the Secondary
device will use time slot 2. If the Secondary device responds after packet number 0,
then the Secondary device will use time slot 0. This mechanism allows the Primary device
to recognize as many nearby devices as there are time slots. The Primary device will
continue to generate time slots and the Secondary device should continue to respond, even
if there’s nothing to do.
During NDM, the MCP2150 handles all of the responses to the Primary device
without any communication with the Host Controller. The Host Controller is inhibited by
the CTS signal of the MCP2150 from sending data to the MCP2150.
Discovery mode allows the Primary device to determine the capabilities of the
MCP2150 (Secondary device). Discovery mode is entered once the MCP2150 (Secondary
device) has sent an XID response to the Primary device and the Primary device has
completed sending the XIDs and then sends a Broadcast ID. If this sequence is not
completed, then a Primary and Secondary device can stay in NDM indefinitely. When
the Primary device has something to do, it initiates Discovery. Discovery has two parts.
They are:
o Link initialization
o Resource determination
The first step is for the Primary and Secondary devices to determine, and then adjust to,
each other’s hardware capabilities. These capabilities are parameters like:
o Data rate
Both the Primary and Secondary device begin communications at 9600 baud, which is the
default baud rate. The Primary device sends its parameters, then the Secondary device
responds with its parameters. For example, if the Primary supports all data rates up to
115.2 kbaud and the Secondary device only support 19.2 kbaud, the link will be established
at 19.2 kbaud.
Once the hardware parameters are established, the Primary device must determine if the
Secondary device has the resources it requires. If the Primary device has a job to print, then it
must know if it’s talking to a printer, not a modem or other device. This determination is
made using the Information Access Service (IAS). The job of the Secondary device is to
respond to IAS queries made by the Primary device. The Primary device must ask a series
of questions like:
Once discovery has been completed, the Primary device and MCP2150 (Secondary
device) can freely exchange data. The MCP2150 can receive IR data or serial data, but
not both simultaneously. The MCP2150 uses a hardware handshake to stop the local
serial port from sending data while the MCP2150 is receiving IR data. Both the Primary
device and the MCP2150 (Secondary device) check to make sure that data packets are
received by the other without errors. Even when data is required to be sent, the
Primary and Secondary devices will still exchange packets to ensure that the connection
hasn’t, unexpectedly, been dropped. When the Primary device has finished, it then
transmits the close link command to the MCP2150 (Secondary device). The MCP2150
will confirm the close link command and both the Primary device and the MCP2150
(Secondary device) will revert to the NDM state. It is the responsibility of the Host
Controller program to understand the meaning of the data received and how the program
should respond to it. It’s just as if the data were being received by the Host Controller
from a UART.
Figure 12. How devices connect
4.4 Operation
The MCP2150 emulates a null modem connection. The application on the DTE device sees a
virtual serial port. This serial port emulation is provided by the IrDA standard protocols. The
link between the DTE device and the embedded application is made using the
MCP2150. The connection between the MCP2150 and the embedded application is wired
as if there were a null modem connection. The Carrier Detect (CD) signal of the MCP2150
is used to indicate that a valid IrDA standard infrared link has been established between the
MCP2150 and the Primary device. The CD signal should be monitored closely to make
sure that any communication tasks can be completed. The MCP2150 DSR signal indicates
that the device has powered-up, successfully initialized and is ready for service. This signal
is intended to be connected to the DSR input of the Host Controller. If the Host Controller
was directly connected to an IrDA standard Primary device using a serial cable (the
MCP2150 is not present), the Host Controller would be connected to the Primary device’s
DTR output signal.
The MCP2150 generates the CTS signal locally because of buffer limitations.
Hardware handshaking:
The MCP2150 uses a 64-byte buffer for incoming data from the IR Host. Another 64-byte
buffer is provided to buffer data from the UART serial port. When an IR packet begins
the IrCOMM, the MCP2150 handles IR data exclusively (the UART serial port buffer is
not available). A hardware handshaking pin (CTS) is provided to inhibit the Host
Controller from sending serial data while IR Data is being sent or received.
Turnaround Latency:
The MCP2150 has a flexible feature that allows the MCP2150 Device ID to be changed
by the Host Controller. The default ID is “Generic IrDA” and is stored in non-volatile,
electrically erasable programmable memory (EEPROM). The maximum ID String length is
19 bytes. The format of the ID EEPROM is shown in Figure 13. The ID String must
only contain the ASCII characters from 20h to 7Ah (inclusive). The MCP2150 enters into ID
String programming when it exits the reset state and detects that the DTR pin is high and the
RTS pin is low.
A Host Controller connected to the MCP2150 would, typically, perform the following
steps to place the MCP2150 into ID String programming mode:
2. Force the DTR pin high and the RTS pin low.
3. Release the MCP2150 from reset (RESET pin forced high).
4. Wait for device to complete initialization
The MCP2150 uses up to eight signals for the Host UART interface, described in Table 1.
In addition to the UART Transmit and Receive functions (the TX and RX signals), there
are three important functions associated with flow control. These functions do the following:
1. Indicates when the IR link is “established” (the CD signal on the MCP2150).
2. Indicates when the Host Controller can transmit data to the MCP2150 (the CTS
signal).
3. Indicates when the Host Controller can receive data from the MCP2150 (the RTS
signal).
The DTR, DSR and RI signals are not associated with the Host UART Interface flow
control. Depending on the MCP2150 device, these signals may indicate device status
information over the IR link or the signal may not have a function
Until the MCP2150 device has established a link with a Primary device, the Host UART
Interface is essentially “non-operational”. That is, the Host Controller should not send data
(the CTS signal will not be active) and the Host Controller will not receive data (even with
the RTS signal driven active by the Host Controller).
The IR link is “established” once the MCP2150 device has completed Discovery mode
(with a Primary device). If the “IR Link is Established” signal does not become active,
the Primary device has not completed the discovery phase with the MCP2150.
(CTS Operation)
The CTS signal is an output from the MCP2150 device and is used to indicate when the
Host Controller may transmit data on the Host UART. The MCP215X device operation
requires that communication only occur on the MCP2150’s IR Interface or Host UART
Interface at a given time. The MCP2150 will indicate when the Host Controller can
communicate on the Host UART via the CTS signal. When an IR packet begins
(IrCOMM), the MCP2150 handles IR data exclusively and the MCP2150 Host UART
Interface is not available. The CTS signal indicates when the Host Controller can send
serial data and when the Host Controller should not send serial data, since
asynchronous IR Data is being sent or received.
The MCP2150 uses a 64-byte buffer for incoming data from the Host UART serial port.
When the CTS signal is driven active (low), the 64-byte buffer is clear and can receive up
to the maximum 64-byte buffer space. When the CTS signal is driven low, this indicates
the beginning of the UART Receive Buffer’s “Receive Data Window” (the UART Receive
Buffer is empty). This Receive Data Window is 11.9 ms and is “closed” early if the
UART Receive Buffer receives 64 bytes before the 11.9 ms is complete.
(RTS Operation)
When the Host Controller drives the RTS signal active, the MCP2150 is allowed to transmit
data contained in the IR Receive buffer to the Host Controller. The Host Controller should
use this signal to inhibit the MCP2150 from sending data when the Host Controller
does not have the processing bandwidth to “handle” the received data. In many
applications, the Host Controller will not have bandwidth issues, and the RTS signal can be
tied active (low).
When data is in the MCP2150 IR Receive Buffer and RTS is high, the MCP2150 will ignore
the RXIR pin (IR Receive). This means that the IrDA Standard Hand- shaking packets
from the Primary device are not responded to. If the Host Controller does not drive the
RTS signal active (low) by a given time, the Primary device will see the non-response from
the MCP2150 as an “obstruction” and may shut down the link (dependant on the Primary
device used). If the IrDA link is lost due to the MCP2150 not being able to transfer the
“data” to the Host Controller (MCP2150 is waiting for the RTS signal to be driven
low), the MCP2150 will continue to drive CD active (low), which is helpful determining
the cause of the lost link.
In Demo #1, the System 2 unit will receive a character and then stream 250 bytes of data (25
lines of 8 alphanumeric characters plus the return and line feed characters, for a total of 10
characters per line).
The System #1 unit is connected to the PC, while the System #2 unit is not required to be
connected, though it still needs to be powered. The PICDEM HPC Explorer Demo Board is used
to determine the communication baud rate (115,200) via the JP2 and JP1 jumper states. Given
this state, the PICmicro® MCU can then configure the MCP2150 UART baud rate. Power is
supplied over the H1 and H2 interface headers. Jumpers JP3 and JP4 are used to select which
demo program to run. Below table shows the steps for Demo #1.
Figure 15
DEMO#1 STEPS
5.3 DEMO #2 Operation – Echo mode
In Demo #2, the System #2 unit will echo any alpha character received, changing the case of the
character (lowercase to uppercase/uppercase to lowercase). The System #1 unit is connected to
the PC, while the System #2 unit is not required to be connected, though it still needs to be
powered. The PICDEM HPC Explorer Demo Board is used to determine the communication
baud rate (115,200) via the JP2 and JP1 jumper states. Given this state, the PICmicro MCU can
then configure the MCP2150 UART baud rate. Power is supplied over the H1 and H2 interface
headers. Jumpers JP3 and JP4 are used to select which demo program to run. Below table shows
the steps for Demo #2.
Figure 16
DEMO#2 STEPS
5.4 DEMO #3 Operation – Direct to UART (DB9) mode
In Demo #3, the MCP215X/40 Developer‘s Daughter Board will communicate directly to the
PICDEM HPC Explorer Demo Board‘s DB-9 connector (and then to the PC). The PICDEM
HPC Explorer Demo Board is used to determine the communication baud rate (9600) via the JP2
and JP1 jumper states. Given this state, the PICmicro MCU can then configure the MCP2150
UART baud rate. Power is supplied over the H1 and H2 inter- face headers. Jumpers JP3 and JP4
are used to select which demonstration program to run.
Below table shows the steps for Demo #3 operation
Figure 17
DEMO#3 STEPS
Microchip does not imply any suitability to your system requirements of any of these 3rd-party
products. Please evaluate each product‘s specifications and requirements before installing them
on your system. Once the IrCOMM2K driver is installed, it creates a —new“ com port (such as
COM7). This is a virtual serial port that the PC Terminal Emulation application program (such as
HyperTerminal) can be connected to. To ensure that the PC is able to communicate to the
PICDEM HPC Explorer Demo Board plus MCP215X/40 Developer‘s Daughter Board, the
HyperTerminal program must be properly configured. This section describes how the
HyperTerminal program should be configured.
6. What is embedded system
A combination of computer hardware and software, and perhaps additional mechanical or other
parts, designed to perform a dedicated function. In some cases, embedded systems are part of a
larger system or product, as in the case of an antilock braking system in a car. Contrast with
general-purpose computer typically an embedded system consists of a single-board
microcomputer with software in ROM, which starts running a dedicated application as soon as
power is turned on and does not stop until power is turned off.
Reduced cost.
A rich feature of PIC18F452 enables the system to consume lowest power.
Reprogrammable while in the target board.
Portable and compact size.
Security alarm systems, fire alarm systems, and building services systems
Memory technology has no effect on the logical operation of a device. When discussing the
functionality of the device, the memory technology and the voltage range do not matter.
Microchip offers three program memory types:
ROM devices, identified with the letter CR, as in PIC18CRxxx.
EPROM devices, identified with the letter C, as in PIC86Cxxx.
FLASH devices, identified with the letter F, as in PIC18Fxxx..
These devices are electrically erasable, and are offered in a low cost plastic package. Being
electrically erasable, these devices can be both erased and reprogrammed without removal from
the circuit. A device will have the same specifications whether it is used for prototype
development, pilot programs, or production. These are the best for development, because
memory can be erased and reprogrammed in few seconds, allowing extensive test and debug of
the software. Such devices have a typical life of 100.000 erase/write cycles.
7.3 Logical Families:
PIC micro devices are grouped by the size of their Instruction Word. The three current PIC micro
families are:
1. Base-Line: 12-bit Instruction Word length
2. Mid-Range: 14-bit Instruction Word length
3. High-End: 16-bit Instruction Word length
The PIC18F8722 micro controller is actually one of a family of parts distinguished from each
other on the basis of the number of pins available for inputs and outputs.
The use of the various features of this chip enables the designed system to be more efficient. For
now, it is enough to understand that this chip has a rich feature set, permitting it to meet a wide
range of applications.
As can be seen from the figure 18 that each pin of micro controller is having multiple functions.
Figure 18 showing pin diagram of PIC18f8722
nanoWatt TECHNOLOGY
All of the devices in the PIC18F8722 family incorporate a range of features that can significantly
reduce power consumption during operation. Key items include:
• Alternate Run Modes: By clocking the controller from the Timer1 source or the internal
oscillator block, power consumption during code execution can be significantly reduced.
• Multiple Idle Modes: The controller can also run with its CPU core disabled but the
peripherals still active. In these states, power consumption can be reduced even further.
• On-the-fly Mode Switching: The power managed modes are invoked by user code during
operation, allowing the user to incorporate power saving ideas into their application’s software
design.
• Low Consumption in Key Modules: The power requirements for both Timer1 and the
Watchdog Timer are minimized.
EXPANDED MEMORY
The PIC18F8722 family provides ample room for application code and includes members with
48, 64, 96 or 128 Kbytes of code space.
• Data RAM and Data EEPROM: The PIC18F8722 family also provides plenty of room for
application data. The devices have 3936 bytes of data RAM, as well as 1024 bytes of data
EEPROM, for long term retention of nonvolatile data.
• Memory Endurance: The Enhanced Flash cells for both program memory and data EEPROM
are rated to last for many thousands of erase/write cycles, up to 100,000 for program memory
and 1,000,000 for EEPROM. Data retention without refresh is conservatively estimated to be
greater than 40 years.
• Fail-Safe Clock Monitor: This option constantly monitors the main clock source against a
reference signal provided by the internal oscillator. If a clock failure occurs, the controller is
switched to the internal oscillator block, allowing for continued low-speed operation or a safe
application shutdown.
• Two-Speed Start-up: This option allows the internal oscillator to serve as the clock source
from Power-on Reset, or wake-up from Sleep mode, until the primary clock source is available.
Regardless of the memory size, all devices share the same rich set of peripherals, allowing for a
smooth migration path as applications grow and evolve. The consistent pinout scheme used
throughout the entire family also aids in migrating to the next larger device. This is true when
moving between the 64-pin members, between the 80-pin members, or even jumping from 64-
pin to 80-pin devices.
• CCP Modules: All devices in the family incorporate two Capture/Compare/PWM (CCP)
modules and three Enhanced CCP (ECCP) modules to maximize flexibility in control
applications. Up to four different time bases may be used to perform several different operations
at once. Each of the three ECCP modules offer up to four PWM outputs, allowing for a total of
12 PWMs. The ECCPs also offer many beneficial features, including polarity selection,
Programmable Dead-Time, Auto-Shutdown and Restart and Half-Bridge and Full-Bridge Output
modes.
• Self-Programmability: These devices can write to their own program memory spaces under
internal software control. By using a bootloader routine located in the protected boot block at the
top of program memory, it becomes possible to create an application that can update itself in the
field.
• Extended Instruction Set: The PIC18F8722 family introduces an optional extension to the
PIC18 instruction set, which adds 8 new instructions and an Indexed Addressing mode. This
extension, enabled as a device configuration
option, has been specifically designed to optimize re-entrant application code originally
developed in high-level languages, such as C.
• 10-bit A/D Converter: This module incorporates programmable acquisition time, allowing for
a channel to be selected and a conversion to be initiated without waiting for a sampling period
and thus, reduce code overhead.
• Extended Watchdog Timer (WDT): This enhanced version incorporates a 16-bit prescaler,
allowing an extended time-out range that is stable across operating voltage and temperature
8. Results & Conclusions
9. Future scope
Embedded wireless communication using IrDA standard protocols are widely used in day today
life. Many more embedded projects are in process using this IrDA protocols. It is proposed for
replacing RS 232.
Appendix
1. Development tools
MPLAB Integrated Development Environment (IDE) is a free, integrated toolset for the
development of embedded applications employing Microchip's PIC micro ® and dsPIC® micro
controllers. MPLAB IDE runs as a 32-bit application on MS Windows®, is easy to use and
includes a host of free software components for fast application development and super-charged
debugging. MPLAB IDE also serves as a single, unified graphical user interface for additional
Microchip and third party software and hardware development tools. Moving between tools is a
snap, and upgrading from the free simulator to MPLAB ICD 2 or the MPLAB ICE emulator is
done in a flash because MPLAB IDE has the same user interface for all tools.
MPLAB IDE is an easy-to-learn and use Integrated Development Environment (IDE). The IDE
provides firmware development engineers the flexibility to develop and debug firmware for
Microchip’s PIC micro MCU families. MPLAB IDE runs under Microsoft Windows 3.1x and
higher.
A variety of windows allowing you to view the contents of all data and program memory
locations
Source Code, Program Memory, and Absolute Listing windows allows you to view the
source code and its assembly-level equivalent separately and together (Absolute Listing)
The ability to step through execution, or apply Break, Trace, Standard or complex trigger
Points.
The MPASM assembler, the MPLINK object linker and the MPLIB object librarian are typically
used together under MPLAB IDE to provide GUI development of application code for PIC micro
MCU devices.
MPLAB Editor
Use the MPLAB Editor to create and edit text files such as source files, code, and linker script
files.
MPLAB IDE provides legacy support for the PICMASTER and PICMASTER CE emulators.
Many other companies have development tools for Microchip products that work with MPLAB
IDE. Good compatibility for third party tools.
These new features are available in the interim release, MPLAB IDE v7.41:
KeeLoq plug-in allows hex file generation from MPLAB IDE for KeeLoq programming
in Visual PROCMD.
AN851-compliant "Quick Programmer" for PIC18 devices (beta) for implementation of
device self-programming via MPLAB IDE as detailed in Microchip Application Note
AN851.
The Data Monitor and Control Interface (DMCI) allows variables to be fine tuned while
the application is running.
The Project Manager displays symbols and labels from the assembler.
The Project Manager can use files outside the project directory structure to be included in
the project using a relative path.
MPLAB IDE now includes a free copy of the CCS PCB C Compiler.
CodeGuardTM security for 16-bit device’s on-chip advanced code protection features.
New device support –
2. Flow charts
Figure 7: MCP2150 Application Flowchart
Initialize PIC18f8722
Ports
USART
-BRGH =1
-8 – bit
-TX Enabled
-Asynchronous Operation
-Continuous Receive
Figure 8: MCP flow control flow chart
Figure 9: MCP2150 flow control flow chart- transmit
Figure 10: MCP flow control flow chart- receive
3. Components list
MCP215X/40 developers daughter board
PICDEM HPC explorer demo board
Adapter
IR dongle
IrCOMM driver software
MPLAB software
In Circuit Debugger
www. Microchip.com
www.irda.org
PIC micro controller by Myke Predko