FINAL Embedded Systems Ass#ONE Final
FINAL Embedded Systems Ass#ONE Final
When submitting evidence for assessment, each student must sign a declaration confirming that the work is their
own.
ID: NC55123
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.
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
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).
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.
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:
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.
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.
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
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.
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 sort of community and resources are available for the microcontroller?
Architectures
Figure 1
Fixed Program Computers: Their function is very specific and they couldn’t
be programmed, e.g. Calculators.
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)
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.
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.
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
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.
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.
Table 1
Figure 5
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
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
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.
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.
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:
Interrupts:
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.
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.
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,
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.
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.
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
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).
Integration of all the essential components reduces the cost, design time and area of the product
(or application).
Disadvantages of Microcontrollers:
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:
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.
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.
• 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.
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.
• 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).
• 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
• 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.
• 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.
• 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.
Device Features
Table 2
Features PIC18F4455
Interrupt Sources 20
Timers 4
Capture/Compare/PWM Modules 1
Enhanced Capture/ 1
Compare/PWM Modules
Comparators 2
Figure 7
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.
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.
PIC18F4455 Architecture
Figure 9
CCP MODULE:
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.
PWM Mode: This mode provides a 10-bit resolution pulse and duty cycle that is
programmable.
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.
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.
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
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.
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.
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.
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.
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.
Three bits are used to regulate the operation of each interrupt source. These bits have the
following purposes:
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.
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
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
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