0% found this document useful (0 votes)
4 views

Lecture 1-SET 311- Microcontroller

The document outlines a course on Microcontrollers and Interfacing, taught by Dr. Ahmed Osman Mahmoud at Zagazig University. It covers topics such as microcontroller architecture, programming in assembly and C, and various applications of microcontrollers. The course includes a project where students will build a system using the 8051 microcontroller, with a deadline set for week 13.

Uploaded by

salmamaher2323
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

Lecture 1-SET 311- Microcontroller

The document outlines a course on Microcontrollers and Interfacing, taught by Dr. Ahmed Osman Mahmoud at Zagazig University. It covers topics such as microcontroller architecture, programming in assembly and C, and various applications of microcontrollers. The course includes a project where students will build a system using the 8051 microcontroller, with a deadline set for week 13.

Uploaded by

salmamaher2323
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 34

Microcontroller and Interfacing

SET 311
1
Lecture # 1
Dr./ Ahmed Osman Mahmoud
2
Teaching Staff
 Instructor:
 Dr./ Ahmed Osman Mahmoud
[email protected]
 Computer and Systems Department – Faculty of Engineering – Zagazig
University
 Teaching Assistant
 Eng./ Doaa Amin
 Email:
 Lecture Data and Location
3 Course Outlines
 Introduction to microcontrollers
 Microcontroller architecture and simulators
 Assembly language programming
 loop and jump instructions
 Input and output programming
 Addressing modes.
 Arithmetic and logic operation
 C language programming for Embedded System
 Memory Organization in microcontroller
 Timer programming in assembly and C
 interrupts programming
 Microcontroller interfaces
 Microcontroller applications
4
Course Material
 Book:
 The 8051 Microcontroller and Embedded Systems Using Assembly and C
 Course Website:
 …….
5
General Rules
6
Introduction to Microcontroller
Dr./ Ahmed Osman Mahmoud
7 Agenda
Computer Architecture
Introduction to Microcontroller
Difference between CPU, Microcontroller
and Microprocessor
Embedded System
Microcontroller Classification
8051 Microcontroller
8 Computer Architecture
A computer is an electronic device that
can accept data as input, process it
according to a set of instructions
(software), and produce output.
Key components of a computer include:
Hardware: The physical parts of the
computer, such as the CPU, RAM,
motherboard, and storage devices.
Software: The programs that instruct the
hardware on what to do. This includes the
operating system and applications.
9 Computer Architecture
Key Components of Hardware Computer
Architecture:
❑ Control Unit (CU):The brain of the computer.
Fetches instructions from memory, decodes
them, and issues signals to the appropriate
components to execute them.
❑ Arithmetic Logic Unit (ALU):Performs
arithmetic operations (addition, subtraction,
multiplication, division) and logical
operations (AND, OR, NOT).
Note: CU and ALU together is called CPU
(Central Processing Unit).
10 Computer Architecture
❑Registers: Small, high-speed storage locations
within the CPU that hold data temporarily during
processing. Such as the instruction register (IR),
program counter (PC), and general-purpose
registers.
❑Memory: Stores data and instructions. Can be
divided into primary memory (RAM, ROM) and
secondary memory (hard drives, SSDs).
❑Input/Output (I/O) Devices: Allow the computer
to communicate with the outside world. Such as
keyboards, mice, monitors, printers, and network
interfaces.
❑Bus: A communication channel that connects the
components of the computer. Such as data bus.
11
12 Computer Architecture
The CPU is connected to memory and I/O
through strips of wire called a bus.
Bus Carries information from place to place
1. Address bus
2. Data bus
3. Control bus
13 Computer Architecture
Address bus: For a device (memory or I/O) to be
recognized by the CPU, it must be assigned an address.
 The address assigned to a given device must be unique.
 The CPU puts the address on the address bus, and the
decoding circuitry finds the device.

Data bus: The CPU either gets data from the device or
sends data to it.

 Control bus: Provides read or write signals to the


device to indicate if the CPU is asking for information or
sending it information.
14 Computer Architecture
 Address bus The more address buses available, the
larger the number of devices that can be
addressed.
 The number of locations with which a CPU can
communicate is always equal to 𝟐𝒙 ,
where x is the address lines, regardless of the size of the data bus
 Ex. a CPU with 24 address lines and 16 data lines
can provide a total of 𝟐𝟐𝟒 or 16M bytes of
addressable memory
 Each location can have a maximum of 1 byte of
data, since all general-purpose CPUs are byte
addressable
 The address bus is unidirectional
15 Computer Architecture
16 Computer Architecture
Registers:
 The CPU uses registers to store information
temporarily
 Values to be processed
Address of value to be fetched from memory

In general, the more and bigger the registers,


the better the CPU
Registers can be 8-, 16-, 32-, or 64-bit
The disadvantage of more and bigger registers
is the increased cost of such a CP
17 Introduction to Microcontroller
A microcontroller (MCU) is a small computer on
a single integrated circuit that is designed to
control specific tasks within electronic systems.
 It combines the functions of a central
processing unit (CPU), memory, and
input/output interfaces, all on a single chip.
Application of Microcontroller
Microcontrollers are widely used in embedded
systems, such as home appliances, automotive
systems, medical devices, and industrial control
systems.
18 Introduction to Microcontroller
Component of Microcontroller:
1. CPU
2. Volatile and non-volatile Memory
3. input/output peripherals
4. various communication interfaces

Activity: Discuss the function of each part.


19 Computer VS. Microcontroller

 Microcontrollers are
smaller, more specialized,
and often used in
embedded applications,
while computers are
larger, more versatile, and
used for a wider range of
tasks.
20 Computer VS. Microcontroller
 An embedded product uses a microprocessor (or
microcontroller) to do one task and one task only.
There is only one application software that is typically
burned into ROM.

 A Computers, in contrast with the embedded


system, can be used for any number of applications
It has RAM memory and an operating system that loads a
variety of applications into RAM and lets the CPU run them
It contains or is connected to various embedded products
Each one peripheral has a microcontroller inside
21 Microprocessor VS. Microcontroller
General-purpose microprocessors contains
No RAM
No ROM
No, I/O ports
Microcontroller has
CPU (microprocessor)
RAM
ROM
I/O ports
Timer
ADC and other peripherals
22 Microprocessor VS. Microcontroller
General-purpose microprocessors
▪ Must add RAM, ROM, I/O ports, and timers externally to make
them functional
▪ Make the system large and much more expensive
▪ Have the advantage on the amount of RAM, ROM, and I/O ports
Microcontroller
▪ The fixed amount of on-chip ROM, RAM, and number of I/O ports
makes them ideal for many applications in which cost and space
are critical
▪ In many applications, the space it takes, the power it consumes,
and the price per unit are much more critical considerations than
the computing power
23 Embedded System
An embedded system is a combination of
computer hardware and software, either fixed in
capability or programmable, designed for a specific
function or functions within a larger system.

Embedded systems are everywhere, appearing in


the home, office, factory, car or hospital.
24 Embedded System Apps.
25 MCU Classification
Microcontrollers can be classified based on
several factors, including:
1. Architecture
2. Core
3. Power Consumption
4. Peripherals
5. packing
26 MCU Classification
1. Architecture
- 8-bit microcontrollers: These are the most common type,
offering a good balance of performance, power
consumption, and cost. Examples include the Atmel AVR,
8051 and PIC microcontrollers.
- 16-bit microcontrollers: These offer higher performance
and more memory than 8-bit microcontrollers, but they
are also more expensive. Examples include the Texas
Instruments MSP430 and Microchip PIC24.
- 32-bit microcontrollers: These are the most powerful type
of microcontroller, with high performance and large
amounts of memory. They are often used in complex
applications such as industrial automation and medical
devices. Examples include the ARM Cortex-M series and
the Renesas RX series.
27 MCU Classification
2. Core
- RISC (Reduced Instruction Set Computer): These
microcontrollers have a smaller instruction set, which can
lead to faster execution times and lower power
consumption. Examples include the ARM Cortex-M series
and the AVR microcontrollers.
- CISC (Complex Instruction Set Computer): These
microcontrollers have a larger instruction set, which can
make programming easier but can also lead to slower
execution times. Examples include the Intel 8051 and the
Motorola 68HC11.
28 MCU Classification
3. Power Consumption
- Low-power microcontrollers: These
microcontrollers are designed to consume as
little power as possible, making them ideal
for battery-powered applications. Examples
include the MSP430 and the PIC16F84A.
- High-performance microcontrollers: These
microcontrollers are designed for high-
performance applications, but they also
consume more power. Examples include the
ARM Cortex-M7 and the Renesas RX600.
29 MCU Classification
4. Peripherals
- General-purpose microcontrollers: These
microcontrollers have a wide range of
peripherals, such as timers, ADCs, DACs, and
communication interfaces.
- Specialized microcontrollers: These
microcontrollers are designed for specific
applications, such as motor control or digital
signal processing. They may have specialized
peripherals that are not found on general-
purpose microcontrollers.
30 MCU Classification
5. Packing
- DIP (Dual In-line Package): These packages
have two rows of pins on the bottom, making
them easy to solder into breadboards.
- SOIC (Small Outline Integrated Circuit): These
packages are smaller than DIP packages and
are often used in surface mount assembly.
- QFP (Quad Flat Package): These packages
have pins on all four sides, making them ideal
for high-density applications.
31 8051 MCU
 8051 microcontroller is designed by Intel in 1981.
 It is an 8-bit microcontroller.
 It is built with 40 pins DIP (dual inline package)
 4kb of ROM storage and 128 bytes of RAM storage
 2 16-bit timers.
 It consists of are four parallel 8-bit ports, which are
programmable as well as addressable as per the
requirement.
 An on-chip crystal oscillator is integrated in the
microcontroller having crystal frequency of 12 MHz.
32

The system bus connects all


the support devices to the
CPU. The system bus consists
of an 8-bit data bus, a 16-bit
address bus and bus control
signals. All other devices like
program memory, ports, data
memory, serial interface,
interrupt control, timers, and
the CPU are all interfaced
together through the system
bus.
Project

Group of 4-5 student will build a


system using Micro controller 8051
Deadline is in week 13.

33
34
Thanks

You might also like