SlideShare a Scribd company logo
Team Emertxe
Microcontrollers
Microcontrollers
●
Introduction
●
System Development Concept (Low Level)
●
Understanding Target
● Work Environment and Development Guidelines
●
Lets Roll Out on Interfaces
Introduction
Introduction
●
What is a Microcontroller
●
General Architectures
●
µP vs µC
● Choosing a Microcontroller
Introduction
What is a Microcontroller?
●
An Integrated Circuit which is capable of being
programmed to preform a specific task.
● The design normally has restrictions on its
– Memory Size
– I/O Capabilities
– Peripheral Functions etc.,
Introduction
General Architectures
●
Shared signals and
memory for code and data
●
Physically separate signals
and storage for code and
data
Introduction
µP vs µC - Microprocessors
●
All separate components
●
More flexible
●
More design complexity
Introduction
µP vs µC - Microcontroller
●
All components in single
chip
● Less flexible
●
Less design complexity
Introduction
Choosing a Microcontroller
●
Applications
●
Performance
●
Price
● Availability
●
Availability of Tools
● Special Capabilities
System Development Concepts
(Low Level)
System Development Concept
●
Host and Target
● Host Tools
System Development Concepts
Host and Target
●
Host:
A system which is used to develop the target.
●
Target:
A system which is being developed for specific
application.
System Development Concepts
Host Tools
●
Software
– Cross Compiler : PICC (Lite Version)
– Code Down Loader : usbpicprog
●
Hardware
– usbpicprog
Understanding Target - EmxPICM02
Understanding Target
●
EmxPICM02 Architecture
●
EmxPICM02 Development Board
●
Understanding the Target Controller
Understanding Target
EmxPICM02 Architecture
Understanding Target
EmxPICM02 Development Board
●
PIC16F887
●
GLCD
●
CLCD
●
SSD
●
LEDs
●
Analog Keypad
●
Matrix Keypad
●
Digital Keypad
●
RS232
●
RS485
●
LIN
●
SPI - EEPROM
●
I2C - DS1338
●
Temperature
Sensor
●
I/O Extensions
●
USB (PIC18F)
Understanding Target Controller
PIC16F887
Understanding Target Controller
PIC16F887
●
Architecture
●
Program Memory
●
Data Memory
● Pin Diagram
●
Clocking
● I/O Config
Understanding Target Controller
PIC16F887 Architecture
Understanding Target Controller
PIC16F887 Program Memory
Understanding Target Controller
PIC16F887 Data Memory
Understanding Target Controller
PIC16F887 Pin Diagram
Understanding Target Controller
PIC16F887 Clocking
Understanding Target Controller
PIC16F887 I/O Config
Work Environment and Development
Guidelines
Work Environment and
Development Guidelines
●
Workspace Creation
●
Code Structure
●
Code Template
● Code Dump Creation
Workspace Creation
Code Structure
Code Template
#ifndef MAIN_H
#define MAIN_H
#include <htc.h>
#endif
#include “main.h”
void init_config(void)
{
/* Initilization Code */
}
void main(void)
{
init_config();
while (1)
{
/* Application Code */
}
}
__CONFIG(DEBUGDIS & LVPDIS & FCMDIS & IESODIS & BORDIS & DUNPROTECT & UNPROTECT &
MCLREN & PWRTDIS & WDTDIS & HS );
__CONFIG(WP0 & BORV21);
Code Dump Creation
●
Compilation using picc would be
$ <path>/picc --chip=16f887 main.c
● Hex code dumping
$ <path>/usbpicprog -p=16F887 -w -e -f pic16f887.hex
Lets Roll Out on Interfaces
Lets Roll Out on Interfaces
●
LEDs
●
Digital Keypad
●
Interrupts
●
Timers
●
Clock I/O
●
Analog Inputs
●
SSDs
●
CLCD
●
Matrix Keypad
●
Analog Keypad
●
Data Storage
Light Emitting Diodes
LEDs
Introduction
●
Simplest device used in most on the embedded
applications as feedback
●
Works just like diodes
●
Low energy consumptions, longer life, smaller size, faster
switching make it usable in wide application fields like
– Home lighting,
– Remote Controls, Surveillance,
– Displays and many more!!
LEDs
Example
● Which side will
work?
LEDs
Example
ON
● Oops :( wrong
choice. Can you
explain why?
LEDs
Example – Correct Choice :)
● Ooh :) looks like
you know the
funda.
LEDs
Circuit on Board
Digital Keypad
Digital Keypad
●
Introduction
●
Interfacing
●
Input Detection
● Bouncing Effect
●
Circuit on Board
Digital Keypad
Introduction
●
Provides simple and cheap interface
●
Comes in different shapes and sizes
●
Preferable if the no of user inputs are less
● Mostly based on tactile switches
●
Some common application of tactile keys are
– HMI
– Mobile Phones
– Computer Mouse etc,.
Digital Keypad
Tactile Switches Interfacing
●
Considering the below design what will be input to the
controller if the switch is pressed?
Digital Keypad
Tactile Switches Interfacing
●
Will this solve
the problem
which may arise
in the design
mentioned in
previous slide?
Digital Keypad
Tactile Switches Interfacing
●
Now will this
solve the
problem which
may arise in the
design
mentioned in
previous slides?
Digital Keypad
Tactile Switches Interfacing
●
What would you call
the this design. Is
there any potential
problem?
Digital Keypad
Tactile Switches Interfacing
Digital Keypad
Triggering Methods
Digital Keypad
Bouncing Effects
Digital Keypad
Circuit on Board
Interrupts
Interrupts
●
Basic Concepts
● Interrupt Source
●
Interrupt Classification
● Interrupt Handling
●
An interrupt is a communication process set up in a
microprocessor or microcontroller in which:
– An internal or external device requests the MPU to stop the
processing
– The MPU acknowledges the request
– Attends to the request
– Goes back to processing where it was interrupted
● Polling
Interrupts
Basic Concepts
●
Loss of Events
●
Response
● Power Management
Interrupts
Interrupt vs Polling
●
External
●
Timers
● Peripherals
Interrupt
Sources
Interrupt
Classification
Interrupt
Handling
Interrupt
Service Routine (ISR)
●
Similar to a subroutine
●
Attends to the request of an interrupting source
– Clears the interrupt flag
– Should save register contents that may be affected by the code
in the ISR
– Must be terminated with the instruction RETFIE
●
When an interrupt occurs, the MPU:
– Completes the instruction being executed
– Disables global interrupt enable
– Places the address from the program counter on the stack
●
Return from interrupt
Interrupt
Service Routine (ISR)
● What / What Not
Interrupt
Latency
●
Latency is determined by:
– Instruction time (how long is the longest)
– How much of the context must be saved
– How much of the context must be restored
– The effort to implement priority scheme
– Time spend executing protected code
bit glow_led;
void interrupt external_pin(void)
{
if (INTFLAG)
{
glow_led = 1;
INTFLAG = 0;
}
}
static void init_config(void)
{
init_external_interrupt();
}
Interrupts
External Interrupt - Example
void main(void)
{
init_config();
while (1)
{
while (!glow_led)
{
if (SWITCH == 1)
{
glow_led = 1;
}
_asm;
NOP;
NOP;
NOP;
_endasm
}
if (glow_led)
{
LED = 0;
}
}
}
Timers
Timers
Introduction
● Resolution  Register Width
● Tick  Up Count or Down Count
● Quantum  System Clock settings
● Scaling  Pre or Post
● Modes
● Counter
● PWM or Pulse Generator
● PW or PP Measurement etc.,
● Examples
Timers
Example
● Requirement – 5 pulses of 8 µsecs
● Resolution – 8 Bit
● Quantum – 1 µsecs
● General
Timers
Example
Clock I/O
Clock I/O
Introduction
● Most peripheral devices depends on Clocking
● Controllers have to generate clock to communicate with
the peripherals
● Some of the Controllers internal peripherals work on
external clocking provided at it pins
Clock I/O
Introduction
● The activity on the devices could be on
– Edges
– Levels
Clock I/O
PWM
● Sometimes called as PDM (Pulse Duration Modulation)
● A technique used to vary the active time vs inactive time in
a fixed period.
● Mostly used to control the average voltage of the Load
connected.
● Used in wide applications like Motor Controls, Lamp
Dimmers, Audio, Power Controls and many more..
Clock I/O
PWM
Analog Inputs
Analog Inputs
Introduction
●
Very important peripheral in embedded systems for real
time activities
● Multiplexed with normal GPIO
●
Comes with different resolutions
Analog Inputs
SAR
Seven Segment Displays
SSD
Introduction
●
Array of LEDs connected internally
●
Possible configurations are common cathode and common
anode
●
Very good line of sight
●
Used in many applications
SSD
Introduction
Segment Data – 10100100 & Control Line - C2
Segment Data – 10010010 & Control Line - C3
Let's assume that we are using common anode dis
Data map - hgfedcba
Circuit
SSD
Example
Segment Data – 10100100 & Control Line -
C2
SSD
Example
Segment Data – 10010010 & Control Line -
C3
SSD
Example
SSD
Example
SSD
Example
SSD
Example
SSD
Circuit on Board
Character Liquid Crystal Display
CLCD
Introduction
●
Most commonly
used display ASCII
characters
●
Some
customization in
symbols possible
●
Communication
Modes
– 8 Bit Mode
– 4 Bit Mode
CLCD
Circuit on Board
Matrix Keypad
Matrix Keypad
Introduction
● Used when the more number of user inputs is required and
still want to save the some controller I/O lines
● Uses rows and columns concept
● Most commonly used in Telephonic, Calculators, Digital
lockers and many more applications
Matrix Keypad
Example
Analog Keypad
● Used when the more number of user inputs is required
and still want to save the some controller I/O lines
● Uses a single controller I/O
● Uses voltage divider concept
● Less precise when more number of switches added
Analog Inputs
Introduction
Analog Inputs
Example
Data Storage
● Mostly used in every Embedded System
● The size and component (memory) of storage depends
upon the requirements
● Modern controllers has built in data storage
– EEPROM
– Data Flash etc.
Data Storage
Introduction
Thank You

More Related Content

What's hot (20)

PDF
Interview preparation workshop
Emertxe Information Technologies Pvt Ltd
 
PDF
C++11 & C++14
CyberPlusIndia
 
PDF
C Programming - Refresher - Part III
Emertxe Information Technologies Pvt Ltd
 
PPTX
Introduction to C Programming
Amr Ali (ISTQB CTAL Full, CSM, ITIL Foundation)
 
PDF
Embedded Operating System - Linux
Emertxe Information Technologies Pvt Ltd
 
PDF
Linux Internals - Part I
Emertxe Information Technologies Pvt Ltd
 
PDF
Introduction to Embedded System
Emertxe Information Technologies Pvt Ltd
 
PDF
Intro to Embedded OS, RTOS and Communication Protocols
Emertxe Information Technologies Pvt Ltd
 
PPTX
Visual studio code
MVP Microsoft
 
PDF
Resume Preparation - Workshop
Emertxe Information Technologies Pvt Ltd
 
PDF
Introduction to Go programming language
Slawomir Dorzak
 
PDF
Android Tools for Qualcomm Snapdragon Processors
Qualcomm Developer Network
 
PPTX
Different types of Editors in Linux
Bhavik Trivedi
 
PDF
88 c-programs
Leandro Schenone
 
PPTX
Modern Programming Languages - An overview
Ayman Mahfouz
 
PDF
GPU - DisplayPort Interface
Benson Tao
 
PPTX
Data Types, Variables, and Constants in C# Programming
Sherwin Banaag Sapin
 
Interview preparation workshop
Emertxe Information Technologies Pvt Ltd
 
C++11 & C++14
CyberPlusIndia
 
C Programming - Refresher - Part III
Emertxe Information Technologies Pvt Ltd
 
Embedded Operating System - Linux
Emertxe Information Technologies Pvt Ltd
 
Introduction to Embedded System
Emertxe Information Technologies Pvt Ltd
 
Intro to Embedded OS, RTOS and Communication Protocols
Emertxe Information Technologies Pvt Ltd
 
Visual studio code
MVP Microsoft
 
Resume Preparation - Workshop
Emertxe Information Technologies Pvt Ltd
 
Introduction to Go programming language
Slawomir Dorzak
 
Android Tools for Qualcomm Snapdragon Processors
Qualcomm Developer Network
 
Different types of Editors in Linux
Bhavik Trivedi
 
88 c-programs
Leandro Schenone
 
Modern Programming Languages - An overview
Ayman Mahfouz
 
GPU - DisplayPort Interface
Benson Tao
 
Data Types, Variables, and Constants in C# Programming
Sherwin Banaag Sapin
 

Similar to Micro-controllers (PIC) based Application Development (20)

PPTX
ARDUINO BASED HEART BEAT MONITORING SYSTEM
MOHAMMAD HANNAN
 
PDF
Open_IoT_Summit-Europe-2016-Building_a_Drone_from_scratch
Igor Stoppa
 
PPTX
Computer Architecture and Organization
ssuserdfc773
 
PDF
A Journey into Hexagon: Dissecting Qualcomm Basebands
Priyanka Aash
 
PPTX
Arduino_Beginner.pptx
aravind Guru
 
PDF
ELC 2016 - I2C hacking demystified
Igor Stoppa
 
PPTX
Microcontroller from basic_to_advanced
Imran Sheikh
 
PPTX
Arduino_Beginner.pptx
shivagoud45
 
DOCX
summer training report (2)
Kavya Gupta
 
PPSX
Arduino by yogesh t s'
tsyogesh46
 
PDF
Design of Software for Embedded Systems
Peter Tröger
 
PPT
Embedded systems-unit-1
Prabhu Mali
 
PPTX
M&amp;i(lec#01)
Majid Mehmood
 
PDF
E-Note_19681_Content_Document_20240512114009AM.pdf
gowdapriya678
 
PPT
Introduction to Blackfin BF532 DSP
Pantech ProLabs India Pvt Ltd
 
PPTX
Summer training embedded system and its scope
Arshit Rai
 
ODP
UWE Linux Boot Camp 2007: Hacking embedded Linux on the cheap
edlangley
 
PDF
Introduction to FPGA, VHDL
Amr Rashed
 
PDF
plc-131022133632-phpapp02.pdfNBCvNVhbig knobh
SushilSinghgautam
 
PDF
Plc 131022133632-phpapp02
Dhanabal sundar .M
 
ARDUINO BASED HEART BEAT MONITORING SYSTEM
MOHAMMAD HANNAN
 
Open_IoT_Summit-Europe-2016-Building_a_Drone_from_scratch
Igor Stoppa
 
Computer Architecture and Organization
ssuserdfc773
 
A Journey into Hexagon: Dissecting Qualcomm Basebands
Priyanka Aash
 
Arduino_Beginner.pptx
aravind Guru
 
ELC 2016 - I2C hacking demystified
Igor Stoppa
 
Microcontroller from basic_to_advanced
Imran Sheikh
 
Arduino_Beginner.pptx
shivagoud45
 
summer training report (2)
Kavya Gupta
 
Arduino by yogesh t s'
tsyogesh46
 
Design of Software for Embedded Systems
Peter Tröger
 
Embedded systems-unit-1
Prabhu Mali
 
M&amp;i(lec#01)
Majid Mehmood
 
E-Note_19681_Content_Document_20240512114009AM.pdf
gowdapriya678
 
Introduction to Blackfin BF532 DSP
Pantech ProLabs India Pvt Ltd
 
Summer training embedded system and its scope
Arshit Rai
 
UWE Linux Boot Camp 2007: Hacking embedded Linux on the cheap
edlangley
 
Introduction to FPGA, VHDL
Amr Rashed
 
plc-131022133632-phpapp02.pdfNBCvNVhbig knobh
SushilSinghgautam
 
Plc 131022133632-phpapp02
Dhanabal sundar .M
 
Ad

More from Emertxe Information Technologies Pvt Ltd (20)

Ad

Recently uploaded (20)

PDF
Chris Elwell Woburn, MA - Passionate About IT Innovation
Chris Elwell Woburn, MA
 
PDF
HCIP-Data Center Facility Deployment V2.0 Training Material (Without Remarks ...
mcastillo49
 
PDF
Transcript: New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
PDF
Presentation - Vibe Coding The Future of Tech
yanuarsinggih1
 
PDF
"AI Transformation: Directions and Challenges", Pavlo Shaternik
Fwdays
 
PDF
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
PDF
Using FME to Develop Self-Service CAD Applications for a Major UK Police Force
Safe Software
 
PPTX
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
PDF
July Patch Tuesday
Ivanti
 
PDF
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
PDF
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 
PDF
POV_ Why Enterprises Need to Find Value in ZERO.pdf
darshakparmar
 
PDF
LLMs.txt: Easily Control How AI Crawls Your Site
Keploy
 
PDF
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
PDF
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
PDF
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
PDF
Fl Studio 24.2.2 Build 4597 Crack for Windows Free Download 2025
faizk77g
 
PDF
Mastering Financial Management in Direct Selling
Epixel MLM Software
 
PPTX
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
PDF
Achieving Consistent and Reliable AI Code Generation - Medusa AI
medusaaico
 
Chris Elwell Woburn, MA - Passionate About IT Innovation
Chris Elwell Woburn, MA
 
HCIP-Data Center Facility Deployment V2.0 Training Material (Without Remarks ...
mcastillo49
 
Transcript: New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
Presentation - Vibe Coding The Future of Tech
yanuarsinggih1
 
"AI Transformation: Directions and Challenges", Pavlo Shaternik
Fwdays
 
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
Using FME to Develop Self-Service CAD Applications for a Major UK Police Force
Safe Software
 
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
July Patch Tuesday
Ivanti
 
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 
POV_ Why Enterprises Need to Find Value in ZERO.pdf
darshakparmar
 
LLMs.txt: Easily Control How AI Crawls Your Site
Keploy
 
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
Fl Studio 24.2.2 Build 4597 Crack for Windows Free Download 2025
faizk77g
 
Mastering Financial Management in Direct Selling
Epixel MLM Software
 
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
Achieving Consistent and Reliable AI Code Generation - Medusa AI
medusaaico
 

Micro-controllers (PIC) based Application Development