SlideShare a Scribd company logo
MICROCONTROLLER
PRACTICE
BY Mr Serge Paulin TCHASSO
Definition of a microcontroller
 A microcontroller (MCU) could be very summarily defined like a system of complete
control, dedicated to a particular application which is equipped with logic functions
and most of the other elements necessary to his operation. The microcontroller is
therefore as a microcomputer built in a chip.
The microcontroller is is programmable integrated circuit. It behaviour depends on a
program that must be written and uploaded into it memory
Elements of the internal structure of a
microcontroller
 The memory unit
 The central processing unit
 The Input-Output unit
 Buses
 The Timer unit
 The Watchdog
 The Analogue To Digital Converter unit
 The Serial Communication unit
 The USB unit
The Memory unit
Memory is part of the microcontroller whose function is to store data. It is divided into 03
three parts:
 The program memory contains the program, therefore the instructions to achieve, and
possibly data needed by the program (for example variables). The program memory can
be a ROM. In this case the program is sent to the microcontroller once. The ROM is
sometimes replaced by an EEPROM or flash memory, which can be electrically written
and erased several times.
 The RAM (Random Access Memory): makes it possible to store data during the execution
of the program.
 The EEPROM (Programmable Electrically Erasable Read Only Memory): this memory can
be erased and reprogrammed, like the flash. It is used to store data, in case for example
of power supply failure.
The Central Processing Unit
 CPU (Central Processing Unit) it is the "brain" of the system. It is The internal
microprocessor that reads and executes the instructions of the program
stored in the program memory. Its memory locations are called registers.
The Input-output unit
This unit enables the microcontroller to communicate with the outside world through locations
called PORTS. There are three types of ports:
 Input ports
 Output ports
 Bidirectional ports
When working with ports, we first of all choose the port, then send data to it or receive data
from it.
The Serial communications unit
 It is used to exchange data with the external world while using only three cables: transmit,
receive and ground. There are two types of serial communications: asynchronous (serial
communication interfaces, SCI or UART) and synchronous (serial peripheral interface, SPI). These
interfaces are used, for example, to connect the MCU to a PC (SCI) or an EEPROM or another
microcontroller, a GSM MODEM, a Bluetooth module...
The Timer unit
 It is used as an internal base time for the system; it also generates
signals and counts events or interruptions. Some microcontrollers
have a watchdog timer (watchdog): if this device is not re-initialized
by the program after preset intervals, it will consider that there is a
problem in the software and causes a hardware reset.
The A/D converter unit
This module first of all converts the analogue signal into a digital signal before it is processed by the CPU Unit
Generally the Analogue to
Digital Converter unit has a
resolution of 10 bits and the
range of analogue value to be
converted is 0V to 5V
The block diagram of a microcontroller
 The diagram below summarizes the working procedure of a microcontroller.
The internal architecture and Instruction Set
 All upgraded microcontrollers use one of two basic design models. It is about
two different ways of data exchange between CPU and memory unit.
Von-Neumann architecture Harvard Architecture
The Instruction Set
All instructions that can be understood by the microcontroller are known as instruction set.
RISC (Reduced Instruction Set Computer)
In this case, the idea is that the microcontroller recognizes and executes only basic operations addition, subtraction, etc.).
CISC (Complex Instruction Set Computer)
Instruction Set
Families of microcontrollers
 Motorola Microcontrollers
 Atmel Microcontrollers
 Atemega Microcontollers
 PIC Microcontrollers
 …
Necessary material for the implementation of a microcontroller system
 The microcontroller itself
 A compiler (MPLAB, MikroC, Proton…)
 A simulator (ISIS-PROTEUS)
 The power supply (generally DC 5V)
 The Oscillator
 The reset button (not compulsory)
 A microcontroller programmer
 Other electronics components
The microcontroller itself
Physical aspect of the microcontroller
OSC1/CLKIN
16
RB0/INT
6
RB1
7
RB2
8
RB3
9
RB4
10
RB5
11
RB6
12
RB7
13
RA0
17
RA1
18
RA2
1
RA3
2
RA4/T0CKI
3
OSC2/CLKOUT
15
MCLR
4
U2
PIC16F84A
RA0/AN0
2
RA1/AN1
3
RA2/AN2/VREF-
4
RA4/T0CKI
6
RA5/AN4/SS
7
RE0/AN5/RD
8
RE1/AN6/WR
9
RE2/AN7/CS
10
OSC1/CLKIN
13
OSC2/CLKOUT
14
RC1/T1OSI/CCP2
16
RC2/CCP1
17
RC3/SCK/SCL
18
RD0/PSP0
19
RD1/PSP1
20
RB7/PGD
40
RB6/PGC
39
RB5
38
RB4
37
RB3/PGM
36
RB2
35
RB1
34
RB0/INT
33
RD7/PSP7
30
RD6/PSP6
29
RD5/PSP5
28
RD4/PSP4
27
RD3/PSP3
22
RD2/PSP2
21
RC7/RX/DT
26
RC6/TX/CK
25
RC5/SDO
24
RC4/SDI/SDA
23
RA3/AN3/VREF+
5
RC0/T1OSO/T1CKI
15
MCLR/Vpp/THV
1
U3
PIC16F877
The microcontroller in the Proteus
simulator
A compiler (MPLAB, MikroC, Proton…)
MikroC environment
MPLAB environment
A simulator (ISIS-PROTEUS)
Many softwares can be used as simulator: ISIS-Proteus, Orcad, PSpice, Fritzing … But we will use ISIS-Proteus as
working tool
ISIS-Proteus
environment
The power supply (generally DC 5V)
Pin 1: Vcc, representing +5V, and connected to the red wire.
Pin 2: Data-, connected to the white wire.
Pin 3: Data+, connected to the green wire.
Pin 4: representing the Ground, connected to the black wire.
The Oscillator circuit
The frequency of the oscillator is the one
written on the crystal oscillator
The frequency of the oscillator is
5V
OSC1/OSC2
The reset button (not compulsory)
The RESET pin is labeled
A microcontroller programmer
Other electronics components
MICRO_CONTROLLER PRACTICE1_Programming.pptx
Microcontroller applications
 Microcontrollers are integrated in all domains of our life such as:
Super market, in cash registers;
Alarm clock;
Digital camera;
Mouse;
Mobile phone;
Automobile industry (safety systems, fuel injection, …);
Traffic signals;
Refrigerator;
Etc.

More Related Content

PPTX
Microcontroller presentation
PPT
microprocessor architecture
PPTX
LECT 2.pptx
PDF
Benefits of Micro Controller.pdf
PDF
U proc ovw
PDF
computer Unit 3
PDF
Motorola 68hc11
DOCX
Embedded systems class notes
Microcontroller presentation
microprocessor architecture
LECT 2.pptx
Benefits of Micro Controller.pdf
U proc ovw
computer Unit 3
Motorola 68hc11
Embedded systems class notes

Similar to MICRO_CONTROLLER PRACTICE1_Programming.pptx (20)

PPTX
Embedded systems 101 final
PPTX
overview-Microprocessor of 8085 processor
PPTX
LECTURE_1 Introduction to MLP.pptx of ml
PDF
PPT
Unit 1 COMPUTER_ORGANIZATION.ppt ........
PPT
Unit 1 COMPUTER_ORGANIZATION.ppt whenekeuen
PPT
Introduction to-microprocessor
PPT
Introduction to-microprocessor
PPTX
What is microprocessor
PPT
MKLecture01eng.ppt
PDF
Microcontroller part 1
PPTX
microcontrol u 1A.pptxlklrgjkkjgdkfgjgdso
PPTX
Project report on embedded system using 8051 microcontroller
PDF
embedded systems - Developer Student Clubs.pptx.pdf
PPTX
Microcontoller and Embedded System
PDF
Computer engineering - overview of microprocessors
PPTX
8085 microprocessor
PPTX
Microprocessor and Interfacing Lab 01.pptx
PPTX
Microprocessor and Interfacing Lab 01.pptx
PPTX
Microprocessor and Interfacing Lab 01.pptx
Embedded systems 101 final
overview-Microprocessor of 8085 processor
LECTURE_1 Introduction to MLP.pptx of ml
Unit 1 COMPUTER_ORGANIZATION.ppt ........
Unit 1 COMPUTER_ORGANIZATION.ppt whenekeuen
Introduction to-microprocessor
Introduction to-microprocessor
What is microprocessor
MKLecture01eng.ppt
Microcontroller part 1
microcontrol u 1A.pptxlklrgjkkjgdkfgjgdso
Project report on embedded system using 8051 microcontroller
embedded systems - Developer Student Clubs.pptx.pdf
Microcontoller and Embedded System
Computer engineering - overview of microprocessors
8085 microprocessor
Microprocessor and Interfacing Lab 01.pptx
Microprocessor and Interfacing Lab 01.pptx
Microprocessor and Interfacing Lab 01.pptx
Ad

Recently uploaded (20)

DOCX
fsdffdghjjgfxfdghjvhjvgfdfcbchghgghgcbjghf
PDF
Prescription1 which to be used for periodo
PPTX
title _yeOPC_Poisoning_Presentation.pptx
PPTX
PROGRAMMING-QUARTER-2-PYTHON.pptxnsnsndn
PPTX
making presentation that do no stick.pptx
PPTX
sdn_based_controller_for_mobile_network_traffic_management1.pptx
PDF
PPT Determiners.pdf.......................
PDF
Dynamic Checkweighers and Automatic Weighing Machine Solutions
PPTX
5. MEASURE OF INTERIOR AND EXTERIOR- MATATAG CURRICULUM.pptx
PPTX
"Fundamentals of Digital Image Processing: A Visual Approach"
PPTX
Lecture 3b C Library _ ESP32.pptxjfjfjffkkfkfk
PPTX
code of ethics.pptxdvhwbssssSAssscasascc
PPTX
PLC ANALOGUE DONE BY KISMEC KULIM TD 5 .0
PPTX
Nanokeyer nano keyekr kano ketkker nano keyer
PPTX
Sem-8 project ppt fortvfvmat uyyjhuj.pptx
PDF
Smarter Security: How Door Access Control Works with Alarms & CCTV
PPT
Lines and angles cbse class 9 math chemistry
PPTX
material for studying about lift elevators escalation
PPTX
Fundamentals of Computer.pptx Computer BSC
PPTX
INFERTILITY (FEMALE FACTORS).pptxgvcghhfcg
fsdffdghjjgfxfdghjvhjvgfdfcbchghgghgcbjghf
Prescription1 which to be used for periodo
title _yeOPC_Poisoning_Presentation.pptx
PROGRAMMING-QUARTER-2-PYTHON.pptxnsnsndn
making presentation that do no stick.pptx
sdn_based_controller_for_mobile_network_traffic_management1.pptx
PPT Determiners.pdf.......................
Dynamic Checkweighers and Automatic Weighing Machine Solutions
5. MEASURE OF INTERIOR AND EXTERIOR- MATATAG CURRICULUM.pptx
"Fundamentals of Digital Image Processing: A Visual Approach"
Lecture 3b C Library _ ESP32.pptxjfjfjffkkfkfk
code of ethics.pptxdvhwbssssSAssscasascc
PLC ANALOGUE DONE BY KISMEC KULIM TD 5 .0
Nanokeyer nano keyekr kano ketkker nano keyer
Sem-8 project ppt fortvfvmat uyyjhuj.pptx
Smarter Security: How Door Access Control Works with Alarms & CCTV
Lines and angles cbse class 9 math chemistry
material for studying about lift elevators escalation
Fundamentals of Computer.pptx Computer BSC
INFERTILITY (FEMALE FACTORS).pptxgvcghhfcg
Ad

MICRO_CONTROLLER PRACTICE1_Programming.pptx

  • 2. Definition of a microcontroller  A microcontroller (MCU) could be very summarily defined like a system of complete control, dedicated to a particular application which is equipped with logic functions and most of the other elements necessary to his operation. The microcontroller is therefore as a microcomputer built in a chip. The microcontroller is is programmable integrated circuit. It behaviour depends on a program that must be written and uploaded into it memory
  • 3. Elements of the internal structure of a microcontroller  The memory unit  The central processing unit  The Input-Output unit  Buses  The Timer unit  The Watchdog  The Analogue To Digital Converter unit  The Serial Communication unit  The USB unit
  • 4. The Memory unit Memory is part of the microcontroller whose function is to store data. It is divided into 03 three parts:  The program memory contains the program, therefore the instructions to achieve, and possibly data needed by the program (for example variables). The program memory can be a ROM. In this case the program is sent to the microcontroller once. The ROM is sometimes replaced by an EEPROM or flash memory, which can be electrically written and erased several times.  The RAM (Random Access Memory): makes it possible to store data during the execution of the program.  The EEPROM (Programmable Electrically Erasable Read Only Memory): this memory can be erased and reprogrammed, like the flash. It is used to store data, in case for example of power supply failure.
  • 5. The Central Processing Unit  CPU (Central Processing Unit) it is the "brain" of the system. It is The internal microprocessor that reads and executes the instructions of the program stored in the program memory. Its memory locations are called registers.
  • 6. The Input-output unit This unit enables the microcontroller to communicate with the outside world through locations called PORTS. There are three types of ports:  Input ports  Output ports  Bidirectional ports When working with ports, we first of all choose the port, then send data to it or receive data from it.
  • 7. The Serial communications unit  It is used to exchange data with the external world while using only three cables: transmit, receive and ground. There are two types of serial communications: asynchronous (serial communication interfaces, SCI or UART) and synchronous (serial peripheral interface, SPI). These interfaces are used, for example, to connect the MCU to a PC (SCI) or an EEPROM or another microcontroller, a GSM MODEM, a Bluetooth module...
  • 8. The Timer unit  It is used as an internal base time for the system; it also generates signals and counts events or interruptions. Some microcontrollers have a watchdog timer (watchdog): if this device is not re-initialized by the program after preset intervals, it will consider that there is a problem in the software and causes a hardware reset. The A/D converter unit This module first of all converts the analogue signal into a digital signal before it is processed by the CPU Unit Generally the Analogue to Digital Converter unit has a resolution of 10 bits and the range of analogue value to be converted is 0V to 5V
  • 9. The block diagram of a microcontroller  The diagram below summarizes the working procedure of a microcontroller.
  • 10. The internal architecture and Instruction Set  All upgraded microcontrollers use one of two basic design models. It is about two different ways of data exchange between CPU and memory unit. Von-Neumann architecture Harvard Architecture The Instruction Set All instructions that can be understood by the microcontroller are known as instruction set. RISC (Reduced Instruction Set Computer) In this case, the idea is that the microcontroller recognizes and executes only basic operations addition, subtraction, etc.). CISC (Complex Instruction Set Computer)
  • 12. Families of microcontrollers  Motorola Microcontrollers  Atmel Microcontrollers  Atemega Microcontollers  PIC Microcontrollers  …
  • 13. Necessary material for the implementation of a microcontroller system  The microcontroller itself  A compiler (MPLAB, MikroC, Proton…)  A simulator (ISIS-PROTEUS)  The power supply (generally DC 5V)  The Oscillator  The reset button (not compulsory)  A microcontroller programmer  Other electronics components
  • 14. The microcontroller itself Physical aspect of the microcontroller OSC1/CLKIN 16 RB0/INT 6 RB1 7 RB2 8 RB3 9 RB4 10 RB5 11 RB6 12 RB7 13 RA0 17 RA1 18 RA2 1 RA3 2 RA4/T0CKI 3 OSC2/CLKOUT 15 MCLR 4 U2 PIC16F84A RA0/AN0 2 RA1/AN1 3 RA2/AN2/VREF- 4 RA4/T0CKI 6 RA5/AN4/SS 7 RE0/AN5/RD 8 RE1/AN6/WR 9 RE2/AN7/CS 10 OSC1/CLKIN 13 OSC2/CLKOUT 14 RC1/T1OSI/CCP2 16 RC2/CCP1 17 RC3/SCK/SCL 18 RD0/PSP0 19 RD1/PSP1 20 RB7/PGD 40 RB6/PGC 39 RB5 38 RB4 37 RB3/PGM 36 RB2 35 RB1 34 RB0/INT 33 RD7/PSP7 30 RD6/PSP6 29 RD5/PSP5 28 RD4/PSP4 27 RD3/PSP3 22 RD2/PSP2 21 RC7/RX/DT 26 RC6/TX/CK 25 RC5/SDO 24 RC4/SDI/SDA 23 RA3/AN3/VREF+ 5 RC0/T1OSO/T1CKI 15 MCLR/Vpp/THV 1 U3 PIC16F877 The microcontroller in the Proteus simulator
  • 15. A compiler (MPLAB, MikroC, Proton…) MikroC environment MPLAB environment
  • 16. A simulator (ISIS-PROTEUS) Many softwares can be used as simulator: ISIS-Proteus, Orcad, PSpice, Fritzing … But we will use ISIS-Proteus as working tool ISIS-Proteus environment
  • 17. The power supply (generally DC 5V) Pin 1: Vcc, representing +5V, and connected to the red wire. Pin 2: Data-, connected to the white wire. Pin 3: Data+, connected to the green wire. Pin 4: representing the Ground, connected to the black wire.
  • 18. The Oscillator circuit The frequency of the oscillator is the one written on the crystal oscillator The frequency of the oscillator is 5V OSC1/OSC2
  • 19. The reset button (not compulsory) The RESET pin is labeled
  • 23. Microcontroller applications  Microcontrollers are integrated in all domains of our life such as: Super market, in cash registers; Alarm clock; Digital camera; Mouse; Mobile phone; Automobile industry (safety systems, fuel injection, …); Traffic signals; Refrigerator; Etc.