[go: up one dir, main page]

0% found this document useful (0 votes)
62 views53 pages

Structural Component of Microprocessors

The document discusses the structural components of microprocessors and microcontrollers. It describes different types of registers including general purpose registers and special function registers. It also explains other components like GPIO controllers, timers, DACs, ADCs, serial communication controllers, memory, DMA controllers and peripherals.

Uploaded by

Jose Miguel Ruiz
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
62 views53 pages

Structural Component of Microprocessors

The document discusses the structural components of microprocessors and microcontrollers. It describes different types of registers including general purpose registers and special function registers. It also explains other components like GPIO controllers, timers, DACs, ADCs, serial communication controllers, memory, DMA controllers and peripherals.

Uploaded by

Jose Miguel Ruiz
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 53

Structural

Components of
Microprocessors/
Microcontroller
REGISTER
The register is the main part of the microcontrollers and
processors that provide a fast way to collect and store data. If we
want to manipulate data with a controller or processor by
performing addition, subtraction, and so on, we cannot do that
directly in the memory, but it needs registers to process and
store the data. Microcontrollers contain several types of registers
that can be classified according to their content or instructions
that operate in them.
Types of
In the 8051 Microcontroller
Register
A register is a small place in a CPU that can store small amounts of
the data used for performing various operations such as addition
and multiplication and loads the resulting data on the main
memory. Registers contain the address of the memory location
where the data is to be stored. The size of the register is very
important for modern controllers. For instance, for a 64-bit register,
a CPU tries to add two 32-bit numbers and gives a 64-bit result.
8051 Microcontroller
Contains two mainly types of Registers

● General Purpose Registers


(Byte addressable registers)

● Special Function Registers


(Bit addressable Registers)
8051 Microcontroller
The 8051 microcontroller consists of 256 bytes of RAM, which is
divided into two ways, such as 128 bytes for general purpose
and 128 bytes for special function registers (SFR) memory. The
memory which is used for general purpose is called as RAM,
and the memory used for SFR contains all the peripheral related
registers like Accumulator, ‘B’ register, Timers or Counters, and
interrupt related registers.
General
Purpose
Register
The General-purpose Memory is called
as the RAM of the 8051 microcontrollers,
which is divided into 3 areas such as
banks, bit-addressable area, and scratch-
pad area. The banks contain different
general-purpose registers such as R0-R7,
and all such registers are byte-
addressable registers that store or
remove only 1-byte of data.
Bank and
Registers
The B0, B1, B2, and B3 stand for
banks, and each bank contains
eight general-purpose registers
ranging from ‘R0’ to ‘R7’. All these
registers are byte-addressable. Data
transfer between general-purpose
registers to general-purpose
registers is not possible. These
banks are selected by the Program
Status Word (PSW) register.
PSW (Program
Status Word)
Registers
The PSW register is a bit and byte-addressable register. This register
reflects the status of the operation that is carried out in the controller. The
PSW register determines bank selection by an RS1 and RS0, as shown
below. The physical address of the PSW starts from D0h and the individual
bits are accessed with D0h to D7h.
Carry Flag (C)
Carry Flag (C): The Address of the Carry flag is D7. This carry flag is
affected when the bit is generated from the 7th position.
When C=0 carry resets ; C=1 carry sets
Auxillary Flag
(AC)
Auxillary Flag(AC): The address of the auxiliary carry is D5. This
auxiliary carry is affected when a bit is generated from the 3rd
position to the 4th position.
AC=0 auxiliary is reset
AC=1 auxiliary is set
Overflow Flag
(OV)
Overflow Flag (OV): The address of the overflow flag is D2. When
a bit is generated from the 6th position to the 7th position, then
the overflow flag is affected.
OV=0 overflow flag resets ; OV=1 overflow flag sets
Parity Flag (P)
Parity Flag (P): The address of the parity flag is D0. While
performing arithmetic operations, if the result is 1, then the parity
flag is set – otherwise, reset.
RS1 and RS0
The RS1 and RS0, the bits in the PSW register, are used to select
different memory locations (bank0 to bank4) in the RAM.
Other Peripherals
Microprocessors
GPIO controllers (General Purpose Input and Output )

•GPIO pins serve as a fundamental part of microcontrollers,


facilitating bidirectional communication between the
microcontroller and external devices.
•The basic functionality of a GPIO controller includes, setting the
GPIO pins as either input or output, reading the voltage level if
they are set as input, and writing the voltage to 0 or 1 if they are
set as output.
Timers
 Timing is a crucial part of any embedded system, be it
controlling the blinking rate of the LEDs or controlling the
sampling rate of the ADCs, or a simple delay on the source
code. This need for timing is usually handled by devices called
timers.

Timers can operate in 2 modes


 One-time Mode
 Periodic Mode
 One-time mode

In One-time mode, we can set the timer to go off after a particular


time duration, once started, the timer counts down and once it
runs out it notifies the core.

 Periodic mode

In periodic mode, once the timer runs out, it notifies the core, then
instead of getting disabled, it automatically reloads the initial value
and starts counting down again.
Examples
● General-Purpose Timers
● Systick Timers
● Real-Time clocks and
● Watchdog timers
Pulse Width Modulation (PWM)
● These are special kinds of timers that are directly able to control
the voltage output at a given GPIO pin.

● Uses a rectangular pulse wave whose pulse width is modulated


resulting in the variation of the average value of the waveform.

● The general purpose of Pulse Width Modulation is to control


power delivery, he on-off behavior changes the average power
of signal.
DAC & ADC
• DACs are commonly used in music players to convert
digital data streams into analog audio signals.

• An ADC is used to convert an analog signal such as


voltage to a digital form so that it can be read and processed by a
microcontroller.
Serial Communication Controller

The Serial Communication Controller serves as the bridge


between a microcontroller and external devices. It is the way of
exchanging data using different methods in the form of serial
digital binary. Some of the well-known interface used for the data
exchange are RS-232, RS-485, USB, Bluetooth, Wi-Fi protocol and
etc.
Memory
● Primary memory

● Secondary memory

Primary memory is volatile and holds data and the source code
that is presently being processed, while the secondary memory is
nonvolatile and used to hold constants and the source code.
Direct Memory Access Controller
A Direct Memory Access (DMA) controller is a specialized
hardware component within a computer system that allows for
high-speed data transfers between peripheral devices and the
computer's main memory (RAM) without involving the CPU
(Central Processing Unit) in the data transfer process.
Other Peripherals
Microcontrollers
Other Peripherals of
Microprocessors
● Keyboard ● Monitor

● Printer ● Mouse

● External Drive ● Webcam

● Memory
Fetch Decode Execute
Cycle
In a microprocessor, the fetch-decode-execute cycle
is a fundamental process that the CPU undergoes to execute
instructions. Let's break down each step in the context of a
microprocessor:
Fetch
● The program counter (PC) contains the memory address of the
next instruction to be executed.

● The microprocessor fetches the instruction from the specified


memory location pointed to by the program counter.

● The fetched instruction is loaded into an instruction register (IR)


within the microprocessor.
Decode
● The instruction in the instruction register is decoded to
determine the operation to be performed.

● The opcode (operation code) of the instruction is identified, and


the control unit of the microprocessor extracts relevant
information such as operand addresses or immediate values.
Execute
● The control unit directs the execution of the operation specified
by the opcode.

● Depending on the type of instruction, this phase might involve


arithmetic or logic operations, data transfers between registers
and memory, or control flow operations like branching.

● The result of the operation may be stored in registers, memory,


or other designated locations.
Write Back
● If the executed instruction produces a result that needs to be
stored, it is written back to the appropriate location, such as a
register or memory.

● This step completes the cycle, and the program counter is


updated to point to the next instruction.
In a microprocessor, these steps are orchestrated by the control
unit, which manages the flow of data and control signals within the
CPU. The fetch-decode-execute cycle repeats continuously, allowing
the microprocessor to sequentially process and execute a series of
instructions as specified by the program stored in memory.

It's important to note that modern microprocessors may have


additional stages or optimizations in their pipeline, but the basic
fetch-decode-execute cycle remains a foundational concept in
microprocessor architecture.
Premium Icons
Infographic Elements

You might also like