PIC Microcontrollers and Embedded System: Prachi Prakash Tarekar BBE-19001
PIC Microcontrollers and Embedded System: Prachi Prakash Tarekar BBE-19001
MICROCONTROLLERS
AND EMBEDDED
SYSTEM
Prachi Prakash Tarekar
BBE-19001
1
MORE ON MICROCONTROLLERS
● Microcontrollers integrate all the components of a computer system onto a single chip.
● All components are optimized to perform the functions necessary to control a larger system.
● Size, capability, cost, and power consumption are more important considerations.
● 8 bit microcontrollers have the majority of the market right now, but 16 and 32 bit microcontrollers are
available and gaining market share.
2
COMMON MICROCONTROLLERS
4
WE WILL USE
PIC(PERIPHERAL
INTERFACE
CONTROLLER)
5
The microcontrollers played revolutionary role in embedded
industry after the invention of Intel 8051. The steady and
progressive research in this field gave the industry more
efficient, high-performance and low-power consumption
microcontrollers. The AVR, PIC and ARM are the prime
examples. The new age microcontrollers are getting smarter
and richer by including latest communication protocols like
USB, I2C, SPI, Ethernet, CAN etc.
6
The 8-bit PIC microcontroller is divided into following four
categories on the basis of internal architecture:
2 3 4
1
7
2
1
Base Line PIC Mid-Range PIC
8
4
3
Enhanced Mid-Range PIC18
PIC
PIC18 range is based on 16-bit instruction
These controllers are enhanced version of
architecture incorporating advanced RISC
Mid-Range core. This range of controllers
architecture which makes it highest
provides additional performance, greater
performer among the all 8-bit PIC families.
flash memory and high speed at very low
The PIC18 range is integrated with new age
power consumption. This range of PIC
communication protocols like USB, CAN,
also includes multiple peripherals and
LIN, Ethernet (TCP/IP protocol) to
supports protocols like USART, SPI, I2C
communicate with local and/or internet
and so on.
based networks. This range also supports
the connectivity of Human Interface Devices
like touch panels etc.
9
The following table compares the above four
categories:
Base Line Mid-Range Enhanced Mid- PIC18
Range
No. of Pins 6-40 8-64 8-64 18-100
Program Up to 3 KB Up to 14 KB Up to 28 KB Up to 128 KB
Memory
Data Memory Up to 134 Bytes Up to 368 Bytes Up to 1.5 KB Up to 4 KB
Instruction 12-bit 14-bit 14-bit 16-bit
Length
No. of 33 35 49 83
instruction set
10
MEMORY VARIATIONS IN PIC
MICROCONTROLLER
11
ARCHITECTUR
E
12
● PIC microcontrollers are based on advanced RISC architecture.
● PIC microcontrollers follow Harvard architecture for internal data transfer.
● The data memory is interfaced with 8-bit bus and program memory is interfaced with 16-bit bus as depicted in
the following figure
Simple Block Diagram Of CPU Interfacing With Data And Program Memory In PIC
13
PIC18 Harvard Architecture
14
PIPELINING
15
PIN
CONFIGURATION
16
FEATURES AND PERIPHERALS
FEATURES
C Compiler Optimized Architecture with Optional Extended Instruction Set
100,000 Erase/Write Cycle Enhanced Flash
Program Memory Typical
1,000,000 Erase/Write Cycle Data EEPROM Memory Typical
Flexible oscillator option
o Dual Oscillator Options allow Microcontroller and USB module to Run at different Clock Speeds
17
PERIPHERALS
The PIC18F4550 microcontroller consists of following peripherals:
· I/O Ports: PIC18F4550 have 5 (PORTA, PORTB, PORTC, PORTD and PORTE) 8-bit input-output ports
1. Flash Memory: Flash memory is used to store the program downloaded by a user on to the microcontroller. Flash
memory is non-volatile, i.e., it retains the program even after the power is cut-off. PIC18F4550 has 32KB of Flash
Memory.
2. EEPROM: This is also a non-volatile memory which is used to store data like values of certain variables.
PIC18F4550 has 256 Bytes of EEPROM.
3. SRAM: Static Random Access Memory is the volatile memory of the microcontroller, i.e., it loses its data as soon
as the power is cut off. PIC18F4550 is equipped with 2 KB of internal SRAM.
18
OSCILLATOR: The PIC18F series has flexible clock options. An external clock of up to 48 MHz can be applied to this
series.
ADC INTERFACE: PIC18F4550 is equipped with 13 ADC (Analog to Digital Converter) channels of 10-bits resolution.
TIMERS/COUNTERS: PIC18F4550 has four timer/counters. There is one 8-bit timer and the remaining timers have
option to select 8 or 16 bit mode.
19
EUSART: Enhanced USART (Universal Synchronous and Asynchronous Serial Receiver and Transmitter) module is
full-duplex asynchronous system.
ICSP and ICD: PIC18F series controllers have In Circuit Serial Programming facility to program the Flash Memory
which can be programmed without removing the IC from the circuit.
SPI: PIC18F supports 3-wire SPI communication between two devices on a common clock source. The data rate of
SPI is more than that of USART.
: PIC18F supports Two Wire Interface (TWI) or I2C communication between two devices. It can work as both Master
and Slave device.
20
HOW TO USE PIC18F4550
MICROCONTROLLER/CIRCUIT DIAGRAM:
*/
void main()
{
TRISB=0x00; // PORTB is set to output PORT
LATB=0xFF; // Initially PORTB is set to high (All LEDs on)
while(1)
{
LATB = ~LATB; // Toggle the value of PORTB
Delay_ms(1000); //1-second delay
}
}
22
APPLICATIONS
1 2
Motor Controlling Embedded systems like vending
systems machines, coffee makers, etc
3 4
Analogue signal Temperature controlling
manipulations and systems
measuring systems
23
Street Light that Glows on Detecting
Vehicle Movement:
24
Advantages and Disadvantages
Advantages Disadvantages
• PIC microcontrollers are consistent and • The length of the
faulty of PIC percentage is very less. The program is high due to
performance of the PIC microcontroller using RISC architecture
is very fast because of using RISC (35 instructions)
architecture. • One single accumulator
• When comparing to other is present and program
microcontrollers, power consumption is memory is not
very less and programming is also very accessible
easy.
• Interfacing of an analog device is easy
without any extra circuitry
25
EMBEDDED
SYSTEMS
26
"An embedded system is an isolated system, specially
designed to perform a designated function with the
help of its hardware and embedded software."
27
Basic Structure of an Embedded System:
● Sensor: The sensor calculates and converts the physical amount to an electrical indication, which an
embedded systems engineer can then read. A sensor stores the calculated amount to the memory.
● A-D Converter: An analogue-to-digital converter exchanges the analogue signal sent by the sensor into a digital
signal.
● D-A Converter: A digital-to-analogue converter modifies the digital data fed by the computer to analogue data
● Processor & ASICs: Processors charge the data to calculate the output and stock it to the memory.
● Actuator: An actuator evaluates the D-A Converter's production to the definite output stored and stores the
standard output.
28
Components of an Embedded System
HARDWARE
● These are the mechanical or electronic parts required to form a complete circuit including the microcontroller.
● Choosing the type of hardware for your embedded system depends on the engineer who is designing it.
There are many available options in hardware according to different system's requirements, some of them are being
listed below;
MICROCONTROLLER OR MICROPROCESSOR
● They form the core of an embedded system.
● A microcontroller and a microprocessor are smart efficient devices that are able to store the programming code
within their memory.
● The program stored in the memory is responsible for the execution of designated tasks for which the
embedded system has been designed.
● Microcontrollers usually come in the size of bits, 6 bits,8 bits, 16 bits or 32 bits.
29
SYSTEM ON A CHIP_ SOC
● System on a chip refers to the presence of processor, timers, counters and the interactive interface along with
the other main circuits for regulating power supply, on a single chip.
30
MEMORY
● System on a chip refers to the presence of processor, timers, counters and the interactive interface along with
the other main circuits for regulating power supply, on a single chip.
31
INPUT DEVICES
● Devices such as sensors, actuators, diodes and switches which collect data from the outside environment for
processing are a part of the embedded systems.
● For example, sensor nodes of the wireless network system collect data about the constant change in a physical
environment.
OUTPUT DEVICES
● Output devices help in the display of results after processing the input with the microcontroller.
● Output devices can be LED displays, buzzers, relays, touch screens and many other options available in the
market.
EMBEDDED SOFTWARE
● A system doesn't work without a set of instructions to run it, for task execution we need to write the program
into a programming language such as C, C++ or any other one.
● There a complex process involved in writing the application software for an embedded system using the tools
such as text editor, compiler, linker and debugger.
32
TYPES OF EMBEDDED SYSTEMS
33
EXAMPLES OF A BASIC EMBEDDED
SYSTEMS
34
APPLICATIONS
1 2
Street Light
Vehicle Tracking
Control
3 4
Industrial Temperature
Home Automation Control
system
35
Advantages and Disadvantages
Advantages Disadvantages
• Less probable to encore errors • It has no room for technological
• It has very little interconnections. improvements
• The embedded system is incredibly • The embedded systems are
reliable. hard to maintain
• It has a fast procedure. • It is complicated to take back
• An embedded system is practical for up of the embedded files
mass production. • The embedded systems have
• It can cover a broad diversity of less power supply durability if it
environments is battery operated.
• Embedded System cut down hardware,
which decreases cost overall.
• Offers an improved performance
36
THANKS!
Do you have any questions?
CREDITS: This presentation template was created by
Slidesgo, including icons by Flaticon, and infographics &
images by Freepik