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

Microprocessor and Interfacing - Lecture - 1 (New)

Lecture -1

Uploaded by

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

Microprocessor and Interfacing - Lecture - 1 (New)

Lecture -1

Uploaded by

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

05-11-2024

Fall 2024
United International University
EEE3403: Microprocessor and Interfacing

Lecture#1
Introduction
S. M. Lutful Kabir, PhD
Professor, UIU

Introduction
• Microprocessor has revolutionized various industries and our day-to-
day life.
• Its use in control, monitoring, measurement and signal processing
has made a breakthrough in electronic industry.
• Now-a-days you won’t be able to name one electronic device in
which microprocessor or its derivative has not been used.
• This course is designed to make you familiar with this remarkable
piece of wonder.

2
05-11-2024

Objective of this course


• To learn the evolution of microprocessor in the modern perspective.
• To gain the skill of the application of one of advanced derivative of
microprocessor.
• To apply the developed skill in the real life scenario.

Features of Microprocessors
• Cost
• Size
• Power Consumption
• Versatility
• Reliability

4
05-11-2024

History

Vacuum Tube Transistor


1939 1947 Logic Gates Microprocessor Microcontroller
1960 1971 1975

What is a Microprocessor?
• Many components like transistors, registers, and diodes which come together
in a chip to perform.
• When the central processor unit is made of only one integrated circuit, it
becomes a microprocessor.
• It has millions of transistors and electronic components to process multiple
instructions at a time.
• From the technological viewpoint, a microprocessor is a VLSI (Very Large
Scale Integration) single-chip implementation of a complete processing unit.
• It is a programmable device that takes in input, performs some arithmetic and
logical operations over it and produces the desired output.
• The ability of the chip has become more complex with technology evolution.
• Now, most devices need to have a microprocessor to function.
6
05-11-2024

A typical of Microprocessor structure

Basic of Microprocessor
• A Microprocessor takes a bunch of instructions in machine language and
executes them, telling the processor what it has to do.
• Microprocessor performs three basic things while executing the instruction:
– It performs some basic operations like addition, subtraction, multiplication,
division, and some logical operations using its Arithmetic and Logical Unit
(ALU). New Microprocessors also perform operations on floating-point
numbers also.
– Data in microprocessors can move from one location to another.
– It has a Program Counter (PC) register that stores the address of the next
instruction and based on the value of the PC, Microprocessor jumps from
one location to another and takes decisions.

8
05-11-2024

• Common group of wires connecting


components in a computer system
• Types of buses:
– Address
• Unidirectional bus
• Transmit address
– Data
• 8/16/32/64-bits
• bidirectional bus
– Control
• Selects memory or IO
• Controls direction of data movement
9

Three Stages
Each computer's CPU can have different cycles based on different instruction
sets, but will be similar to the following cycle:
1. Fetch stage: The next instruction is fetched from the memory address
that is currently stored in the program counter and stored into the
instruction register. At the end of the fetch operation, the PC points to the
next instruction that will be read at the next cycle.
2. Decode stage: During this stage, the encoded instruction presented in
the instruction register is interpreted by the decoder.
3. Execute stage: The control unit of the CPU passes the decoded
information as a sequence of control signals to the relevant functional
units.

10
05-11-2024

Evolution of Microprocessors

11

Clock Speed
16-bit microprocessor: 8086: 4.7MHz, 8MHz, 10MHz
8088: more than 5MHz
80186/80188: 6MHz
80286: 8MHz

32-bit microprocessor: INTEL 80386: 16MHz to 33MHz


INTEL 80486: 16MHz to 100MHz
PENTIUM: 66MHz

64-bit microprocessor: INTEL CORE-2: 1.2GHz to 3GHz


INTEL i7: 2.66GHz to 3.33GHz
INTEL i5: 2.4GHz to 3.6GHz
INTEL i3: 2.93GHz to 3.33GHz

12
05-11-2024

Types of Processor: CISC


• CISC or Complex Instruction Set Computer is a
computer architecture where instructions are such that a
single instruction can execute multiple low-level
operations like loading from memory, storing into
memory, or an arithmetic operation, etc.
• It has multiple addressing nodes within a single
instruction.
• CISC makes use of very few registers.
1. Intel 386 6. Pentium III
2. Intel 486 7. Motorola 68000
3. Pentium 8. Motorola 68020
4. Pentium Pro 9. Motorola 68040 etc.
5. Pentium II
13

Types of Processor: RISC


• RISC or Reduced Instruction Set Computer is a
computer architecture where instruction is simple and
designed to get executed quickly.
• Instructions get completed in one clock cycle this is
because of the optimization of instructions and
pipelining (a technique that allows for simultaneous
execution of parts, or stages, of instructions more
efficiently process instructions).
• RISC makes use of multiple registers to avoid large
interactions with memory. It has few addressing nodes
1. IBM RS6000 4. DEC Alpha 21164
2. MC88100 5. DEC Alpha 21264
3. DEC Alpha 21064
14
05-11-2024

Types of Processor: EPIC


• EPIC or Explicitly Parallel Instruction Computing
permits computers to execute instructions parallel using
compilers.
• It allows complex instructions execution without using
higher clock frequencies.
• EPIC encodes its instruction into 128-bit bundles.

1. IA-64 (Intel Architecture-64)

15

The Position of a Microprocessor


in a System

16
05-11-2024

What is microcontroller?
• A microcontroller is an integrated circuit that is programmed to do a
specific task.
• Microcontroller are really just a “mini-computer”.
• It’s a miniature version of your laptop, desktop, palmtop, PDA etc.

17

Microcontroller

18
05-11-2024

Basic Principle of Operation


• Microcontrollers are used for specific applications.
• They do not need to be powerful because most applications only
require a clock of a few MHz and small amount of storage.
• A microcontroller needs to be programmed to make it useful.
• A microcontroller is only useful as the code written for it.

19

Microcontroller Programming
• Code is written for the microcontroller in an integrated development
environment, a PC program. You have to use a high-level language.
• The IDE debugs the code for errors, and then compiles it into binary
code which the microcontroller can execute.
• A programmer ( a piece of hardware, not a person) is used to transfer
the code from PC to the microcontroller.

20
05-11-2024

Where do you find them?


• Microcontrollers are hidden in tons of appliances, gadgets, and other
electronics.

21

uC in Every Parts of a Vehicle

22
05-11-2024

Comparison betw uP and uC

Ceneral Computing Appliances, specialized


Applications devices
(i.e., Laptop, tablets)
Speed Very fast Relatively slow
Extern Parts Many Few
Cost High Low
Energy Use Medium to high Very low to low

Vendors Intel, AMD, ARM etc. Atmel, ST, TI, MICROCHIP

23

Microcontroller Packaging

24
05-11-2024

An example

25

How to meet the control


objective?

26
05-11-2024

STM32F1 series
• The STM32F103C8 is a microcontroller from STMicroelectronics' STM32
series.
• It is based on the ARM Cortex-M3 core and is commonly known as the "Blue
Pill" due to its small, blue PCB design.
• This microcontroller is popular among hobbyists and developers for various
embedded systems and IoT projects because of its affordability and versatility.
• Key features of the STM32F103C8 include:
– 1. CPU: ARM Cortex-M3 core running at up to 72 MHz.
– 2. Flash Memory: 64 KB or 128 KB of Flash memory for program storage.
– 3. RAM: 20 KB of SRAM for data storage.
– 4. GPIO: Multiple General-Purpose Input/Output pins for interfacing with
external devices.
27

Key Features (continued)


– 5. Peripherals: It has various communication interfaces like USART,
SPI, I2C, and more.
– 6. Timers: Timers for various timing and control applications.
– 7. Analog-to-Digital Converter (ADC): Built-in ADC.
– 8. PWM: Pulse Width Modulation for controlling motor speed, LED
brightness, etc.
– 9. USB: Some variants of STM32F103C8 have USB interfaces.
• Developers often use the STM32F103C8 with the STM32CubeIDE or
STM32CubeMX software development tools to write, compile, and flash
firmware onto the microcontroller.
• It's a versatile microcontroller suitable for a wide range of embedded
applications.
28
05-11-2024

Key features of STM32 uC


• Code generation: STM32CubeIDE includes a code generator that
can help you quickly generate code for your STM32 microcontroller.
Debugger: STM32CubeIDE includes a powerful debugger that will
help you identify and fix bugs more quickly and efficiently.
• Project management: STM32CubeIDE allows you to manage your
projects easily. You can create, edit, and organize your projects in a
user-friendly interface.
• Support for multiple languages: STM32CubeIDE supports multiple
programming languages, including C, C++, and Assembly.
• Library management: STM32CubeIDE comes with a library
manager that allows you to easily manage your libraries and
dependencies.
29

An Example Application

• You can create a simple robot using the STM32F103C8 microcontroller for
control and various sensors and actuators for functionality.
• Here's an example of a basic line-following robot:
• *Components:*
– 1. STM32F103C8 microcontroller board.
– 2. Infrared (IR) sensors for line detection (usually array of IR sensors).
– 3. Motor driver to control the robot's motors.
– 4. DC motors and wheels for movement.
– 5. Chassis and wheels to build the physical robot.
– 6. Power supply for the microcontroller and motors.

30
05-11-2024

Design Milestones
• *Functionality:*
– 1. *Line Detection:* Use the IR sensors to detect lines on the ground.
These sensors will provide analog or digital signals based on whether
the robot is on the line or not.
– 2. *Motor Control:* Interface the motor driver with the STM32F103C8
to control the speed and direction of the DC motors. You can use PWM
signals to achieve variable speed control.
• *Decision Making:*
– Write a control algorithm in C/C++ (using a development environment
like STM32CubeIDE) to make decisions based on the sensor inputs.
For example, if the left sensor detects the line, turn the robot right, and
vice versa.
31

Design Milestones (continued)


• *Feedback:*
– Implement feedback mechanisms so the robot can adjust its path
based on sensor feedback, maintaining its position on the line.
• *Power Management:*
– Ensure you have an appropriate power supply to provide power
to both the microcontroller and motors. You might need voltage
regulation and separate power supplies for sensitive components.
• *Communication:*
– If desired, you can add communication modules with it.

32
05-11-2024

Microcontroller Programming
After the compilation, if the code is
error free, use ST-Link utility to
download the hex file of the code to
the uC through the ST-Link
hardware (keeping connected to
the USB of your PC).

33

Items to be collected
Hardware
• 1 Microcontroller (Blue Pill)
• 1 ST-Link module
• Other components as when necessary
Software
• Proteus
• STMCube IDE
• STM32 ST-Link Utility
34
05-11-2024

Counselling Hour
• Saturday : 2:00 PM - 4:00 PM
• Tuesday : 2:00 PM – 4:00 PM

35

Thanks

36

You might also like