Professional Documents
Culture Documents
Module 1 (Part 1)
Module 1 (Part 1)
Dr. Suchitra M
Professor
Dept. of ECE, VVCE, Mysuru
1 07/10/2021
Syllabus
Module 1
Module 2
2 07/10/2021
Contd..
Module 3
Module 4
3 07/10/2021
Contd..
Module 5
RTOS and IDE for Embedded System Design: Operating System basics, Types of
operating systems, Task, process and threads (Only POSIX Threads with an example
program), Thread preemption, Preemptive Task scheduling techniques, Task
Communication, Task synchronization issues — Racing and Deadlock, Concept of Binary
and counting semaphores (Mutex example without any program), How to choose an RTOS,
Integration and testing of Embedded hardware and firmware, Embedded system
Development Environment — Block diagram (excluding Kei1), Disassembler/decompiler,
simulator, emulator and debugging techniques (Text 2: Ch-10 (Sections 10.1, 10.2, 10.3,
10.5.2, 10.7,
10.8.1.1, 10.8.1.2, 10.8.2.2, 10.10 only), Ch-12, Ch-13 (a block diagram before
13.1, 13.3, 13.4, 13.5, 13.6 only
4 07/10/2021
Course Outcomes
5 07/10/2021
Text Books
6 07/10/2021
7 07/10/2021
Reference Books
8 07/10/2021
Contd.
1 Quiz
2 Assignment
3 Group activity
4 Module Test
5 Flipped classroom
9 07/10/2021
Module 1
ARM 32 bit Microcontroller
10 07/10/2021
Introduction
12 07/10/2021
Contd.
13 07/10/2021
Advantages
14 07/10/2021
Levels of Integration
15 07/10/2021
Microprocessor
Is a central processing unit fabricated on a single chip
16 07/10/2021
Microcontroller
It is basically a computer on a
single chip.
Very inexpensive, small, low
power.
It operates on data that are
fed through its serial or parallel
input ports, controlled by the
software stored in on-chip
memory.
Often has analog input pins,
timers and other utility
circuitry built-in.
17 07/10/2021
Contd.
18 07/10/2021
Typical examples
Washing machine,
refrigerator, camera,
vehicles, airplane,
missile, printer
19 07/10/2021
How microcontrollers are different from PCs
When a PC executes a program, the program is first
loaded from disk into an allocated section of memory.
Operating system handles all low-level operations
In a microcontroller there is no disk to read from.
On-chip ROM stores the program that is to be executed.
Size of the ROM limits the maximum size of the
application.
There is no operating system, and the program in ROM
is the only program that is running (must include low-
level routines).
20 07/10/2021
Advantages of using microcontrollers
21 07/10/2021
Evolution of microcontrollers
22 07/10/2021
Contd.
The requirement for higher performance
microcontrollers has been driven globally by the
industry’s changing needs.
Depending on power and features needed
4 bit
8 bit
16 bit
32 bit microcontrollers
23 07/10/2021
History
ARM was developed at ACRON computer limited of
Cambridge, England between 1983 and 1985
24 07/10/2021
Various enhancement made to suit the embedded
applications
Version 1:
26-bit address bus
No multiply or coprocessor
Version 2:
26-Bit address bus
Co-processor support
Version 3:
32-Bit addressing
Faster than ARM version1 and version2
25 07/10/2021
Various enhancement made to suit the embedded
applications
Version 4:
Signed operation support
Thumb instruction set
Version5:
DSP instructions added
Version 6:
Memory architecture improved
Thumb2 instruction set
26 07/10/2021
Contd .
Version 7:
Thumb2 instruction set
Architecture profiles
ARMv7-A : Application profile
ex: cortex A8
ARMv7-R : Real time profile
ex: cortex R4
ARMv7-M : Microcontroller profile
ex: cortex M3
27 07/10/2021
Contd.
28 07/10/2021
The Cortex-M3 Processor versus Cortex-M3-
Based MCUs
29 07/10/2021
Contd .
The Cortex-M3 processor is the central processing unit
(CPU) of a microcontroller chip.
In addition, a number of other components are required
for the whole Cortex-M3 processor-based
microcontroller.
After chip manufacturers license the Cortex-M3
processor, they can put the Cortex-M3 processor in their
silicon designs, adding memory, peripherals,
input/output (I/O), and other features.
Cortex-M3 processor-based chips from different
manufacturers will have different memory sizes, types,
peripherals, and features.
30 07/10/2021
Contd.
31 07/10/2021
Contd.
In 1991, ARM introduced the ARM6 processor family,
and VLSI became the initial licensee.
Subsequently, additional companies, including Texas
Instruments , NEC, Sharp, and ST Microelectronics,
licensed the ARM processor designs.
Extending the applications of ARM processors into
mobile phones, computer hard disks, personal digital
assistants (PDAs), home entertainment systems, and
many other consumer products.
32 07/10/2021
33 07/10/2021
34 07/10/2021
Basic Terminologies
Digital computer architectures
35 07/10/2021
Contd.
36 07/10/2021
Contd.
37 07/10/2021
Sl Von Neumann Harvard
No. architecture architecture
1 Requires single bus for Requires separate & dedicated
instructions and data buses for memories for
instructions and data.
2 Its design is simpler Its design is complicated
3 The Von Neuman The Harvard architecture uses
architecture uses single physically separate memories for
memory for their their instructions and data
instructions and data
39 07/10/2021
Cortex M3
40 07/10/2021
Contd.
41 07/10/2021
Features
42 07/10/2021
Contd.
43 07/10/2021
Registers
Registers are the fastest data storage of computing
systems
44 07/10/2021
Contd.
45 07/10/2021
Contd.
R0–R12 are 32-bit general-purpose registers for data
operations.
46 07/10/2021
R15:
The Program Counter : Holds the memory address of
next instruction that the processor fetches from the
instruction memory.
47 07/10/2021
Memory address
48 07/10/2021
Memory
MEMORY 8 bit
ADDRESS
0x FFFFFFFF
0x 00000008
0x 00000007
0x 00000006
0x 00000005
0x 00000004
0x 00000003
0x 00000002
0x 00000001
49 0x 00000000 07/10/2021
R14: The Link Register
When a subroutine is called, the return address
is stored in the link register.
50 07/10/2021
Contd.
51 07/10/2021
Stacks
52 07/10/2021
LIFO (Last In First Out)
53 07/10/2021
54 07/10/2021
Stack Operations
PUSH {R1}
POP {R1}
R1= 4567abcd
SP
SP+4 10
10
0F 45 0F 45
0E 67 0E
67
SP-4 0D ab 0D ab
SP
0C cd 0C cd
0B 0B
0A 0A
09 09
R1= 4567abcd
55 07/10/2021
56 07/10/2021
PUSH and POP of individual registers
Branch with BX LR
57 07/10/2021
PUSH and POP of group of registers
Branch with BX LR
58 07/10/2021
59 07/10/2021
Branch without BX LR
60 07/10/2021
Special registers
61 07/10/2021
Program status register
62 07/10/2021
Condition Codes
63 07/10/2021
64
07/10/2021
Contd.
65
07/10/2021
Consider two numbers 0xFFFF FFFE and 0×0000 0002.
A 32-bit mathematical addition would result in 0×1 0000
0001 which contain 9 hex digits or 33 binary bits.
Also a new flag field called ‘Q’ has been added to the ARM
processor to show us if there had been any such saturation
taken place.
66 07/10/2021
Contd.
67 07/10/2021
Contd.
Control register
Define privileged status and stack pointer selection
68 07/10/2021
Special registers for interrupt masking
purpose
Contd.
70 07/10/2021
71 07/10/2021
Contd.
MOV R0, #1
MSR PRIMASK, R0 ; Write 1 to PRIMASK to disable all
interrupts and
MOV R0, #0
MSR PRIMASK, R0 ; Write 0 to PRIMASK to allow interrupts
72 07/10/2021
Contd.
To disable interrupts only with priority lower than a certain level.
the value is written to BASEPRI:
74 07/10/2021
Contd.
76 07/10/2021
Contd.
77 07/10/2021
Contd.
78 07/10/2021
Multiple interrupts
Contd.
Contd.
The interrupt controller in Cortex M3 processor is called the
Nested Vectored Interrupt Controller (NVIC)
It is built in to cortex core to manage all interrupts
Features
82 07/10/2021
Servicing multiple interrupts
Vector Table
84 07/10/2021
Contd.
85 07/10/2021
Automated nested interrupt handling
Contd.
87 07/10/2021
Interrupt Latency
88 07/10/2021
Interrupt Latency
89 07/10/2021
Contd.
When an exception takes place but the processor is
handling another exception of the same or higher
priority, the exception will enter pending state.
Instead of restoring the registers back from the stack
(unstacking) and then pushing them onto the stack
again (stacking),
the processor skips the unstacking and stacking steps
and enters the exception handler of the pended
exception as soon as possible.
In this way, the timing gap between the two exception
handlers is considerably reduced
90 07/10/2021
Contd.
91 07/10/2021
Contd.
92 07/10/2021
Exception No. 1
Reset
Fixed priority level of -3
Indicates higher priority
Power on or system Reset
Asserted when the device is powered up; resets
processor core, peripherals, and debugging system
93 07/10/2021
Exception No. 2
Nonmaskable interrupt (NMI)
• Bus faults
• Memory management faults
• Usage faults
• Hard fault
95 07/10/2021
Contd.
96 07/10/2021
Contd.
Bus fault
Exception No. 5
Attempts to access an invalid memory region (for example, a
memory location with no memory attached) •
The device is not ready to accept a transfer (for example,
trying to access SDRAM without initializing the SDRAM
controller)
Attempts to carry out a transfer with a transfer size not
supported by the target device (for example, doing a byte
access to a peripheral register that must be accessed as a
word)
97 07/10/2021
Usage Faults
Exception No. 6
Undefined instructions
Invalid interrupt return
(link register contains invalid/incorrect values)
Divide by zero
Hard Faults
Exception No. 3
All classes of fault, when the corresponding fault handler
cannot be activated because it is currently disabled or masked
by exception masking
98 07/10/2021
Contd.
99 07/10/2021
Supervisor call
Exception No. 11
100 07/10/2021
System tick timer
Exception No. 15
24 bit down counter
Counts down from an initialize
value
101 07/10/2021
Contd.
102 07/10/2021
HAPPY
LEARNING
103 07/10/2021