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

PDF
Linux systems - Getting started with setting up and embedded platform
PDF
C Programming - Refresher - Part I
PDF
Introduction to OpenCL
PDF
Embedded Android : System Development - Part II (Linux device drivers)
PDF
Linux programming - Getting self started
Linux systems - Getting started with setting up and embedded platform
C Programming - Refresher - Part I
Introduction to OpenCL
Embedded Android : System Development - Part II (Linux device drivers)
Linux programming - Getting self started

What's hot (20)

PDF
Introduction to Embedded System
PDF
C Programming - Refresher - Part II
PDF
Lcu14 306 - OP-TEE Future Enhancements
PDF
Jagan Teki - U-boot from scratch
PPT
pushdown automata
PDF
Intro to Embedded OS, RTOS and Communication Protocols
PDF
Linux Internals - Part III
PPTX
introduction to c language
PDF
Linux kernel modules
PDF
Eclipse - Installation and quick start guide
PDF
Zabbix for Monitoring
PPT
Learning AOSP - Android Booting Process
PPTX
Aidl service
PDF
LCA14: LCA14-502: The way to a generic TrustZone® solution
PDF
C Programming - Refresher - Part III
PPTX
Embedded c c++ programming fundamentals master
PDF
Introduction to Embedded System
C Programming - Refresher - Part II
Lcu14 306 - OP-TEE Future Enhancements
Jagan Teki - U-boot from scratch
pushdown automata
Intro to Embedded OS, RTOS and Communication Protocols
Linux Internals - Part III
introduction to c language
Linux kernel modules
Eclipse - Installation and quick start guide
Zabbix for Monitoring
Learning AOSP - Android Booting Process
Aidl service
LCA14: LCA14-502: The way to a generic TrustZone® solution
C Programming - Refresher - Part III
Embedded c c++ programming fundamentals master
Ad

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

PPTX
ARDUINO BASED HEART BEAT MONITORING SYSTEM
PDF
Open_IoT_Summit-Europe-2016-Building_a_Drone_from_scratch
PPTX
Computer Architecture and Organization
PDF
A Journey into Hexagon: Dissecting Qualcomm Basebands
PPTX
Arduino_Beginner.pptx
PDF
ELC 2016 - I2C hacking demystified
PPTX
Microcontroller from basic_to_advanced
PPTX
Arduino_Beginner.pptx
DOCX
summer training report (2)
PPSX
Arduino by yogesh t s'
PDF
Design of Software for Embedded Systems
PPT
Embedded systems-unit-1
PPTX
M&amp;i(lec#01)
PDF
E-Note_19681_Content_Document_20240512114009AM.pdf
PPT
Introduction to Blackfin BF532 DSP
PPTX
Summer training embedded system and its scope
ODP
UWE Linux Boot Camp 2007: Hacking embedded Linux on the cheap
PDF
Introduction to FPGA, VHDL
PDF
plc-131022133632-phpapp02.pdfNBCvNVhbig knobh
PDF
Plc 131022133632-phpapp02
ARDUINO BASED HEART BEAT MONITORING SYSTEM
Open_IoT_Summit-Europe-2016-Building_a_Drone_from_scratch
Computer Architecture and Organization
A Journey into Hexagon: Dissecting Qualcomm Basebands
Arduino_Beginner.pptx
ELC 2016 - I2C hacking demystified
Microcontroller from basic_to_advanced
Arduino_Beginner.pptx
summer training report (2)
Arduino by yogesh t s'
Design of Software for Embedded Systems
Embedded systems-unit-1
M&amp;i(lec#01)
E-Note_19681_Content_Document_20240512114009AM.pdf
Introduction to Blackfin BF532 DSP
Summer training embedded system and its scope
UWE Linux Boot Camp 2007: Hacking embedded Linux on the cheap
Introduction to FPGA, VHDL
plc-131022133632-phpapp02.pdfNBCvNVhbig knobh
Plc 131022133632-phpapp02
Ad

More from Emertxe Information Technologies Pvt Ltd (20)

Recently uploaded (20)

PDF
Electrocardiogram sequences data analytics and classification using unsupervi...
PDF
SaaS reusability assessment using machine learning techniques
PDF
Accessing-Finance-in-Jordan-MENA 2024 2025.pdf
PPTX
SGT Report The Beast Plan and Cyberphysical Systems of Control
PDF
Early detection and classification of bone marrow changes in lumbar vertebrae...
PPTX
MuleSoft-Compete-Deck for midddleware integrations
PDF
Rapid Prototyping: A lecture on prototyping techniques for interface design
PDF
Planning-an-Audit-A-How-To-Guide-Checklist-WP.pdf
PDF
Auditboard EB SOX Playbook 2023 edition.
PDF
EIS-Webinar-Regulated-Industries-2025-08.pdf
PDF
Connector Corner: Transform Unstructured Documents with Agentic Automation
PPTX
future_of_ai_comprehensive_20250822032121.pptx
PDF
giants, standing on the shoulders of - by Daniel Stenberg
PDF
IT-ITes Industry bjjbnkmkhkhknbmhkhmjhjkhj
PDF
Introduction to MCP and A2A Protocols: Enabling Agent Communication
PDF
A symptom-driven medical diagnosis support model based on machine learning te...
PDF
Comparative analysis of machine learning models for fake news detection in so...
PDF
Lung cancer patients survival prediction using outlier detection and optimize...
PDF
5-Ways-AI-is-Revolutionizing-Telecom-Quality-Engineering.pdf
PDF
Improvisation in detection of pomegranate leaf disease using transfer learni...
Electrocardiogram sequences data analytics and classification using unsupervi...
SaaS reusability assessment using machine learning techniques
Accessing-Finance-in-Jordan-MENA 2024 2025.pdf
SGT Report The Beast Plan and Cyberphysical Systems of Control
Early detection and classification of bone marrow changes in lumbar vertebrae...
MuleSoft-Compete-Deck for midddleware integrations
Rapid Prototyping: A lecture on prototyping techniques for interface design
Planning-an-Audit-A-How-To-Guide-Checklist-WP.pdf
Auditboard EB SOX Playbook 2023 edition.
EIS-Webinar-Regulated-Industries-2025-08.pdf
Connector Corner: Transform Unstructured Documents with Agentic Automation
future_of_ai_comprehensive_20250822032121.pptx
giants, standing on the shoulders of - by Daniel Stenberg
IT-ITes Industry bjjbnkmkhkhknbmhkhmjhjkhj
Introduction to MCP and A2A Protocols: Enabling Agent Communication
A symptom-driven medical diagnosis support model based on machine learning te...
Comparative analysis of machine learning models for fake news detection in so...
Lung cancer patients survival prediction using outlier detection and optimize...
5-Ways-AI-is-Revolutionizing-Telecom-Quality-Engineering.pdf
Improvisation in detection of pomegranate leaf disease using transfer learni...

Micro-controllers (PIC) based Application Development