Académique Documents
Professionnel Documents
Culture Documents
( DUCAT-NOIDA )
TRAINING REPORT ON
PIC MICROCONTROLLER
BY AKASH GAUR
ACKNOWLEDGEMENT.
PREFACE.
CERTIFICATE.
S O INFOTECH (P) LTD.
AN OVERVIEW.
COMPANY PARTNER – DUCAT (INDIA)
EMBEDDED SYSTEMS
OVERVIEW
MICROCONTROLLERS
INTRODUCTION.
MICROPROCESSORS versus
MICROCONTROLLERS
PIC (SERIES NO. :- 16F877)
INTRODUCTION
STATUS REGISTER
PIN DIAGRAM
INSTRUCTION SET
REFRENCES
ACKNOWLEDGEMENT
I take this opportunity to express my sincere gratitude towards my college Training and
placement officer for forwarding my training letter to S O INFOTECH (DUCAT), Noida
and also to Ms. MENKA SURI (HR MANAGER), for accepting my letter and allowing
me to complete my training in S O INFOTECH (DUCAT ) NOIDA..
I would like to express my deep satisfaction and gratitude towards Ms. MANVI for his
timely guidance and help extended during each stage of my project.
Finally, I would like to thank each and every member of S O INFOTECH AND DUCAT
family for making me feel comfortable and helping me in every possible manner.
AKASH GAUR…
PREFACE
The six to eight weeks training is a part of our 4-year B.TECH course.
Practical industrial training mainly aims at making one aware of industrial
environment; which means that one gets to know the limitation, constraint
and freedom under which an engineer works. One also gets an opportunity
to watch from close quarter that indicates manager relation. This training
mainly involves industrial and complete knowledge about designing,
assembling and manufacturing process of various equipments
manufactured by an industry.
SO INFOTECH is a leading India based software development outsourcing company focused on
delivering the best and most cost-effective solutions to our clients in areas such as e-finance, e-
business and media.
IT Provide Maintenance Services ("off sourcing") for companies ranging from the Global 2000 to
promising startups Combining proven expertise in technology.
S O Infotech is a global IT services and solutions provider. IT provide the winning edge to our clients
by leveraging our business-to-IT connect and deeply committed people. Our clients include industry
leaders, they have found in us a right-size partner who combines scale, stability and customer-
centricity
Strong domain connect
IT’S solutions have a strong domain focus that helps our clients in different industries maximize the
value of their IT spend.
SOINFOTECH PVT.LTD provides complete IT Solution services:
SOFTWARE DEVELOPMENT
SOINFOTECH develops softwares for various clients covering every aspect of life.
We accomplish it with a combination of business and technical knowledge on the
requirement of the clients. With experienced and dedicated lot, we are able to go
with the chosen framework and documentation standards. We use documented
systems to provide full satisfaction on the quality...
SOFTWARE MAINTENANCE
India has emerged as a leading provider of software services and products. Along
with software development services an added area that is gaining much attention is software
support and maintenance services. ...
MULTIMEDIA DEVELOPMENT
SOINFOTECH has been in the field of Multimedia Presentations ever since its
inception. Computer Based Tutorials, Corporate Presentations, Product Presentations, 3D
and 2D Animations and Catalogue Designing...
TESTING SOLUTIONS
WEB SOLUTION
TECHNICAL WRITING
SOINFOTECH offers Technical Writing Services. Our services cover two very
important areas: User Manual and Courseware Development. User Manual covers critical
writing areas...
SEO
SOINFOTECH offers world-class search engine marketing and optimization services that
include SEO consulting services, market research, SEO analysis, and much more…
Backed by a team of professionals
who have successfully trained and
placed students. DUCAT offers a
wide spectrum of technical courses
and application courses designed to
suit every skill level, as well as the
ability to consult directly with
organizations to tailor made learning
plans for any number of employees.
Our products and services have a
wide appeal and are applicable those
in varied positions including network
administrators, systems analysts,
systems architects, test engineers,
software developers, help desk staff,
IT managers, senior executives,
administrative assistants and
business professionals.
EMBEDDED SYSTEM
History
In the earliest years of computers in the 1940–50s, computers were sometimes dedicated to a
single task, but were far too large and expensive for most kinds of tasks performed by
embedded computers of today. Over time however,
the concept of programmable controllers evolved from traditional electromechanical
sequencers, via solid state devices, to the use of computer technology.
One of the first recognizably modern embedded systems was the Apollo Guidance Computer,
developed by Charles Stark Draper at the MIT Instrumentation Laboratory. At the project's
inception, the Apollo guidance computer was
considered the riskiest item in the Apollo project as it employed the then newly developed
monolithic integrated circuits to reduce the size and weight. An early mass-produced
embedded system was the Autonetics D-17 guidance
computer for the Minuteman missile, released in 1961. It was built from transistor logic and
had a hard disk for main memory. When the Minuteman II went into production in 1966, the
D-17 was replaced with a new computer that
was the first high-volume use of integrated circuits. This program alone reduced prices on
quad nand gate ICs from $1000/each to $3/each, permitting their use in commercial products.
Since these early applications in the 1969s, embedded systems have come down in price and
there has been a
dramatic rise in processing power and functionality. The first microprocessor for example, the
Intel 4004, was designed for calculators and other small systems but still required many
external memory and support chips. In 1978
National Engineering Manufacturers Association released a "standard" for programmable
microcontrollers, including almost any computer-based controllers, such as single board
computers, numerical, and event-based controllers.
As the cost of microprocessors and microcontrollers fell it became feasible to replace
expensive knob-based analog components such as potentiometers and variable capacitors with
up/down buttons or knobs read out by a microprocessor even in some consumer products. By
the mid-1980s, most of the common previously external system components had been
integrated into the same chip as the processor and this modern form of the microcontroller
allowed an even more widespread use, which by the end of the decade were the norm rather
than the exception for almost all electronics devices.
The integration of microcontrollers has further increased the applications for which embedded
systems are used into areas where traditionally a computer would not have been considered. A
general purpose and comparatively low-cost
microcontroller may often be programmed to fulfill the same role as a large number of
separate components. Although in this context an embedded system is usually more complex
than a traditional solution, most of the
complexity is contained within the microcontroller itself. Very few additional components
may be needed and most of the design effort is in the software. The intangible nature of
software makes it much easier to prototype and test
new revisions compared with the design and construction of a new circuit not using an
embedded processor.
Characteristics
1. Embedded systems are designed to do some specific task, rather than be a general-purpose
computer for multiple
tasks. Some also have real-time performance constraints that must be met, for reasons such as
safety and
usability; others may have low or no performance requirements, allowing the system hardware
to be simplified to
reduce costs.
2. Embedded systems are not always standalone devices. Many embedded systems consist of
small, computerized
parts within a larger device that serves a more general purpose. For example, the Gibson
Robot Guitar features an
embedded system for tuning the strings, but the overall purpose of the Robot Guitar is, of
course, to play music.[5]
Similarly, an embedded system in an automobile provides a specific function as a subsystem of
the car itself.
3. The program instructions written for embedded systems are referred to as firmware, and are
stored in read-only
memory or Flash memory chips. They run with limited computer hardware resources: little
memory, small or
non-existent keyboard and/or screen.
Microcontroller
Some microcontrollers may use four-bit words and operate at clock rate frequencies
as low as 4 kHz, for low power consumption (milliwatts or microwatts). They will
generally have the ability to retain functionality while waiting for an event such as a
button press or other interrupt; power consumption while sleeping (CPU clock and
most peripherals off) may be just nanowatts, making many of them well suited for
long lasting battery applications. Other microcontrollers may serve performance-
critical roles, where they may need to act more like a digital signal processor (DSP),
with higher clock speeds and power consumption.
The ability to execute a stored set of instructions to carry out user defined tasks.
The ability to be able to access external memory chips to both read and write data
from and to the memory.
microprocessor doesnt have internal ram and rom where as microcontroller has them.
microprocessor doesnt have input and output ports where as microcontroller ha them.
PIC microcontroller
A long time ago General Instruments produced a chip called the PIC1650, described as a
Programmable Intelligent Computer. This chip is the mother of all PIC chips, functionally
close to the current 16C54. It was intended as a peripheral for their CP1600 microprocessor.
Maybe that is why most people think PIC stands for Peripheral Interface Controller.
Microchip has never used PIC as an abbreviation, just as PIC. And recently Microchip has
started calling its PICs microcontrollers PICmicro MCU's.
Core architecture
The PIC architecture is distinctively minimalist. It is characterized by
the following features:
• Separate code and data spaces (Harvard architecture)
• A small number of fixed length instructions
• Most instructions are single cycle execution (4 clock cycles), with single delay cycles upon
branches and skips
• A single accumulator (W), the use of which (as source operand) is implied (i.e. is not
encoded in the opcode)
• All RAM locations function as registers as both source and/or destination of math and other
functions.[5]
• A hardware stack for storing return addresses
• A fairly small amount of addressable data space (typically 256 bytes), extended through
banking
• Data space mapped CPU, port, and peripheral registers
• The program counter is also mapped into the data space and writable (this is used to
implement indirect jumps).
Unlike most other CPUs, there is no distinction between memory space and register space
because the RAM serves
the job of both memory and registers, and the RAM is usually just referred to as the register
file or simply as the
registers.
Pic family
PIC 16x
The PIC 16 family is considered to be a good, general purpose family of PICs. PIC 16s
generally have 3 output ports
to work with. Here are some models in this family that were once common:
• PIC16F877A -- the largest chip of the 16F87x family; has 8 analog inputs
• PIC16F88 -- has 7 analog inputs
• PIC16F628 -- Cheaper than the PIC16F84A, with a built-in 4MHz clock and a UART, but
lacks any analog inputs
PIC 12x
The PIC 12 series are all very small chips, with 8 pins, and 4 available I/O pins. These are
used only when space is a
huge factor, and the PIC doesn't have many responsibilities
PIC 18x
The PIC 18x series are available in a 28 and 40-pin DIP package. They have more ports, more
ADC, etc... PIC 18s
are generally considered to be very high-end microcontrollers, and are even sometimes called
full-fledged CPUs.
Microchip is currently (as of 2007) producing 6 Flash microcontrollers with a USB interface.
All are in the PIC18Fx
family. (The 28 pin PIC18F2450, PIC18F2455, PIC18F2550; and the 40/44 pin PIC18F4450,
PIC18F4455,
PIC18F4550 ).
PIC16F87X
• PIC16F873
• PIC16F874
• PIC16F876
• PIC16F877
Peripheral Features:
Interrupts 14
Timers
Capture/Compare/PWM Modules 2
RA4/T0CKI RA4 can also be the clock input to the Timer0 timer/
counter. Output is open drain type.
RA5/SS/AN4 RA5 can also be analog input4 or the slave select for
the synchronous serial port.
RB1 as port B
RB2 as port B
RE0/RD/AN5 RE0 can also be read control for the parallel slave
port, or analog input5.
RE1/WR/AN6 RE1 can also be write control for the parallel slave
port, or analog input6.
RE2/CS/AN7 RE2 can also be select control for the parallel slave
port, or analog input7.
STATUS REGISTER :
The STATUS register contains the arithmetic status of the ALU, the RESET status
and the bank select bits for data memory. The STATUS register can be the
destination for any instruction, as with any other register. If the STATUS register is
the destination for an instruction that affects the Z, DC or C bits, then the write to
these three bits is disabled. These bits are set or cleared according to the
device logic. Furthermore, the TO and PD bits are not writable, therefore, the result
of an instruction with the STATUS register as destination may be different than
Z: Zero bit
1 = The result of an arithmetic or logic operation is zero
0 = The result of an arithmetic or logic operation is not zero
OPTION-REG REGISTER:
PORT A FUNCTIONS
Name Function
PORTB FUNCTIONS
PORT D FUNCTIONS
0:0 1
0:1 2
1:0 3
1:1 4
REFRENCES
[1] "PICmicro Family Tree", PIC16F Seminar Presentation http:/ / www. microchip. com. tw/
PDF/ 2004_spring/
PIC16F%20seminar%20presentation. pdf
[2] "MOS DATA 1976", General Instrument 1976 Databook
[3] "1977 Data Catalog", Micro Electronics from General Instrument Corporation http:/ /
www. rhoent. com/ pic16xx. pdf
[4] Microchip Technology (27 February 2008). "Microchip Technology Delivers Six Billionth
PIC Microcontroller" (http:/ / www. microchip.
com/ stellent/ idcplg?IdcService=SS_GET_PAGE& nodeId=2018& mcparam=en534302).
Press release. .
[5] http:/ / ww1. microchip. com/ downloads/ en/ DeviceDoc/ 35007b. pdf
[6] "AN869: External Memory Interfacing Techniques for the PIC18F8XXX" (http:/ / ww1.
microchip. com/ downloads/ en/ AppNotes/ 00869b.
pdf). . Retrieved 24 August 2009.
[7] "PIC Paging and PCLATH" (http:/ / massmind. org/ techref/ microchip/ pages. htm)