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

FINAL Embedded Systems Ass#ONE Final

The document discusses the elements and workings of a microcontroller. It states that a microcontroller contains a CPU, memory, and input/output peripherals on a single integrated circuit. The CPU processes data received from the I/O peripherals by accessing instructions stored in program memory and data stored in data memory. Microcontrollers are used to control single processes in embedded systems by receiving input, processing data, and communicating output through their I/O peripherals. Students submitting assignments must sign a declaration confirming the work is their own and understand the consequences of plagiarism.

Uploaded by

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

FINAL Embedded Systems Ass#ONE Final

The document discusses the elements and workings of a microcontroller. It states that a microcontroller contains a CPU, memory, and input/output peripherals on a single integrated circuit. The CPU processes data received from the I/O peripherals by accessing instructions stored in program memory and data stored in data memory. Microcontrollers are used to control single processes in embedded systems by receiving input, processing data, and communicating output through their I/O peripherals. Students submitting assignments must sign a declaration confirming the work is their own and understand the consequences of plagiarism.

Uploaded by

Ars Ramkeesoon
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 46

STUDENT ASSESSMENT SUBMISSION AND DECLARATION

When submitting evidence for assessment, each student must sign a declaration confirming that the work is their
own.

Student name: LEONCE Job Olivier Benjamin Assessor name: S. Ramguttee

ID: NC55123

Issue date: 24.08.2022 Submission date: 14.09.2022 Submitted on: 14.09.2022

Programme: Higher National Diploma in Electrical and Electronic Engineering

Unit 46: Embedded Systems

Assignment number and title: Assignment #1 – Explain the purpose of the constituent parts of a
microcontroller and evaluate microcontroller architectures

Plagiarism
Plagiarism is a particular form of cheating. Plagiarism must be avoided at all costs and students who break the rules,
however innocently, may be penalised. It is your responsibility to ensure that you understand correct referencing
practices. As a university level student, you are expected to use appropriate references throughout and keep
carefully detailed notes of all your sources of materials for material you have used in your work, including any
material downloaded from the Internet. Please consult the relevant unit lecturer or your course tutor if you need any
further advice.

Student Declaration
Student declaration
I certify that the assignment submission is entirely my own work and I fully understand the consequences of
plagiarism. I understand that making a false declaration is a form of malpractice.

Student signature: Date:

Pearson Education 2018


Higher Education Qualifications
MITD - SITEC AUTOMATION TRAINING UNIT
PEARSON BTEC HND – Electrical and Electronic Engineering
Assignment Title Explain the purpose of the constituent parts of a microcontroller and
evaluate microcontroller architectures
Unit 46 Embedded Systems

Contents

Plagiarism.....................................................................................................................................1
INTRODUCTION...........................................................................................................................................3
How do microcontrollers work?..................................................................................................................3
What are the elements of a microcontroller?.............................................................................................4
A microcontroller's other supporting components include.....................................................................5
Microcontroller features.............................................................................................................................5
Choosing the right microcontroller..............................................................................................................7
Architectures...............................................................................................................................................7
Von Neumann Architecture.....................................................................................................................7
Harvard Architecture.............................................................................................................................11
Basic Structure of a Microcontroller..........................................................................................................15
Types of Microcontrollers........................................................................................................................... 18
Microcontrollers – PIC18F4455.................................................................................................................22
MULTIPLE OSCILLATOR OPTIONS AND FEATURES.....................................................................................23
Other Special Features..........................................................................................................................24
Device Features.........................................................................................................................................26
PIC18F4455 Pin Number, Port Number and Description...........................................................................28
PIC18F4455 Block Diagram........................................................................................................................33
PIC18F4455 Architecture...........................................................................................................................34
CPU (Central Processing Unit):..................................................................................................................34
General Purpose Registers (GPR)...........................................................................................................35
Special Function Registers (SFR):...........................................................................................................35
CCP MODULE..................................................................................................................................35
Peripherals.................................................................................................................................................36
ELECTRICAL CHARACTERISTICS..................................................................................................................43
REFERENCES..............................................................................................................................................44

Date 2022 Name LEONCE Job Olivier Benjamin / NC55123


Page 2 of 44
MITD - SITEC AUTOMATION TRAINING UNIT
PEARSON BTEC HND – Electrical and Electronic Engineering
Assignment Title Explain the purpose of the constituent parts of a microcontroller and
evaluate microcontroller architectures
Unit 46 Embedded Systems

INTRODUCTION

An embedded system's microcontroller is a small integrated circuit that controls a single process.
On a single chip, a typical microcontroller has a CPU, memory, and input/output (I/O)
peripherals. Microcontrollers, also known as embedded controllers or microcontroller units
(MCU), can be found in a variety of devices, including vending machines, robotics, office
equipment, medical devices, and office machines. They are essentially straightforward mini-
personal computers (PCs) without a complicated front-end operating system that are used to
operate minor aspects of larger components (OS).

How do microcontrollers work?

To control a single device function, a microcontroller is integrated into a system. It


accomplishes this by utilizing its core CPU to evaluate data that it receives from its I/O
peripherals. The microcontroller receives temporary data that is stored in its data memory, where
the processor accesses it and employs program memory instructions to interpret and apply the
incoming data. It then communicates and takes the necessary action using its I/O peripherals.
Numerous gadgets and systems make use of microcontrollers. Devices frequently employ a
number of microcontrollers, which cooperate to carry out the device's many functions.

An automobile, for instance, might contain a large number of microcontrollers that manage a
variety of internal systems, including the anti-lock brake system, traction control, fuel injection,
and suspension control. To inform the appropriate actions, all the microcontrollers communicate
with one another. Some may just interface with other microcontrollers, while others may connect
to a more sophisticated central computer within the vehicle. They use their I/O peripherals to
send and receive data, process that data, and carry out the tasks for which it was intended.

Date 2022 Name LEONCE Job Olivier Benjamin / NC55123


Page 2 of 44
MITD - SITEC AUTOMATION TRAINING UNIT
PEARSON BTEC HND – Electrical and Electronic Engineering
Assignment Title Explain the purpose of the constituent parts of a microcontroller and
evaluate microcontroller architectures
Unit 46 Embedded Systems

What are the elements of a microcontroller?

The main elements of a microcontroller are:

 The processor (CPU) - The brain of the gadget is supposed to be a CPU. It interprets
and reacts to several commands that control how the microcontroller operates. This calls
for doing elementary logic, I/O, and arithmetic operations. Additionally, it carries out
data transmission activities that send commands to other embedded system parts.

 Memory - The data that a processor receives and uses to carry out instructions that it has
been designed to carry out is stored in a microcontroller's memory. There are two main
memory types in a microcontroller:

1. Program memory, which keeps a permanent record of the instructions the


CPU executes. Since program memory is non-volatile, it can store data
indefinitely without a power supply.

2. Data memory, which is necessary to store temporary data while instructions are
being carried out. Data memory is volatile, which means the information it
stores is only kept current if the device is plugged into a power source.

 I/O peripherals -The processor's connection to the outside world is made through its
input and output devices. Information is received by the input ports and sent as binary
data to the CPU. After receiving the data, the processor transmits the appropriate
instructions to output devices that carry out activities not controlled by the
microcontroller.

Date 2022 Name LEONCE Job Olivier Benjamin / NC55123


Page 2 of 44
MITD - SITEC AUTOMATION TRAINING UNIT
PEARSON BTEC HND – Electrical and Electronic Engineering
Assignment Title Explain the purpose of the constituent parts of a microcontroller and
evaluate microcontroller architectures
Unit 46 Embedded Systems
While the microprocessor's core components are its processor, memory, and I/O peripherals,
other components are routinely added as well. Simply said, I/O peripherals are supporting

Date 2022 Name LEONCE Job Olivier Benjamin / NC55123


Page 2 of 44
MITD - SITEC AUTOMATION TRAINING UNIT
PEARSON BTEC HND – Electrical and Electronic Engineering
Assignment Title Explain the purpose of the constituent parts of a microcontroller and
evaluate microcontroller architectures
Unit 46 Embedded Systems

devices that interface with the processor and memory. Peripherals are a broad category that
includes various supporting parts. An I/O peripheral in some form is essential to a
microprocessor because they are the means by which the processor is used.

A microcontroller's other supporting components include:

 Analog to Digital Converter (ADC) - A circuit known as an ADC transforms analog


signals into digital signals. It enables the microcontroller's central CPU to communicate
with external analog devices like sensors.

 Digital to Analog Converter (DAC) - The processor at the heart of the microcontroller
can send its outgoing signals to external analog components thanks to a DAC, which
serves the opposite purpose of an ADC.

 System bus - The system bus serves as a connecting link between each
microcontroller component.

 Serial port - One type of I/O connection that enables the microcontroller to interface to
external components is the serial port. It performs a similar purpose to a USB or
parallel port, but it exchanges bits differently.

Microcontroller features

Application determines the processor used by a microcontroller. Simple 4-bit, 8-bit, or 16-bit
processors are available, as well as more sophisticated 32- or 64-bit processors. Flash memory,
erasable programmable read-only memory (EPROM), and electrically erasable programmable
read-only memory are non-volatile memory types that microcontrollers can employ. Volatile
memory types include RAM (EEPROM). Microcontrollers often have enough onboard memory

Date 2022 Name LEONCE Job Olivier Benjamin / NC55123


Page 2 of 44
MITD - SITEC AUTOMATION TRAINING UNIT
PEARSON BTEC HND – Electrical and Electronic Engineering
Assignment Title Explain the purpose of the constituent parts of a microcontroller and
evaluate microcontroller architectures
Unit 46 Embedded Systems

and provide pins for general I/O operations so they may directly connect with sensors and other
components. As a result, they are designed to be easily useable without extra computational
components.

The Harvard architecture and von Neumann architecture, which each offer various ways of
transmitting data between the processor and memory, can be used as the foundation for
microcontroller design. A Harvard design allows for simultaneous transfers because the data bus
and instruction are independent. One bus is utilized in a Von Neumann design for both data and
instructions.

Complex instruction set computing (CISC) or reduced instruction set computing are two possible
bases for microcontroller processors (RISC). RISC typically includes 30 instructions compared
to 80 for CISC, and CISC also has more addressing modes (12–24 vs. 3-5) than RISC. CISC can
be simpler to design and utilize memory more effectively, but because it requires more clock
cycles to execute instructions, performance may suffer. Due to its streamlined instruction set and
thus more straightforward design, RISC, which prioritizes software over hardware, frequently
outperforms CISC processors in terms of performance. However, because it prioritizes software
over hardware, the program it runs may be more sophisticated. Various ISCs are employed
depending on the application.

Microcontrollers were the first devices to employ assembly language. The C programming
language is a common choice nowadays. Python and JavaScript are two other popular
microprocessor languages. Input and output pins are available on MCUs to implement
peripheral functions. Asynchronous to digital converters, LCD controllers, real-time clocks,
universal synchronous/asynchronous receiver transmitters (USART), timers, universal
asynchronous receiver transmitters (UART), and USB connectivity are a few examples of these
features.
Microcontrollers are frequently coupled with sensors that collect information on temperature,
humidity, and other variables.

Date 2022 Name LEONCE Job Olivier Benjamin / NC55123


Page 2 of 44
MITD - SITEC AUTOMATION TRAINING UNIT
PEARSON BTEC HND – Electrical and Electronic Engineering
Assignment Title Explain the purpose of the constituent parts of a microcontroller and
evaluate microcontroller architectures
Unit 46 Embedded Systems

Choosing the right microcontroller

When selecting a microcontroller for a project, there are a lot of technological and commercial
factors to take into account. Beyond price, it's crucial to take into account an MCU's maximum
speed, RAM or ROM capacity, number or type of I/O pins, power consumption and restrictions,
and development support. Make sure to inquire about things like:

 What hardware peripherals are required?

 Are external communications needed?

 What architecture should be used?

 What sort of community and resources are available for the microcontroller?

 What is the market availability of the microcontroller?

Architectures

Von Neumann Architecture:


A digital computer architecture known as the "Von Neumann Architecture" is based on the idea
of stored program computers, where both program data and instruction data are kept in the same
memory. John Von Neumann, a well-known mathematician and physicist, created this
architecture in 1945.

Date 2022 Name LEONCE Job Olivier Benjamin / NC55123


Page 2 of 44
MITD - SITEC AUTOMATION TRAINING UNIT
PEARSON BTEC HND – Electrical and Electronic Engineering
Assignment Title Explain the purpose of the constituent parts of a microcontroller and
evaluate microcontroller architectures
Unit 46 Embedded Systems

Structure of Von Neumann Architecture:

Figure 1

Generally there have been 2 types of Computers:

 Fixed Program Computers: Their function is very specific and they couldn’t
be programmed, e.g. Calculators.

 Stored Program Computers: These can be programmed to carry out many


different tasks, applications are stored on them, hence the name.

The current computers are built on a stored-program concept established by John Von Neumann.
Programs and data are stored in a separate storage device called memory and are treated equally
in this stored-program model. A computer made using this design would be considerably simpler
to program thanks to this innovative concept. It also goes by the name "IAS computer," and it
consists of three essential parts:
1. The Central Processing Unit (CPU)

Date 2022 Name LEONCE Job Olivier Benjamin / NC55123


Page 2 of 44
MITD - SITEC AUTOMATION TRAINING UNIT
PEARSON BTEC HND – Electrical and Electronic Engineering
Assignment Title Explain the purpose of the constituent parts of a microcontroller and
evaluate microcontroller architectures
Unit 46 Embedded Systems

2. The Main Memory Unit


3. The Input/Output Device

 Control Unit:
A control unit (CU) handles all processor control signals. It directs all input and output
flow, fetches code for instructions and controlling how data moves around the system.

 Arithmetic and Logic Unit (ALU):


The arithmetic logic unit is that part of the CPU that handles all the calculations the CPU
may need, e.g. Addition, Subtraction, Comparisons. It performs Logical Operations, Bit
Shifting Operations, and Arithmetic Operation.

Figure 2 – Basic CPU structure, illustrating ALU

Main Memory Unit (Registers):

 Accumulator: Stores the results of calculations made by ALU.

Date 2022 Name LEONCE Job Olivier Benjamin / NC55123


Page 2 of 44
MITD - SITEC AUTOMATION TRAINING UNIT
PEARSON BTEC HND – Electrical and Electronic Engineering
Assignment Title Explain the purpose of the constituent parts of a microcontroller and
evaluate microcontroller architectures
Unit 46 Embedded Systems

 Program Counter (PC): Keeps track of the memory location of the next
instructions to be dealt with. The PC then passes this next address to Memory
Address Register (MAR).
 Memory Address Register (MAR): It stores the memory locations of instructions
that need to be fetched from memory or stored into memory.
 Memory Data Register (MDR): It stores instructions fetched from memory or any
data that is to be transferred to, and stored in, memory.
 Current Instruction Register (CIR): It stores the most recently fetched
instructions while it is waiting to be coded and executed.
 Instruction Buffer Register (IBR): The instruction that is not to be executed
immediately is placed in the instruction buffer register IBR.

 Input/Output Devices – Program or data is read into main memory from the input
device or secondary storage under the control of CPU input instruction. Output devices are
used to output the information from a computer. If some results are evaluated by computer
and it is stored in the computer, then with the help of output devices, we can present it to
the user.

 Buses – Data is transmitted from one part of a computer to another, connecting all major
internal components to the CPU and memory, by the means of Buses. Types:
 Data Bus: It carries data among the memory unit, the I/O devices, and the
processor.
 Address Bus: It carries the address of data (not the actual data) between
memory and processor.
 Control Bus: It carries control commands from the CPU (and status signals
from other devices) in order to control and coordinate all the activities within
the computer.

Date 2022 Name LEONCE Job Olivier Benjamin / NC55123


Page 2 of 44
MITD - SITEC AUTOMATION TRAINING UNIT
PEARSON BTEC HND – Electrical and Electronic Engineering
Assignment Title Explain the purpose of the constituent parts of a microcontroller and
evaluate microcontroller architectures
Unit 46 Embedded Systems

Von Neumann bottleneck:


No matter what we try to improve performance, we cannot escape the fact that instructions can
only be completed one at a time and in a specific order. Both of these factors limit the CPU's
capability. This is referred to as the "Von Neumann bottleneck" in common parlance. We can
give a Von Neumann processor more cache, RAM, or faster components, but if significant
improvements in CPU performance are to be made, a thorough examination of the CPU
configuration is required.
We use this architecture, which is crucial, in both our PCs and Super Computers.

Harvard Architecture:
The Harvard Architecture is a type of digital computer architecture that is founded on the idea
that there should be distinct buses (signal paths) for data and instruction traffic. It was
primarily created to get around Von Neumann Architecture's bottleneck.

Figure 3

Information is stored in the same memory as instructions in a typical computer that uses von
Neumann architecture. Thus, instructions and data are fetched via the same buses. This

Date 2022 Name LEONCE Job Olivier Benjamin / NC55123


Page 2 of 44
MITD - SITEC AUTOMATION TRAINING UNIT
PEARSON BTEC HND – Electrical and Electronic Engineering
Assignment Title Explain the purpose of the constituent parts of a microcontroller and
evaluate microcontroller architectures
Unit 46 Embedded Systems

indicates that a CPU cannot read an instruction and read or write data at the same time. The
Harvard Architecture is a type of computer architecture that has distinct buses (signal paths)
for data and instruction storage. It was primarily created to get around Von Neumann
Architecture's bottleneck. The ability of the CPU to access instructions and read/write data
simultaneously is the main benefit of having separate buses for instructions and data.
Structure of Harvard Architecture:

Figure 4

 Buses:
Buses are used as signal pathways. In Harvard architecture there are separate buses for both
instruction and data. Types of Buses:
Data Bus: It carries data among the main memory system, processor and I/O devices.
Data Address Bus: It carries the address of data from processor to main memory system.
Instruction Bus: It carries instructions among the main memory system, processor and I/O
devices.
Instruction Address Bus: It carries the address of instructions from processor to main
memory system.

Date 2022 Name LEONCE Job Olivier Benjamin / NC55123


Page 2 of 44
MITD - SITEC AUTOMATION TRAINING UNIT
PEARSON BTEC HND – Electrical and Electronic Engineering
Assignment Title Explain the purpose of the constituent parts of a microcontroller and
evaluate microcontroller architectures
Unit 46 Embedded Systems

 Operational Registers:
There are different types of registers involved in it which are used for storing address of
different types of instructions.
For example, Memory Address Register and Memory Data Register are operational
registers.

 Program Counter:
It has the location of the next instruction to be executed. Program counter then passes this
next address to memory address register.
 Arithmetic and Logic Unit:
Arithmetic logic unit is that part of the CPU that operates all the calculations needed. It
performs addition, subtraction, comparison, logical Operations, bit Shifting Operations and
various arithmetic operations.

 Control Unit:
Control unit the part of CPU that operates all processor control signals. It controls the input
and output devices and also control the movement of instructions and data within the
system.

 Input/Output System:
Input devices are used to read data into main memory with the help of CPU input
instruction. The information from a computer as output are given through Output devices.
Computer gives the results of computation with the help of output devices.

Date 2022 Name LEONCE Job Olivier Benjamin / NC55123


Page 2 of 44
MITD - SITEC AUTOMATION TRAINING UNIT
PEARSON BTEC HND – Electrical and Electronic Engineering
Assignment Title Explain the purpose of the constituent parts of a microcontroller and
evaluate microcontroller architectures
Unit 46 Embedded Systems

Table 1

VON NEUMANN ARCHITECTURE HARVARD ARCHITECTURE


It is an ancient computer architecture based It is a modern computer architecture based
on stored program computer concept. on Harvard Mark I relay based model.
Same physical memory address is used for A separate physical memory address is used
instructions and data. for instructions and data.
There is common bus for data and Separate buses are being used for
instruction transfer. transferring data and instruction.
Two clock cycles are required to execute a Instruction is executed in a single cycle.
single instruction.
It is cheaper in cost. It is costly than compared to van neumann
architecture.
Simple in design. Complex in design
CPU cannot access instructions and CPU can access instructions and read/write
read/write at the same time. at the same time.
It is used in personal computers and small It is used in micro controllers and signal
computers. processing.
Higher speed, thus less time consuming. Slower in speed, thus more time-consuming.
(Byjus, 2022)

Date 2022 Name LEONCE Job Olivier Benjamin / NC55123


Page 2 of 44
MITD - SITEC AUTOMATION TRAINING UNIT
PEARSON BTEC HND – Electrical and Electronic Engineering
Assignment Title Explain the purpose of the constituent parts of a microcontroller and
evaluate microcontroller architectures
Unit 46 Embedded Systems

Basic Structure of a Microcontroller

Figure 5

The image above illustrate some components of Microcontroller are:

 The CPU (Central Processing Unit).


 The Memory.
 The I/O Ports.
 Bus
 Timers/Counters
 Serial Port
 Interrupts
 ADC (Analog to Digital Converter)
 DAC (Digital to Analog Converter)

 CPU

CPU (Central Processing Unit) is known as the brain or microprocessor of the Microcontroller. It
controls all of the instructions/data flow that it receives. It consists of an Arithmetic Logic Unit
(ALU) which performs arithmetic and logical operations and a Control Unit (CU) which handles

Date 2022 Name LEONCE Job Olivier Benjamin / NC55123


Page 2 of 44
MITD - SITEC AUTOMATION TRAINING UNIT
PEARSON BTEC HND – Electrical and Electronic Engineering
Assignment Title Explain the purpose of the constituent parts of a microcontroller and
evaluate microcontroller architectures
Unit 46 Embedded Systems

all of the processor’s instruction executions. A CPU reads, decodes and executes instructions to
perform Arithmetic, Logic and Data Transfer operations in a system.

 Memory

In any Computational System requires two types of Memory:

 Program Memory:

It contains the program i.e. the instructions to be executed by the CPU. Program Memory is a
Read Only Memory or ROM

 Data Memory:

It required to store temporary data while executing the instructions and can be accessed quickly.
It provides quick read-and-write access to the storage device. Data Memory is a Random
Access Memory or RAM. Data Memory is sometimes called as Read Write Memory (R/W M).

This differs from most other memories as it takes longer for data to be extracted since the data
isn’t readily available. As we can see RAM have access to the surface of data – easily
reachable
– but anything that dives deeper will require a different type of memory. RAM improves total
system performance because it allows the microcontroller to work with more information at the
same time. Since RAM is temporary data, its content is always erased when the
microcontroller is shut down.

 I/O Ports:

I/O ports are what the microcontroller uses to connect to real-world applications. Inputs receive
changes in the real-world, from temperature sensing, to motion sensing, to push buttons, and
much more. Inputs device like Switches, Keypads, etc. provide information from the user to the
CPU in the form of Binary Data.

Date 2022 Name LEONCE Job Olivier Benjamin / NC55123


Page 2 of 44
MITD - SITEC AUTOMATION TRAINING UNIT
PEARSON BTEC HND – Electrical and Electronic Engineering
Assignment Title Explain the purpose of the constituent parts of a microcontroller and
evaluate microcontroller architectures
Unit 46 Embedded Systems

The CPU, upon receiving the data from the input devices, executes appropriate instructions and
gives response through Output Devices like LEDs, Displays, Printers, etc. The figure below
shows some common input and output components.

 Bus:

Another important component of a Microcontroller, but rarely discussed is the System Bus. A
System bus is a group of connecting wire that connect the CPU with other peripherals like
Memory, I/O Ports and other supporting components.

 Serial Bus Interface:

A Serial Bus Interface is the serial communication in the microcontroller, sending data one bit
at a time. With microcontroller boards, it connects ICs with signal traces on a printed circuit
board (PCB). For ICs, they use serial bus to transfer data to reduce the number of pins in a
package making them more cost effective. Examples of serial buses in ICs are SPIs or I2Cs.

 Timers/Counters:

One of the important components of a Microcontroller are the Timers and Counters. They
provide the operations of Time Delays and counting external events. Additionally, Timers and
Counters can provide Function Generation, Pulse Width Modulation, Clock Control, etc.

 Serial Port:

One of the important requirements of a Microcontroller is to communicate with other device


and peripherals (external). Serial Port proves such interface through serial communication.
Most common serial communication implemented in Microcontrollers is UART.

 Interrupts:

A very important feature of a Microcontroller is Interrupts and its Interrupt Handling


Mechanism. Interrupts can be external, internal, hardware related or software related.
Date 2022 Name LEONCE Job Olivier Benjamin / NC55123
Page 2 of 44
MITD - SITEC AUTOMATION TRAINING UNIT
PEARSON BTEC HND – Electrical and Electronic Engineering
Assignment Title Explain the purpose of the constituent parts of a microcontroller and
evaluate microcontroller architectures
Unit 46 Embedded Systems

 ADC (Analog to Digital Converter):

Analog to Digital Converter or ADC is a circuit that converts Analog signals to Digital Signals.
The ADC Circuit forms the interface between the external Analog Input devices and the CPU
of the Microcontroller. Almost all sensors are analog devices and the analog data from these
sensors must be converted in to digital data for the CPU to understand.

 DAC (Digital to Analog Converter):

Digital to Analog Converter or DAC is a circuit, that works in contrast to an ADC i.e. it
converts Digital Signals to Analog Signals. DAC forms the bridge between the CPU of the
Microcontroller and the external analog devices.

Use of Flash Memory in Microcontrollers:

Flash Memory is a type of non-volatile memory that, unlike RAM, retains its data for an
extended period, even if the microcontroller is turned off. This keeps the saved program that you
might have uploaded to the microcontroller. Flash Memory writes to a “block” or “sector” at a
time, so if you need to just re-write one byte, Flash Memory will need to re-write the whole
block that the byte is in, which can wear out quicker.

Types of Microcontrollers:

Microcontrollers are divided into various categories based on memory, architecture, bits and
instruction sets. Following is the list of their types −

Bit:

Based on bit configuration, the microcontroller is further divided into three categories.

8-bit microcontroller:
This type of microcontroller is used to perform arithmetic and logical operations like addition,

Date 2022 Name LEONCE Job Olivier Benjamin / NC55123


Page 2 of 44
MITD - SITEC AUTOMATION TRAINING UNIT
PEARSON BTEC HND – Electrical and Electronic Engineering
Assignment Title Explain the purpose of the constituent parts of a microcontroller and
evaluate microcontroller architectures
Unit 46 Embedded Systems

subtraction, multiplication division, etc. For example, Intel 8031 and 8051 are 8 bits
microcontroller.

16-bit microcontroller:

This type of microcontroller is used to perform arithmetic and logical operations where
higher accuracy and performance is required. For example, Intel 8096 is a 16-bit
microcontroller.

32- bit microcontroller:

This type of microcontroller is generally used in automatically controlled appliances like


automatic operational machines, medical appliances, etc.

Memory:
The memory configuration, the microcontroller is further divided into two categories.

External memory microcontroller: This type of microcontroller is designed in such a way that
they do not have a program memory on the chip. Hence, it is named as external memory
microcontroller. For example: Intel 8031 microcontroller.

Embedded memory microcontroller: This type of microcontroller is designed in such a way


that the microcontroller has all programs and data memory, counters and timers, interrupts,
I/O ports are embedded on the chip. For example: Intel 8051 microcontroller.

Instruction Set:
The instruction set configuration; the microcontroller is further divided into two categories.

CISC − CISC stands for complex instruction set computer. It allows the user to insert a single
instruction as an alternative to many simple instructions.

RISC − RISC stands for Reduced Instruction Set Computers. It reduces the operational time by
shortening the clock cycle per instruction.

Advantages of Microcontrollers:
Date 2022 Name LEONCE Job Olivier Benjamin / NC55123
Page 2 of 44
MITD - SITEC AUTOMATION TRAINING UNIT
PEARSON BTEC HND – Electrical and Electronic Engineering
Assignment Title Explain the purpose of the constituent parts of a microcontroller and
evaluate microcontroller architectures
Unit 46 Embedded Systems

A Microcontroller fits the computer-on-a-chip idea.

Date 2022 Name LEONCE Job Olivier Benjamin / NC55123


Page 2 of 44
MITD - SITEC AUTOMATION TRAINING UNIT
PEARSON BTEC HND – Electrical and Electronic Engineering
Assignment Title Explain the purpose of the constituent parts of a microcontroller and
evaluate microcontroller architectures
Unit 46 Embedded Systems

No need for any external interfacing of basic components like Memory, I/O Ports, etc.

Microcontrollers doesn’t require complex operating systems as all the instructions must be
written and stored in the memory. (RTOS is an exception).

All the Input and Output Ports are programmable.

Integration of all the essential components reduces the cost, design time and area of the product
(or application).

Disadvantages of Microcontrollers:

Microcontrollers are not known for their computation power.

The amount of memory limits the instructions that a microcontroller can

execute. No Operating System and hence, all the instruction must be written.

Because microcontrollers are suitable for specific tasks, it is essential to choose a microcontroller
that is most appropriate for a project. There are many factors to take into consideration. Below is
a list of factors that are usually taken into consideration:

 Power efficiency:

There is a trade-off between processing performance and power consumption: a device with
higher processing power will consume more energy. Therefore, if your microcontroller is
wireless and running on a rechargeable battery, you need to weigh sacrificing power efficiency
against getting more processing power, or vice versa.

 Security:

Hacking which targets IOT devices is rising, a threat that is especially relevant to
microcontrollers used in automobiles. In response, microcontroller makers are implementing
layers of security such as cryptography and physical security. Now, users can purchase
microcontrollers that have been certified to the latest security standards or use MCUs with on-
chip secure hardware.

 Hardware architecture:

Date 2022 Name LEONCE Job Olivier Benjamin / NC55123


Page 2 of 44
MITD - SITEC AUTOMATION TRAINING UNIT
PEARSON BTEC HND – Electrical and Electronic Engineering
Assignment Title Explain the purpose of the constituent parts of a microcontroller and
evaluate microcontroller architectures
Unit 46 Embedded Systems

A microcontroller’s packaging directly influences its size and performance. Dual in-line
packaging is the most common type. Small-outline transistors have a small footprint, and quad
flat packs take up more areas but less vertical space. Wafer level chip-scales are much smaller
and pack in more processing power but are more expensive to manufacture. Flat no-lead
packages are better in heat diffusion. Ball grid arrays (BGAs) have high performance due to
the compact package but also cost more to fabricate.

 Processing power:

How much processing power do you require for the task, will a single core processor suffice, or
do you need a dual-core? A multicore processor will be significantly faster, but it will also
consume more energy. Also, will a graphics processing unit (GPU) be necessary?

 Memory:

The amount of memory (RAM and ROM) you need will depend on the programs you will
be running. More programs need more random access memory (RAM). In addition, a GPU
will require not only more RAM but faster read/write time as well.

 Hardware interface:

The nature of the task will dictate the need for hardware interfaces such as USB, Wi-Fi,
Bluetooth, audio, video, or camera.

 Software architecture:

Some microcontrollers are operable on multiple OSs, and others are not. If you need to scale, it
is better to use the same software architecture to increase interoperability.

 Cost:
Date 2022 Name LEONCE Job Olivier Benjamin / NC55123
Page 21 of 44
MITD - SITEC AUTOMATION TRAINING UNIT
PEARSON BTEC HND – Electrical and Electronic Engineering
Assignment Title Explain the purpose of the constituent parts of a microcontroller and
evaluate microcontroller architectures
Unit 46 Embedded Systems

Microcontrollers fall within a wide price range, from a hundred units for a few dollars to a few
dollars per unit. If you want to scale, you need to consider the overall cost versus the individual
performance power of a microcontroller.

Microcontrollers – PIC18F4455:

Figure 6

The benefits of all are available with this family of devices. High computing performance PIC18
microcontrollers’ performance at a reasonable cost with the addition of enhanced Flash program
memory with high endurance. Additionally to these capabilities, the PIC18F4455 series adds
design characteristics. These microcontrollers include improvements that make them an obvious
choice for many high-performance, power-sensitive applications.

New core features

The PIC18F4455 series of products all include a number of features that can dramatically lower
operating power consumption. Important items include:

• Alternate Run Modes: Power consumption during code execution can be decreased by up
to 90% by using the internal oscillator block or the Timer1 source to clock the controller.

Date 2022 Name LEONCE Job Olivier Benjamin / NC55123


Page 22 of 44
MITD - SITEC AUTOMATION TRAINING UNIT
PEARSON BTEC HND – Electrical and Electronic Engineering
Assignment Title Explain the purpose of the constituent parts of a microcontroller and
evaluate microcontroller architectures
Unit 46 Embedded Systems

• Multiple Idle Modes: The controller can also function with the CPU core turned off but the
peripherals activated. In these conditions, power consumption can be cut to as little as 4% of
what is needed for typical operation.

• On-the-Fly Mode Switching: The power-managed modes are activated by user code while
the system is running, giving users the opportunity to build power-saving features into the
software architecture of their applications.

• Low Consumption in Key Modules: Both Timer1 and the Watchdog Timer use the
least amount of power possible.

UNIVERSAL SERIAL BUS (USB)

The PIC18F4455 series includes a fully functional USB 2.0 Specification Revision 2.0 compliant
communications module for the Universal Serial Bus. For all supported data transfer types, the
module enables both low-speed and full-speed connection. Additionally, it enables the use of
external transceivers and voltage regulators and has an on-chip 3.3V regulator of its own.

MULTIPLE OSCILLATOR OPTIONS AND FEATURES


The twelve distinct oscillator options provided by the PIC18F4455 give users a wide range of
possibilities when designing application hardware. These consist of:

• Four Crystal modes using crystals or ceramic resonators.

• Four External Clock modes, offers the choice of using one pin (oscillator input) or two
pins (oscillator input plus a divide-by-4 clock output).

• An internal oscillator block which supplies a total of 8 clock frequencies, including an 8


MHz clock (±2% accuracy), an INTRC source (about 31 kHz, stable over temperature and
VDD), and a range of 6 user-selectable clock frequencies, between 125 kHz and 4 MHz. By
choosing this, an oscillator pin can now be used as an extra general-purpose I/O.

Date 2022 Name LEONCE Job Olivier Benjamin / NC55123


Page 23 of 44
MITD - SITEC AUTOMATION TRAINING UNIT
PEARSON BTEC HND – Electrical and Electronic Engineering
Assignment Title Explain the purpose of the constituent parts of a microcontroller and
evaluate microcontroller architectures
Unit 46 Embedded Systems

• A Phase Lock Loop (PLL) frequency multiplier. The High-Speed Crystal and External
Oscillator modes also have access to this feature, which enables a broad range of clock
rates from 4 MHz to 48 MHz

• Asynchronous dual clock operation, allows the remainder of the microcontroller to be


clocked by an internal low-power oscillator while the USB module runs off of a high-frequency
oscillator. The internal oscillator block offers a stable reference source in addition to serving as
a clock source, giving the family additional capabilities for reliable operation.

• Fail-Safe Clock Monitor: With this option, the internal oscillator's reference signal is
continuously compared to the main clock source. The controller switches to the internal
oscillator block in the event of a clock breakdown, enabling safe application shutdown or
ongoing low-speed operation.

• Two-Speed Start-up: Until the primary clock source is available, this option enables the
internal oscillator to function as the clock source from Power-on Reset or wake the device from
Sleep mode.

Other Special Features


• Memory Endurance: For program memory and data EEPROM, the Enhanced Flash cells
are rated to withstand tens of thousands of erase/write cycles, up to 100,000 for program
memory and 1,000,000 for EEPROM. It is conservatively projected that data retention without
refresh will last for more than 40 years.

• Self-Programmability: Under internal software control, these devices have the ability to
write to their own program memory locations. The protected Boot Block at the top of program
memory contains a bootloader routine that can be used to develop an application that can update
itself in the field.

Date 2022 Name LEONCE Job Olivier Benjamin / NC55123


Page 24 of 44
MITD - SITEC AUTOMATION TRAINING UNIT
PEARSON BTEC HND – Electrical and Electronic Engineering
Assignment Title Explain the purpose of the constituent parts of a microcontroller and
evaluate microcontroller architectures
Unit 46 Embedded Systems

• Extended Instruction Set: With 8 new instructions and an Indexed Literal Offset Addressing
mode, PIC18F4455 adds an optional enhancement to the PIC18 instruction set. The purpose of
this addition, which can be activated as a device configuration option, is to streamline re-
entrant application code that was initially written in high-level languages like C.

• Enhanced CCP Module: This module offers 1, 2, or 4 modulated outputs for half-bridge and
full-bridge driver control while operating in PWM mode. Other capabilities include auto-restart
to revive outputs when the condition has cleared and auto-shutdown to disable PWM outputs on
interrupt or other specific conditions.

• Enhanced Addressable USART: This serial communication module supports the LIN bus
protocol and can operate according to RS-232 standards. Automatic Baud Rate Detection and a
16-bit Baud Rate Generator for better resolution are other improvements. The EUSART
ensures steady functioning for applications that communicate with the outside world when the
microcontroller is using the internal oscillator block and does not require an external crystal (or
its accompanying power requirement).

• 10-Bit A/D Converter: With the help of this module's configurable acquisition time, it is
possible to choose a channel and start a conversion right away, cutting down on code
overhead.

• Dedicated ICD/ICSP Port: Debugging and programming pins are now available with these
devices, and they are not multiplexed with other microcontroller functionalities. This
functionality, which is available as an option in some packages, enables users to create I/O-heavy
applications while maintaining the ability to program and debug in the circuit.

Date 2022 Name LEONCE Job Olivier Benjamin / NC55123


Page 25 of 44
MITD - SITEC AUTOMATION TRAINING UNIT
PEARSON BTEC HND – Electrical and Electronic Engineering
Assignment Title Explain the purpose of the constituent parts of a microcontroller and
evaluate microcontroller architectures
Unit 46 Embedded Systems

Device Features

Table 2

Features PIC18F4455

Operating Frequency DC – 48 MHz

Program Memory (Bytes) 24576

Program Memory (Instructions) 12288

Data Memory (Bytes) 2048

Data EEPROM Memory (Bytes) 256

Interrupt Sources 20

I/O Ports Ports A, B, C, D, E

Timers 4

Capture/Compare/PWM Modules 1

Enhanced Capture/ 1

Date 2022 Name LEONCE Job Olivier Benjamin / NC55123


Page 26 of 44
MITD - SITEC AUTOMATION TRAINING UNIT
PEARSON BTEC HND – Electrical and Electronic Engineering
Assignment Title Explain the purpose of the constituent parts of a microcontroller and
evaluate microcontroller architectures
Unit 46 Embedded Systems

Compare/PWM Modules

Serial Communications MSSP,


Enhanced USART

Universal Serial Bus (USB) 1


Module

Streaming Parallel Port (SPP) Yes

10-Bit Analog-to-Digital Module 13 Input Channels

Comparators 2

Resets (and Delays) POR, BOR,


RESET Instruction,
Stack Full,
Stack Underflow
(PWRT, OST),
MCLR (optional),
WDT

Programmable Low-Voltage Yes


Detect

Date 2022 Name LEONCE Job Olivier Benjamin / NC55123


Page 27 of 44
MITD - SITEC AUTOMATION TRAINING UNIT
PEARSON BTEC HND – Electrical and Electronic Engineering
Assignment Title Explain the purpose of the constituent parts of a microcontroller and
evaluate microcontroller architectures
Unit 46 Embedded Systems

Programmable Brown-out Reset Yes

Instruction Set 75 Instructions;


83 with Extended
Instruction Set
enabled

Packages 40-pin PDIP


44-pin QFN
44-pin TQFP

PIC18F4455 Pin Number, Port Number and Description

Figure 7

Date 2022 Name LEONCE Job Olivier Benjamin / NC55123


Page 28 of 44
MITD - SITEC AUTOMATION TRAINING UNIT
PEARSON BTEC HND – Electrical and Electronic Engineering
Assignment Title Explain the purpose of the constituent parts of a microcontroller and
evaluate microcontroller architectures
Unit 46 Embedded Systems

Figure 8

 Pin 1: (MCLR; VPP; RE3): This pin refers to Master Clear Input
(RESET), Programming Voltage Input, and I/O Pin 3 of PORTE.
 Pin 2: (RA0; AN0): This pin refers to time PORTA I/O Pin 0 of PORTA and Analog
Input 0
 Pin 3: (RA1; AN1): This pin refers to I/O Pin 1 of PORTA and Analog Input 1.
 Pin 4: (RA2; VREF; CVREF; AN2): This pin refers to I/O Pin 2 of PORTA, A/D
reference Voltage Input (low), Analog Comparator Reference Output, and Analog
Input 2.
 Pin 5: (RA3; AN3; VREF): This pin refers to I/O Pin 3 of PORTA, Analog Input
3, and A/D reference Voltage Input (High).
 Pin 6: (RA4; T0CK1; C1OUT; RCV): This pin refers to I/O pin 4 of PORTA,
Timer 0 external clock input, Comparator 1 output, and External USB Transceiver
RCV input.

Date 2022 Name LEONCE Job Olivier Benjamin / NC55123


Page 29 of 44
MITD - SITEC AUTOMATION TRAINING UNIT
PEARSON BTEC HND – Electrical and Electronic Engineering
Assignment Title Explain the purpose of the constituent parts of a microcontroller and
evaluate microcontroller architectures
Unit 46 Embedded Systems

 Pin 7: (RA5; AN4; SS; HLVDIN; C2OUT): This pin refers to I/O pin 5 of PORTA,
Analog Input 4, SPI Slave Select input, High/Low-level Voltage Detect Input,
Comparator 2 output.
 Pin 8: (RE0; AN5; CK1SPP): This pin refers to I/O PIN 0 of PORTE, Analog
Input 5, and SPP clock 1 output.
 Pin 9: (RE1; AN6; CK2SPP): This pin refers to PORTE I/O PIN 1, Analog
Input, and SPP clock 2 output.
 Pin 10: (RE2; AN7; OESPP): This pin refers to I/O PIN 2 of PORTE, Analog
Input 7, and SPP Enable output.
 Pin 11: (VDD): This pin refers to 5 Volts positive power supply.
 Pin 12: (VSS): This pin refers to Ground (0V).
 Pin 13: (OSC1; CLKI): This pin refers to Oscillator pin 1 and External clock
source input.
 Pin 14: (OSC2; CLKO; RA6): This pin refers to Oscillator pin 2, a clock
source output.
and PORTA I/O PIN 6.
 Pin 15: (RC0; T1OSO; T13CKL): This pin refers to PORT C I/O pin 0, Timer
0 oscillator output, and Timer 1/ Timer 3 external clock input.
 Pin 16: (RC1; T1OSL; CCP2; UOE): This pin refers to PORTC I/O PIN 1, Timer
1 Oscillator input, Capture 2 input or compares 2 output/PWM2 output and External
USB transceiver OE output.
 Pin 17: (RC2; CCP1; P1A): This pin refers to PORTC I/O PIN 2, capture 1
input/ compare 1output/ PWM1 output and Enhanced CCP1 PWM output, channel
A.
 Pin 18: (VUSB): This pin refers to Internal USB 3.3V regulator voltage output.
 Pin 19: (RD0; SPP0): This pin refers to PORT D I/O pin 0 and Streaming
parallel port data.
 Pin 20: (RD1; SPP1): This pin refers to PORT D I/O PIN 1 and Streaming
parallel port data.
Date 2022 Name LEONCE Job Olivier Benjamin / NC55123
Page 30 of 44
MITD - SITEC AUTOMATION TRAINING UNIT
PEARSON BTEC HND – Electrical and Electronic Engineering
Assignment Title Explain the purpose of the constituent parts of a microcontroller and
evaluate microcontroller architectures
Unit 46 Embedded Systems

 Pin 21:(RD2; SPP2): This pin refers to PORT D I/O PIN 2 and Streaming
parallel port data.
 Pin 22:(RD3; SPP3): This pin refers to PORT D I/O PIN 3 and Streaming
parallel port data.
 Pin 23: (RC4;D-; VM): This pin refers to PORT C I/O PIN 4, USB differential minus
line (input/output), and External USB transceiver VM input.
 Pin 24:(RC5; D+; VP): This pin refers to I/O PIN 5 of PORT C, USB
different (input/output) plus line, and External USB transceiver VP output.
 Pin 25:(RC6; TX, CK): This pin refers to I/O PIN 6 of PORT C,
EUSART asynchronous transmit, and EUSART synchronous clock
(RX/DT).
 Pin 26:(RC7; RX; DT; SDO): This pin refers to I/O PIN 7 of PORT C,
EUSART asynchronous receive, EUSART synchronous data (TX/CK), and SDO:
SPI data output.
 Pin 27:(RD4; SPP4): This pin refers to I/O PIN 4 of PORT D and Streaming
parallel port data.
 Pin 28: (RD5; SPP5; P1B): This pin refers to I/O PIN 5 of PORT D, Streaming
parallel port data and Enhanced CCP1 PWM output, channel B.
 Pin 29: (RD6; SPP6; P1C): This pin refers to I/O PIN 6 of PORT D, streaming
parallel port data and Enhanced CCP1 PWM output, channel C.
 Pin 30: (RD7; SPP7; P1D): This pin refers to I/O PIN 7 of PORT D, streaming
parallel port data and Enhanced CCP1 PWM output, channel D.
 Pin 31:(VSS): This pin refers to a 5V Positive power supply.
 Pin 32:(VDD): This pin refers is for the Ground connection.
 Pin 33: (RB0; AN12; INT0; FLT0; SDI; SDA): This pin refers to I/O pin 0 of
PORT B, Analog input 12, External interrupt 0, Enhanced PWM fault input ( module
ECCP1), SPI data in and I2C data I/O.
 Pin 34: (RB1; AN10; INT1; SCK; SCL): This pin refers to I/O pin 1 of PORT B,
Analog input 10, External interrupt 1, Synchronous serial clock input/output for SPi
module, and synchronous serial clock input/output for the I2C module.
Date 2022 Name LEONCE Job Olivier Benjamin / NC55123
Page 31 of 44
MITD - SITEC AUTOMATION TRAINING UNIT
PEARSON BTEC HND – Electrical and Electronic Engineering
Assignment Title Explain the purpose of the constituent parts of a microcontroller and
evaluate microcontroller architectures
Unit 46 Embedded Systems

 Pin 35: (RB2; AN8; INT2; VMO): This pin refers to I/O pin 2 of PORT B,
Analog input 8, External interrupt 2, and External USB transceiver VMO output.
 Pin 36: (RB3; AN9; CCP2; PWM; VPO): This pin refers to I/O pin 3 of PORT B,
Analog input 9, capture 2 input / Compare 2 output / PWM output, and External
USB transceiver VPO Output.
 Pin 37: (RB4; AN11; KBI0; CSSPP): I/O Pin 4 of PORT B, Analog Input 11,
Interrupt-on-change pin, and SPP chip select control output.
 Pin 38: (RB5; KBI1; PGM): This pin refers to I/O Pin 5 of PORT B, Interrupt-on-
change pin and Low-voltage ICSP programming enable pin.
 Pin 39:(RB6; KBI2; PGC): This pin refers to I/O pin 6 of port B, Interrupt-on-
change pin and In-circuit debugger, and ICSP programming clock pin.
 Pin 40: (RB7; KBI3; PGD): This pin refers to I/O pin 7 of PORT B, Interrupt-on-
change pin and In-circuit debugger, and ICSP Programming data pin.

Date 2022 Name LEONCE Job Olivier Benjamin / NC55123


Page 32 of 44
MITD - SITEC AUTOMATION TRAINING UNIT
PEARSON BTEC HND – Electrical and Electronic Engineering
Assignment Title Explain the purpose of the constituent parts of a microcontroller and
evaluate microcontroller architectures
Unit 46 Embedded Systems

PIC18F4455 Block Diagram

Date 2022 Name LEONCE Job Olivier Benjamin / NC55123


Page 33 of 44
MITD - SITEC AUTOMATION TRAINING UNIT
PEARSON BTEC HND – Electrical and Electronic Engineering
Assignment Title Explain the purpose of the constituent parts of a microcontroller and
evaluate microcontroller architectures
Unit 46 Embedded Systems

PIC18F4455 Architecture

The Harvard architecture-based PIC18F4455 supports RISC architecture (Reduced Instruction


Set Computer). The RAM, ROM, stack, CPU, timers, counter, ADC, DAC, serial
communication, CCP module, and I/O ports make up the PIC microcontroller architecture.
Additionally, the PIC microcontroller supports CAN, SPI, and UART protocols for interacting
with additional peripherals.

Figure 9

CPU (Central Processing Unit):

PIC microcontroller’s CPU consists of

 Arithmetic logic unit (ALU)


 Memory unit (MU)
 Control unit (CU)
 Accumulator
ALU is employed in both arithmetic and logical choices. After processing, the instructions are
stored in memory. The CPU-connected internal and external peripherals are controlled by a
control unit, and the results are stored in an accumulator.
Date 2022 Name LEONCE Job Olivier Benjamin / NC55123
Page 33 of 44
MITD - SITEC AUTOMATION TRAINING UNIT
PEARSON BTEC HND – Electrical and Electronic Engineering
Assignment Title Explain the purpose of the constituent parts of a microcontroller and
evaluate microcontroller architectures
Unit 46 Embedded Systems

General Purpose Registers (GPR):


These registers provide no unique purpose. These are employed for general-purpose
multiplication, addition, or subtraction, with the results being stored in additional registers. The
data in these registers is readily accessible by the CPU.

Special Function Registers (SFR):


These registers have a specific function and are not appropriate for use as standard registers.
Their function is set at the time of manufacturing. They carry out the task that has been given to
them, and the user cannot alter the SFR's function. There are three crucial SFRs for
programming:

STATUS register: It changes the bank

PORT registers: It assigns logic values 0 or 1 to the ports

TRIS registers: It is a data direction register for input and output

CCP MODULE:

A CCP module works in the following three modes:

 Capture Mode: When a signal arrives in this mode, time is captured, or, to put it
another way, the Timer1's value is captured when the CCP pin goes high.
 Compare Mode: When the value of timer 1 exceeds a certain reference value, it
operates similarly to an analog comparator and produces an output signal.

Date 2022 Name LEONCE Job Olivier Benjamin / NC55123


Page 35 of 44
MITD - SITEC AUTOMATION TRAINING UNIT
PEARSON BTEC HND – Electrical and Electronic Engineering
Assignment Title Explain the purpose of the constituent parts of a microcontroller and
evaluate microcontroller architectures
Unit 46 Embedded Systems

 PWM Mode: This mode provides a 10-bit resolution pulse and duty cycle that is
programmable.

Peripherals:

The PIC18F4455 microcontroller consists of following peripherals:

1. I/O Ports: Five 8-bit input-output ports (PORTA, PORTB, PORTC, PORTD, and
PORTE) are available on the PIC18F4455. Each of PortB and PortD has 8 I/O pins.
Despite being 8-bit ports, the other three ports do not contain eight I/O pins. Although
these ports receive 8-bit input and output, the pins that don't exist are internally hidden.
There are up to five ports accessible, depending on which device is chosen and which
functions are turned on. The device's peripheral functionalities are multiplexed with a
different function on a few I/O port pins. In general, a pin cannot be utilized as a general-
purpose I/O pin when a peripheral is enabled. There are three registers for the operation
of each port. They are as follows:
 TRIS register (data direction register)
 PORT register (reads the levels on the pins of the device)
 LAT register (output latch)
The value driven by the I/O pins can be read, modified, and written to with the help of the
Data Latch register (LATA).

 Port A: This port is 7-bit wide and can be used for both input and output. The
status of TRISA register decided whether it is used as input or output port.
 Port B: It is an 8-bit port. This port also can be used as input and output.
Moreover, in input mode four of its bits are variable according to the interrupt
signals.
 Port C: It is also an 8-bit port and can be used as both input and output port
which is determined by the status of the TRISC register.

Date 2022 Name LEONCE Job Olivier Benjamin / NC55123


Page 35 of 44
MITD - SITEC AUTOMATION TRAINING UNIT
PEARSON BTEC HND – Electrical and Electronic Engineering
Assignment Title Explain the purpose of the constituent parts of a microcontroller and
evaluate microcontroller architectures
Unit 46 Embedded Systems

 Port D: This 8-bit port, unlike Port A, B and C is not an input/output port, but is
used as acts as a slave port for the connection to the microprocessor. When in I/O
mode Port D all pins should have Schmitt Trigger buffers.
 Port E: It is a 3-bit port which is used as the additional feature of the control
signals to the A/D converter.

2. Memory: PIC18F4455 consists of three different memory sections:

I. Flash Memory: The user-downloaded program on the microcontroller is kept in flash


memory. Being non-volatile, flash memory keeps the program even when the power
is turned off. Flash Memory is 32KB on the PIC18F4455. Throughout the whole
VDD range, the Flash program memory is readable, written, and erasable when in
normal operation. Each byte of program memory is read one at a time. Blocks of 32
bytes are written to program memory one at a time. Blocks of 64 bytes are deleted
from program memory at a time. User code is not permitted to issue a Bulk Erase
operation. Instruction fetches will stop while writing to or erasing program memory
until the process is finished. Code cannot run because the program memory cannot be
accessed during the write or erase operations. Program memory writes and erases are
stopped by an internal timer. It is not necessary for a value written to program
memory to be an authorized instruction. A NOP is produced when a program memory
location that generates an incorrect instruction is executed.

II. EEPROM: This nonvolatile memory is also utilized to store information, such as the
values of particular variables. The EEPROM on the PIC18F4455 is 256 Bytes. For
the purpose of long-term program data storage, the data EEPROM is a nonvolatile
memory array that is independent from the data RAM and program memory. It is
indirectly addressed through the Special Function Registers rather than being directly

Date 2022 Name LEONCE Job Olivier Benjamin / NC55123


Page 35 of 44
MITD - SITEC AUTOMATION TRAINING UNIT
PEARSON BTEC HND – Electrical and Electronic Engineering
Assignment Title Explain the purpose of the constituent parts of a microcontroller and
evaluate microcontroller architectures
Unit 46 Embedded Systems

mapped in either the register file or program memory space (SFRs). Throughout the
whole VDD range, the EEPROM is readable and writable in normal operation.
Both the program memory and the data EEPROM are read and written to using 4
SFRs. As follows:
 EECON1
 EECON2
 EEDATA
 EEADR

With the data EEPROM, you can read and write bytes. When interacting with the data memory
block, the EEADR register stores the address of the EEPROM location being accessed, and the
EEDATA register stores the 8-bit data for read/write operations.

High erase/write cycle endurance is rated for EEPROM data memory. When you write a byte,
the old data is automatically overwritten (erase-before-write). An on-chip timer regulates the
write time, which varies from chip to chip as well as with voltage and temperature.

Two registers, EECON1 and EECON2, regulate access to the data EEPROM. The program
memory access is controlled by the same registers, which are also applied to the data EEPROM
in a similar way.

The control register for data and program memory access is the EECON1 register (Register 7-1).
Either program or data EEPROM memory will be accessed depending on the value of the control
bit, EEPGD. Operations will use the data EEPROM memory when clear. Program memory is
accessed when set.

The control bit, CFGS, decides whether the access will be to the program memory or data
EEPROM memory or the configuration registers. The Configuration registers are accessed by
following operations when set. The EEPGD bit chooses between program Flash and data
EEPROM memory when CFGS is clear.

Date 2022 Name LEONCE Job Olivier Benjamin / NC55123


Page 35 of 44
MITD - SITEC AUTOMATION TRAINING UNIT
PEARSON BTEC HND – Electrical and Electronic Engineering
Assignment Title Explain the purpose of the constituent parts of a microcontroller and
evaluate microcontroller architectures
Unit 46 Embedded Systems

When set, the WREN bit will permit a write operation. The WREN bit is clear at startup. After
the WREN bit is set, the WRERR bit is also set in hardware. It is cleared when the write
operation is finished and the internal programming timer expires.

III. SRAM: Static Random Access Memory is the microcontroller's volatile memory,
meaning that as soon as the power is turned off, its contents are lost. The PIC18F4455
has 2 KB of inbuilt SRAM.

The data and program memories employ independent busses as Harvard architecture devices,
enabling concurrent access to both memory areas. Since the data EEPROM is addressed and
accessible through a collection of control registers, it might theoretically be thought of as a
peripheral device.

The 21-bit program counter on PIC18F4455 microcontrollers may access a 2-Mbyte program
memory region. All '0's will be returned when accessing a position between the upper limit of the
physically implemented memory and the 2-Mbyte address (a NOP instruction). With 24 Kbytes
of Flash memory, the PIC18F4455 can store up to 12,288 one-word instructions. There are two
interrupt vectors on the PIC18F4455 chip. The interrupt vector addresses are 0008h and 0018h,
and the reset vector address is 0000h.

3. Oscillator: The PIC18F4455 family offers numerous clock configurations. This series
can be used with an external clock up to 48 MHz. The internal oscillator in these
controllers offers eight adjustable frequency settings ranging from 31 KHz to 8 MHz.
In comparison to earlier PIC18F devices, those in the PIC18F4455 family use a new
oscillator and microcontroller clock scheme. The addition of the USB module
necessitates the provision of a separate clock source that complies with both USB low-
speed and full-speed criteria due to the USB module's particular needs for a steady clock
source.

Date 2022 Name LEONCE Job Olivier Benjamin / NC55123


Page 35 of 44
MITD - SITEC AUTOMATION TRAINING UNIT
PEARSON BTEC HND – Electrical and Electronic Engineering
Assignment Title Explain the purpose of the constituent parts of a microcontroller and
evaluate microcontroller architectures
Unit 46 Embedded Systems

PIC18F4455 devices include a new clock branch that provides a 48 MHz clock for full-
speed USB operation to satisfy these specifications. An additional set of prescalers and
postscalers has been added to support a wide range of oscillator frequencies because it is
powered by the main clock source. The internal oscillator block and clock switching are
other oscillator features still used in PIC18F4455 upgraded microcontrollers.

4. 8×8 Multiplier: The PIC18F4455 has hardware for an 8 x 8 multiplier. The


multiplications are carried out by this hardware in a single machine cycle. In addition to
increasing computational throughput, this also shortens operating cycles and codes.
As part of the ALU, PIC18F4455 devices have an 8 x 8 hardware multiplier. The product
register pair PRODH:PRODL stores the 16-bit result of the multiplier's unsigned
operation, which is performed. The STATUS register's flags are unaffected by the
multiplier's operation.
Multiplication can be finished in a single instruction cycle by making it a hardware
process. Due to the benefits of increased computational performance and less code size
for multiplication algorithms, the PIC18F4455 chip can now be employed in a wide range
of tasks that were previously only performed by digital signal processors.

5. ADC Interface: The PIC18F4455 has 13 channels of 10-bit resolution ADC (Analog to
Digital Converter). ADC reads analog inputs, such as sensor inputs, and turns them into
digital values that the microcontroller can understand.

6. Timers/Counters: Four timer/counters are present on PIC18F4455. There is just one 8-


bit timer, while the other timers allow you to choose between 8- and 16-bit mode. Timers
are useful for producing exact activities, such as setting precise intervals between two
operations.

The Timer module incorporates the following features:


 Software selectable operation as a timer or counter in both 8-bit or 16-bit modes
 Readable and writable registers
Date 2022 Name LEONCE Job Olivier Benjamin / NC55123
Page 35 of 44
MITD - SITEC AUTOMATION TRAINING UNIT
PEARSON BTEC HND – Electrical and Electronic Engineering
Assignment Title Explain the purpose of the constituent parts of a microcontroller and
evaluate microcontroller architectures
Unit 46 Embedded Systems

 Dedicated 8-bit, software programmable prescaler


 Selectable clock source (internal or external)
 Edge select for external clock
 Interrupt on overflow

Clearing the T0CS bit (T0CON5>) allows the timer to switch between operating as a timer
and a counter. In Timer mode, unless a different prescaler value is chosen, the module
increments by default every clock. The increment is disabled for the next two instruction
cycles if the TMR0 register is written to. By writing a modified value to the TMR0 register,
the user can get around this. The Counter mode is chosen by setting the T0CS bit to 1 (= 1).
Timer increments in Counter mode on each rising or falling edge of Pin RA4/T0CKI. The
Timer Source Edge Select bit, T0SE (T0CON4>), picks the rising edge while being cleared
selects the incrementing edge.
Timer can be driven by an external clock source, but it must adhere to certain specifications
in order for the external clock to be synced with the internal phase clock (TOSC). Between
synchronization and the start of the timer/counter incrementing, there is a delay.

7. Interrupts: There are three external interrupt sources on the PIC18F4455. There are 20
internal interrupts, each of which is connected to a separate peripheral—for example, an
ADC, USART, or set of timers.

The interrupt priority feature of the PIC18F4455 device enables each interrupt source to be
assigned either a high priority level or a low priority level. Both the high priority and low
priority interrupt vectors are located at 000008h. Any low priority interruptions that might be
active will be interrupted by high priority interrupt events.

Ten registers are utilized to regulate interrupt activity. They are as follows:

RCON, INTCON, INTCON2, INTCON3, PIR1, PIR2, PIE1, PIE2, IPR1, IPR2.

Date 2022 Name LEONCE Job Olivier Benjamin / NC55123


Page 35 of 44
MITD - SITEC AUTOMATION TRAINING UNIT
PEARSON BTEC HND – Electrical and Electronic Engineering
Assignment Title Explain the purpose of the constituent parts of a microcontroller and
evaluate microcontroller architectures
Unit 46 Embedded Systems

Three bits are used to regulate the operation of each interrupt source. These bits have the
following purposes:

 Flag bit to indicate that an interrupt event occurred


 Enable bit that allows program execution to branch to the interrupt vector address when
the flag bit is set
 Priority bit to select high priority or low priority

8. EUSART: The enhanced USART module is a full-duplex asynchronous system


(Universal Synchronous and Asynchronous Serial Receiver and Transmitter). It can also
be set up as a synchronous half-duplex system. The automatic baud rate detection and
calibration, automatic wake-up on Sync Break receiving, and 12-bit Break character
transmission are all features of the Enhanced USART. It is perfectly suited for use in
Local Interconnect Network bus (LIN bus) systems thanks to these qualities.

9. ICSP and ICD: The PIC18F4455 series controllers provide an in-circuit serial
programming feature that allows you to program Flash Memory without taking the IC out
of the circuit. The controller may be hardware debugged while it is in the application
circuit thanks to ICD (In Circuit Debugger).

10. SPI: A shared clock source enables 3-wire SPI communication between two devices with
the PIC18F4455. SPI has a higher data rate than USART.

11. I2C: Communication between two devices via the Two Wire Interface (TWI) or I 2C is
supported by the PIC18F4455. It has dual master and slave functionality.

12. USB: Full-speed USB is supported by PIC18F4455 with a variety of clock


configurations. The PIC18F4455 device family has a USB Serial Inter-face Engine (SIE)
Date 2022 Name LEONCE Job Olivier Benjamin / NC55123
Page 35 of 44
MITD - SITEC AUTOMATION TRAINING UNIT
PEARSON BTEC HND – Electrical and Electronic Engineering
Assignment Title Explain the purpose of the constituent parts of a microcontroller and
evaluate microcontroller architectures
Unit 46 Embedded Systems

that is full-speed and low-speed compatible and enables quick communication between
any USB host and the PIC® microcontroller. The inbuilt transceiver of the SIE can be
used to interface it directly to the USB, or an external transceiver can be used to connect
it. The internal transceiver in 5V applications can also be powered by an internal 3.3V
regulator.

To boost performance, some unique hardware characteristics have been added. To share
direct memory access between the microcontroller core and the SIE, dual port memory in
the device's data memory space (USB RAM) has been provided. Additionally, buffer
descriptors are offered, enabling users to flexibly plan how much end-point memory will
be used in the USB RAM area. To facilitate the uninterrupted transfer of huge amounts of
data, such as isochronous data, to external memory buffers, a Streaming Parallel Port has
been created.

ELECTRICAL CHARACTERISTICS

Absolute Maximum Ratings (†) Ambient temperature under bias............................-40°C to


+85°C Storage temperature....................................................................................... -65°C to
+150°C Voltage on any pin with respect to VSS (except VDD, MCLR and RA4)............0.3V to (VDD
+ 0.3V) Voltage on VDD with respect to VSS.........................................................................0.3V to
+7.5V Voltage on MCLR with respect to VSS (Note 2)................................................... 0V to
+13.25V Total power dissipation (Note 1)
......................................................................................1.0W Maximum current out of VSS pin
........................................................................................300 mA Maximum current into VDD pin
...........................................................................................250 mA Input clamp current, IIK (VI < 0
or VI > VDD).......................................................................±20 mA Output clamp current, IOK (VO
< 0 or VO > VDD)...............................................................±20 mA Maximum output current sunk
by any I/O pin.......................................................................25 mA Maximum output current
sourced by any I/O pin .................................................................25 mA Maximum current sunk

Date 2022 Name LEONCE Job Olivier Benjamin / NC55123


Page 35 of 44
MITD - SITEC AUTOMATION TRAINING UNIT
PEARSON BTEC HND – Electrical and Electronic Engineering
Assignment Title Explain the purpose of the constituent parts of a microcontroller and
evaluate microcontroller architectures
Unit 46 Embedded Systems

by all ports................................................................................200 mA Maximum current sourced


by all ports................................................................................200 mA

Note : Power dissipation is calculated as follows: Pdis = VDD x {IDD – ∑ IOH} + ∑ {(VDD – VOH)
x IOH} + ∑(VOL x IOL) 2: Voltage spikes below VSS at the MCLR/VPP/RE3 pin, inducing currents
greater than 80 mA, may cause latch-up. Thus, a series resistor of 50-100Ω should be used
when applying a “low” level to the MCLR/VPP/ RE3 pin, rather than pulling this pin directly to
VSS

REFERENCES

 Pic Introduction to Pic Microcontroller | Pic (electronicwings.com)

 https://www.watelectronics.com/pic-microcontroller-architecture-and-applications/

 https://ww1.microchip.com/downloads/en/devicedoc/39632c.pdf

 https://www.techtarget.com/iotagenda/definition/microcontroller

 https://www.alldatasheet.com/view.jsp?Searchword=Pic18f4455&gclid=EAIaIQobChMIvNaZ1M
eT-gIVCuJ3Ch2eYAIjEAMYASAAEgIPPvD_BwE

Date 2022 Name LEONCE Job Olivier Benjamin / NC55123


Page 35 of 44

You might also like