Page 68 - CITS - Electronic Mechanic - TT - 2024
P. 68
ELECTRONICS MECHANIC - CITS
Timer and Control Unit
The main function of a timer is to make a delay otherwise time gap between two events. This microcontroller
includes two timers where each timer is 16-bit where the system can generate two delays concurrently to produce
the suitable delay. Generally, every microcontroller uses hardware delays where a physical device can be used
through the processor to generate the particular delay which is called a timer.
The delay can be generated through the timer based on the requirement of the processor & transmits the signal
to the processor whenever the delay gets generated.
By using this processor, we can also produce a delay based on the requirement of the system. However, this will
guide the processor to remain active all the time because it will not perform any other task in that specific period.
As a result, the existence of a timer within the microcontroller permits the processor to be free for performing other
operations.
The microcontroller also includes a program counter, data pointer, stack & stack pointer, instruction registers
including latches, temporary registers & buffers for the I/O ports.
Registers
Registers in microcontrollers are mainly used to store data and short-term instructions which are mainly used to
process addresses to fetch data. This microcontroller includes 8-bit registers which have 8-bit start from D0 to D7.
Here, D0 to D7 is LSB (least significant bit) and D7 is the most significant bit (MSB).
To make the data process better than 8-bit, then it must be separated into eight different bit parts. It includes several
registers however general-purpose type registers are frequently available to programmers. They are classified into
two types like General purpose & Special purpose. So, most of the general-purpose registers are listed below.
An accumulator is mainly used to execute arithmetic & logic instructions.
Registers like B, R0 toR7 are used for storing instruction addresses & data.
Data Pointers or DPTR is used to allow & process data in dissimilar addressing modes. This register includes DPH
(high byte) & a DPL (low byte) which is mainly used to hold a 16-bit address. So, it can be used as a base register
with no direct jumps, lookup table instructions & external data transfer.
Program counter or PC is a 16-bit register used to store the next instruction’s address to be performed
These registers are 8-bits other than program counter & data pointer registers.
Data Types
This microcontroller includes simply one 8-bit data type where the size of each register is 8-bit. If the data is
better than 8-bit, then the programmer is accountable to separate data into 8-bit parts before processing. For
assemblers, the most widely used data directive is the DB directive in assembly language.
PSW Register
The term PSW stands for Program status word, and it is one kind of register in the microcontroller. It is also called
a flag register, used to demonstrate the position of arithmetic logic instructions such as zero carry bit, carry bit, etc.
PSW or flag register is an 8-bit register where 6-bits are used. This register includes 8-flags where these flags are
known as conditional flags. These flags will perform instructions simply if the condition is satisfied.
These conditional flags are overflow, parity, auxiliary carry & carry. The Program status word registers bit numbers
like 3 & 4 are used to alter the bank registers whereas 1 & 5 are not used but they can be used by the programmer
for executing a specific task.
Register Banks
For stacks & register banks, Ram with 32 Bytes is used and these are separated into four types of banks. So,
every back includes 8-registers which range from R0 to R7. Here, R0 & R7 denotes the locations of RAM like zero
location and seventh location. The second bank register begins from location 8 & ends at 05H. The third bank
register begins from 10H & completed at the 17H location. The final bank can be placed among the 18H-1FH.
Stack
The part of RAM like Stack is mainly used through the processor for data storage otherwise address momentarily.
In a microprocessor, it is a very significant part because there are extremely restricted numbers of registers for
storing addresses and data.
53
CITS : E & H - Electronics Mechanic - Lesson 34 - 42