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

Microprocessor-Based Systems

With each passing day, industrial production processes have suffered big changes, so these days, automation is an area that is in constant contact with us, so we must be prepared and know the operation of said devices and their respective systems.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views

Microprocessor-Based Systems

With each passing day, industrial production processes have suffered big changes, so these days, automation is an area that is in constant contact with us, so we must be prepared and know the operation of said devices and their respective systems.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 16

Inbacuán

Hector

SYSTEMS BASED ON MICROPROCESSORS

With each passing day, production and industrial processes have undergone great
changes, so these days, automation is an area that is in constant contact with us, so
we must be prepared and know the operation of these devices and their respective
systems.

We find systems based on microprocessors in the majority of devices in our daily lives
such as: domestic, industrial, medicinal, computing, among others. At the time of the
industrial revolution, machines replaced human labor, while today, microprocessors
and their applications try to replace the power of the brain; One of the decisive
inventions of humanity is the digital computer, which together with the electric motor
makes up one of the most efficient technological systems.

We must consider that “System” is defined as a set of elements intertwined with each
other, to perform a specific function or reach an objective that none of them could do
separately; We can conclude that a system based on microprocessors is a set of
related components capable of carrying out actions based on the information received
from a process or a physical phenomenon, represented in machine language (0,1),
arithmetic and logical operations, and perform data transfer with the different I/O
devices connected to the system.

Input peripherals (Sensors): Responsible for receiving information about physical


changes and delivering a signal, whether analog or digital. These elements are
represented by digital or analog signal capture sensors, pushbuttons, switches,
electrical contacts, etc.

Control unit: Processes the information received from the input peripherals, based on
a logical sequence of instructions and delivers the results to be analyzed and put into
operation.

Output peripherals (Actuators) : These devices are responsible for executing orders
according to the results sent from the Control Unit. They are represented by:

1
Inbacuán
Hector

solenoids, relays, contactors, displays, CDA, etc.

If we want to solve a problem by implementing a digital circuit, we can do it in two


different ways:

• Wired Logic: They are rigid circuits, exclusive to perform a specific function,
which means that if we want to implement a new application, a new circuit
must be designed.

• Programmed Logic: This is a technique that gave rise to autonomous


machines; capable of performing most of the basic functions necessary for any
application through a set of instructions. They work in an orderly and
sequential manner, continuously executing the necessary operations based on
a previously established program.
Table 1.
Differences between Hardwired Logic and Programmed Logic
SYSTEM CARACTERISTICS WIRED PROGRAMMABLE

• Maintenance A lot Bit

• Cost Low High

• Process adaptation Difficult Easy

• Expansion possibilities Low High

• Interconnection and exterior wiring A lot Bit

• Structuring Source:
in independent blocks Difficult
Collaguazo, Gerardo. Microcontrollers
Easy

The biggest problem when creating a system based on microprocessors is that it


requires people specialized in the subject for its design and maintenance.

A system based on microprocessors constitutes a series of elements for the input,


output, processing, control and storage of information. The links between these
elements are established through signal paths, generally cables or buses are used,
which are responsible for carrying or transmitting digital information between one point
and another.

2
Inbacuán
Hector

The main objective of a system based on microprocessors consists of the processing


of information collected through the input peripherals and the transmission of the
results either directly to the process or to the operator, through the output peripherals
connected to the system. Communication between the system and the peripherals is
carried out by the set of circuits that constitute the so-called input/output module of the
system. In this way, three fundamental parts are distinguished: central processing unit
(CPU), memory block and the input/output module, interconnected between them
through buses.

Figure 1. Structure of a microprocessor system


Source: Collaguazo, Gerardo. Microcontrollers
CENTRAL PROCESSING UNIT (CPU)
Known as a central processor and is responsible for processing information coming
from outside. This block contains the logic, arithmetic, and control circuits that direct
and coordinate the operations of the system and peripheral devices. This unit
distinguishes: the control unit, the arithmetic-logical unit and the internal register block.
In practice, the CPU is in the form of an integrated circuit called a microprocessor.

3
Inbacuán
Hector

Figure 2. CPU blocks


Source: Collaguazo, Gerardo. Microcontrollers

The Control Unit is responsible for the interpretation and execution of the program
instructions. It also generates the signals that are required by the Arithmetic unit and
other components of the system; It also tells us the direction of the data (whether they
enter or leave) or the device that is being accessed (memory or I/O device). These
signals are sent through lines called buses. It contains logic and timing circuits that
generate the appropriate signals necessary to execute each instruction in a program.
This unit fetches an instruction from memory by sending an address and a read
command to the memory unit. The instruction stored in the memory location is
transferred to it and then executed.

4
Pegee® Inbacuán Hector

The Arithmetic-Logic Unit is responsible for performing logical and arithmetic


operations using addition and two's complement notation as a basis. These operations
(addition, subtraction, two's complement, and, or, not, xor and comparison) are
performed with data from memory, with data from the internal registers or with data
from the input unit. The type of operation to be carried out is determined by signals
from the control unit.

Connected through the internal bus are the Internal Registers for temporary data
storage. It is worth mentioning that every microprocessor has a very important register
called an accumulator which contains the first operand of an operation and the result
of the same after having executed it.

Registers have certain specific functions to fulfill within the CPU, namely:

Program Counter (PC) Register is the one that tells the microprocessor the memory
address where the program is being executed. Each time an instruction is read, the PC
automatically increments to supply the address of the memory location where the next
instruction or program data is located.
Instruction register (IR). When the microprocessor captures an instruction, it is
stored in the register (IR), in order to proceed with its decoding or interpretation and
search in the program's (ROM) for the set of instructions necessary for its execution.
This function is performed by a circuit called an instruction decoder.
The Accumulator Register (AC) is used as a source or destination of data. The result
of an operation is generally deposited in it.
The Status Register (SR) provides, through its bits (called flags), information related
to the execution of certain instructions such as sign, flow, parity, carry generation,
negative or zero result, etc.

General purpose records. They are used to store memory addresses, data,
intermediate results and other purposes.

5
Inbacuán
Hector

MEMORY BLOCK

• Storage of the instructions that constitute the program. The instructions are
encoded by their Operation Code (COP), made up of one or more Bytes.

• Storage of program data and variables. Normally grouped in packets of 8 bits


(Byte), 16 bits (Word) or 32 bits (Long Word).

Data word length represents the number of bits that can be accessed in a single
operation, that is, the number of bits that can be written to or read from a memory
location.

Memory capacity represents the number of bits that can be memorized. Considering
an 8-bit word, the usual unit of measurement for memory capacity is the Kilobyte.

Access time represents the time interval between the moment at which an order is
given to read the contents of a memory location and the moment at which the word of
the position is selected.

MEMORY MODULE

Figure 3. Memory Types


Source: Collaguazo, Gerardo. Microcontrollers
RAM MEMORY , which is the memory that temporarily stores (as long as the power
supply to the system lasts) the data.

ROM MEMORY intended only for writing programs or data that will be saved
definitively.

TYPES OF ROM MEMORY:


OTP The microprocessor contains a non-volatile read-only memory that is “one-time

6
Inbacuán
Hector

programmable” by the user using a simple recorder controlled by a program from a


PC. The OTP version is recommended when the design cycle is very short.
EPROM Microprocessor systems that have EPROM memory can be erased and
recorded many times. The recording is carried out, as in the case of OTPs.
EEPROM These are read-only, programmable and electrically erasable memories
EEPROM
Both programming and erasing are carried out electrically. The recording and erasing
operations are very convenient and fast. Microprocessor systems equipped with
EEPROM memory, once installed in the circuit, can be recorded and deleted as many
times as desired. The number of times that an EEPROM memory can be recorded and
deleted is finite, so continuous reprogramming is not recommended.
FLASH This is non-volatile, low-consumption memory that can be written and erased.
It works like a ROM and RAM but consumes less and is smaller. It is faster and higher
density than EEPROM. The FLASH alternative is recommended over EEPROM when
a large amount of non-volatile program memory is required. It is faster and tolerates
more write/erase cycles.
EEPROM and FLASH memories are very useful as they allow the microprocessor
systems that incorporate them to be reprogrammed without having to remove the
integrated circuit from the card.

7
Pegee® Inbacuán Hector

BUSES
The three main components of a microprocessor-based system (CPU, Memory Block
and I/O module) are interconnected with each other by electrical cables called system
buses.
A bus represents a meeting of lines which carry out the unidirectional or bidirectional
transfer of information.
The presence of a certain bit (0 or 1) on a bus line is marked by a certain value of the
electrical potential on that line. For example, a potential between 2.4-5V marks bit “1”
and a potential between 0-0.4V marks bit “0”.
Data bus is made up of bidirectional lines. The number N of data bus lines is generally
equal to the length of the microprocessor data word. Binary information is transferred
through the data bus between the microprocessor and the peripherals.
Address bus is made up of unidirectional lines. It is used for the transfer of
information necessary for the selection of a certain memory location or a port of the
I/O module .
Control bus is made up of lines, generally unidirectional. On this bus each line has a
different meaning and name. The control bus contains the information that the
microprocessor sends to the elements of the system.

CONTROL SIGNALS
CLK IN It is used by the microprocessor to generate clock pulses and produce timing
and control sequences for internal functions.
CLK OUT The clock pulses of this Terminal are used by external modules to
synchronize their operations with the operations of the microprocessor.
RESET IN Used to initialize the microprocessor.
RESET OUT Informs the external circuitry that the microprocessor is in the reset state.
INTERRUPT IN Used to interrupt the normal operation of the microprocessor, forcing it
to suspend execution of the current program and transfer control to a subroutine. The
interrupt signal usually comes from an I/O unit.
INTERRUPT OUT Informs the external circuitry that the interruption has been
serviced. Once the interruption is executed, the microprocessor returns to the previous
program.
HOLD It is used to suspend the operation of the microprocessor and take it to a state

8
Inbacuán
Hector

called hold in which all the buses remain at high impedance. HOLDA Reports that the
hold request has ended.
The READ and WRITE lines inform the component selected by the address bus the
expected transfer address on the data bus.

CLOCK AND RESET CIRCUIT


In most microprocessors this clock is built-in, and its frequency can be controlled
externally using a quartz crystal, an RC network connected to the respective pins.
Figure 4 illustrates the possibilities of frequency control. When frequency stability is not
of importance, an RC network is preferred, in other cases, for example for serial or
parallel communications, the use of a crystal is necessary.

Figure 4. clock circuit


Source: Collaguazo, Gerardo. Microcontrollers

INPUT/OUTPUT MODULE. INTERFACE TECHNIQUES

The system is composed of a block of logical circuits that allow the introduction of
data, display of results and eventually the modification of the program, that is, a
communication device with the operator, this block is called I/O MODULE and is
intended for

9
Inbacuán
Hector

ensure the transfer of information, represented in binary, between the system and
various peripherals connected to it (keyboards, pushbuttons, switches, electrical
contacts, LEDs, etc.).

mP +

Figure 5. Input/Output Modules


Source: Collaguazo, Gerardo.
Microcontrollers
OUTPUT PORT WITH LED
Figure 6 shows a simple example of an output port with a D flip-flop, whose function is
to transfer the state of the data bit D0 to an LED that acts as a peripheral device. This
happens when address line A15 is high and the write signal (WR) is low.

Figure 6. Flip-Flop exit port


Source: Collaguazo, Gerardo.
Microcontrollers
After enabled, the flip-flop retains previously stored information while the
microprocessor engages in other tasks.

1
0
Inbacuán
Hector

SWITCH INPUT PORT

Figure 7. Flip-Flop Entry Port


Source: Collaguazo, Gerardo.
Microcontrollers
Figure 7 instead shows an input port with a flip-flop. In this case, the peripheral
device is a switch and its state ( high or low ) is transferred to data line D0
when addressing line A15 is high and read control line ( RD ) is low . Once the
microprocessor accepts the D0 bit present on the data bus, it transfers it to the
accumulator and places the output of the input port in a high impedance state so
that it does not interfere with other data transfers.

OUTPUT PORT WITH DATA LOG


The following figure shows an output port with latch type registration. The circuit
transfers the 8-bit pattern present on the data bus to the seven-segment
peripheral display when the
address line A15 is high and the
write line (WR) is low .

SLOW PERIPHERALS : Their


state changes once per second
and require several milliseconds to
stabilize in their new state. In this
category we have light displays,
Figure 8. Departure port with latch type relays, microswitches, position
registration
sensors, contacts, keypads, etc.

1
1
Inbacuán
Hector

MEDIUM SPEED PERIPHERALS: These are those that transfer data from 1bps
to 10,000 bps. This category includes keyboards, normal printers, CAD, CDA,
data acquisition systems, etc.
HIGH SPEED PERIPHERALS: These are those that transfer data at speeds
greater than 10,000 bps. This category includes magnetic and optical disks,
laser printers, high-speed communication lines, video displays (CRT), etc.

ARCHITECTURES OF MICROPROCESSOR SYSTEMS.


In the Von Neumann Architecture the CPU is connected to a single memory that
contains the program instructions and data. This memory is accessed through a
single bus system. The only advantage it has is that it simplifies the system
logic.

Figure 9. Von Neumann Architecture Source: Collaguazo, Gerardo. Microcontrollers

Other microprocessor systems use the Harvard Architecture, which has two
types of independent memory (data memory and program memory) to which it is
connected through two groups of separate buses, according to Figure 10.

1
2
Inbacuán
Hector
MEMORY OF
PROGRAM
(ROM)
. , MEMORY OF
\ DATA
' V (RAM)

Figure 10. Harvard Architecture


Source: Collaguazo, Gerardo. Microcontrollers

PROGRAMMING LANGUAGES. THE ASSEMBLER


Programming languages can be roughly divided into the following hierarchies:

• Idioms of microprogramming.
• Idioms of machine.
• Idiomsassemblers.
• Idioms of high level.
Machine Language: is the binary form (0's and 1's) of the program and is the
only language that the microprocessor ultimately understands. A simplified form
is the object code, which represents each binary code by its hexadecimal
equivalent.
Assembly Language and high-level languages (Pascal, Basic, C, C++, etc.)
consist of a series of special instructions (statements) that are easier for people
to understand than instructions in machine language or object code.
Assembly Language uses Mnemonics, which are groups of alphanumeric
characters that symbolize the orders or tasks to be performed with each
instruction. In general, mnemonics correspond to the initials of the name of the
instruction in English, so that they “remember” the operation that the instruction
performs, which facilitates its memorization.
THE INSTRUCTIONS
One of the main characteristics of any microprocessor is having a good set of
instructions that give it the greatest possible versatility. The following groups,
types or sets of instructions are established:

1
3
bezeee Inbacuán Hector

1. Arithmetic: These are the instructions that perform arithmetic operations


such as addition, subtraction, increments, decrements, etc.
2. Data movement: This type of movement or data transfer instructions allow a
copy of the contents of a register or memory address (source) to be made in
another register or memory address (destination).
3. Logical instructions: They perform logical operations between the
operands. They affect the flags as appropriate and the operations are performed
bit by bit between the data.
4. Comparison instructions: These are subtraction operations or XOR
operations between two operands.
5. Jump instructions: These are sequence modification instructions that alter
the normal execution of the program, loading the program counter with the new
address in which we want the program to continue executing. □ Conditional:
When they are controlled by the state of an indicator or flag, and based on said
state it is decided whether to jump or not.
□ Unconditional: When they modify the program counter without a prior
condition. Within each of these types, we can also find the particularity that when
making jumps they are made with the possibility of return or not.
6. Input/output instructions: They are actually transfer instructions, but not
between registers or memory locations, but with peripheral elements that allow
the microprocessor to communicate with the outside world.
7. Control instructions: They serve to act internally on the microprocessor,
causing stops in the execution of the program, etc.
8. Bit instructions: They work or treat independent bits.
9. Shift instructions: Shift or rotate the bits of a register (Accumulator) left or
right.
ADDRESSING MODES
Addressing modes are those procedures used by the microprocessor to access
certain operands, instructions, memory locations, input/output registers, etc.
Therefore, the object of addressing is a value or data that is located in a place in
memory, in some register or in the instruction itself.

1
4
Inbacuán
Hector

1. Immediate addressing: In this case the object (an operand) is included in


the instruction, that is, the operand itself is added after the instruction code. The
instructions that use this addressing can be two or three bytes and are
instructions that can be executed quickly and easily.
2. Implicit addressing: Instructions that use this addressing mode have a
single byte and it is the instruction itself that indicates which register or memory
address will be used in the operation.
3. Absolute addressing: In this case the instructions include the memory
address where the data to be operated on is located. In this type of addressing,
three assumptions can occur:
a. The instruction points to a register that contains the desired
information
b. The instruction contains the complete address where the data is
located, using three bytes.
c. When the instruction refers to only a part of the memory. In this case
the highest byte is provided by the program counter and the lowest byte is
expressed after the instruction code, therefore only two bytes are used.
4. Relative direct addressing: The instruction in this case contains a certain
value which we can call V. The total address is calculated by adding to V the
value stored in a register referenced by the instruction.
5. Indirect addressing: The instruction contains an address that we will call
D1. The content of D1 is not the direct object of our instruction, but rather
contains another address that we will call D2. This new address D2 is the one
that contains the data that is the object of the instruction. Addressing used by
the 8085 microprocessor in particular, which are the following four:
Absolute Direct Addressing. The instruction contains the exact and complete
address where the data is located. For example:
LHLD A716H
Register Addressing. The instruction keeps the record in which the data to be
processed is located. For example:
MOV A, B
MOV B, C

1
5
Inbacuán
Hector

Addressing by Indirect Registration. The instruction specifies a register whose


content points to a memory address where the data is located. For example:
MOV A, M
M is a symbolic reference to a memory address pointed to by the register pair
HL.
Immediate Addressing. The instruction contains the data with which you wish to
operate, which may be data of one or two bytes.
LXI H, A0B7H
ADI 3AH

• BIBLIOGRAPHY
Collaguazo, Gerardo. Microcontrollers. Systems based on microprocessors.

1
6

You might also like