Professional Documents
Culture Documents
SYSTEMS
Application Oriented
Connected Peripherals
Application areas
Automotive electronics
Aircraft electronics
Trains
Telecommunication
Application areas
Medical
Medicalsystems
systems
Military
Militaryapplications
applications
Authentication
Authentication
4
Application areas
Consumer
Consumerelectronics
electronics
Fabrication
Fabricationequipment
equipment
Smart
Smartbuildings
buildings
Cost
Speed
Utilization
Power Utilization
Need of the system/Application
What is a Microprocessor ?
Connectivity to peripherals
Sensor
AD
Processor &
ASICs
Memory
DA
Actuator
General Characteristics of
Embedded Systems
HW-SW systems
Software is used for more features and flexibility
Hardware (processors, ASICs, memory etc. are used for
performance and security
General Characteristics of
Embedded Systems (contd.)
Analog IO
ASIC s
Mem
Processor
Cores
Digital
HARVARD ARCHITECTURE
Harvard Architecture refers to a
memory structure
where the processor is connected to
two different
memory banks via two sets of buses
This is to provide the processor with
two distinct data paths, one for
instruction and one for data
Through this scheme, the CPU can read
both an
instruction and data from the
respective memory
banks at the same time
This inherent independence increases
VON-NEUMANN ARCHITECTURE
A Von-Neumann Machine, in contrast to the
Harvard
Architecture provides one data path (bus) for
both
instruction and data
As a result, the CPU can either be fetching an
instruction from memory, or read/writing data
to it
Other than less complexity of hardware, it
allows for
using a single, sequential memory.
Todays processing speeds vastly outpace
memory
access times, and we employ a very fast but
small
amount of memory (cache) local to the
1
2
3
4
5
6
7
8
9
1
1
0
1
1
2
1
3
1
4
1
5
1
6
1
7
1
8
2
9
0
8051
(8031
)
4
3
0
3
9
3
8
3
7
3
6
3
5
3
4
3
31
2
3
2
0
2
9
2
8
2
7
2
6
2
5
2
4
2
3
2
1
Vcc
P0.0(AD
P0.1(AD1)
0)
P0.2(AD
P0.3(AD3
2)
)P0.4(AD4
)P0.5(AD5)
P0.6(AD6)
P0.7(AD7
)EA/VPP
ALE/PROG
PSEN
P2.7(A15)
P2.6(A1
P2.5(A1
4)
P2.4(A1
3)
P2.3(A1
2)
P2.2(A10
1)
)P2.1(A9)
P2.0(A8)
Vcc pin 40
Vcc provides supply voltage to the chip.
The voltage source is +5V.
GND pin 20 ground
XTAL1 and XTAL2 pins 19,18
Other Pins
P1, P2, and P3 have internal pull-up resisters.
P1, P2, and P3 are not open drain.
P0 has no internal pull-up resistors and does not
connects to Vcc inside the 8051.
P0 is open drain.
Compare the figures of P1.X and P0.X.
However, for a programmer, it is the same to program
P0, P1, P2 and P3.
All the ports upon RESET are configured as output.
Port 0
P0.0
DS5000 P0.1
P0.2
8751
P0.3
P0.4
8951
P0.5
P0.6
P0.7
10 K
Function
Pin
P3.0
P3.1
P3.2
P3.3
P3.4
P3.5
P3.6
P3.7
RxD
TxD
INT0
INT1
T0
T1
WR
RD
10
11
12
13
14
15
16
17
Register
s
SP
A
B
R0
DPTR
DPH
DPL
R1
R2
PC
PC
R3
R4
R5
R6
R7
Some 8-bitt Registers of
the 8051
8k
0000H
0FFFH
8751
AT89C51
1FFFH
8752
AT89C52
30H
2FH
Bit-Addressable RAM
20H
1FH
18H
17H
10H
0FH
08H
07H
00H
Register Bank 3
Register Bank 2
Register Bank 1( Stack)
Register Bank 0
7FH
Scratch pad RAM
30H
2FH
Bit-Addressable RAM
20H
1FH
18H
17H
10H
0FH
08H
07H
00H
Register Bank 3
Register Bank 2
Register Bank 1) Stack(
Register Bank 0
Program Counter
The Program Counter is a 16 or 32 bit
register which contains the address of
the next instruction to be executed
The PC automatically increments to the
next sequential memory location every
time an instruction is fetched
Branch, jump, and interrupt operations
load the Program Counter with an
address other than the next sequential
location
During reset, the PC is loaded from a
pre-defined memory location to signify
the starting address of the code
RestVector
The significance of the reset vector is that it
points the processor to the memory address
which contains the firmwares first instruction
Without the Reset Vector, the processor would
not know where to begin execution
Upon reset, the processor loads the Program
Counter (PC) with the reset vector value from a
pre-defined memory location
On CPU08 architecture, this is at location
$FFFE:$FFFF
A common mistake which occurs during the
debug phase when reset vector is not
necessary the developer takes it for granted
and doesnt program into the final image. As a
result, the processor doesnt start up on the
final product.
Stack Pointer
The Stack Pointer (SP), much like the reset
vector, is required at boot time for many
processors
Some processors, in particular the 8-bit
microcontrollers automatically provide the
stack pointer by resetting it to a predefined
value
On a higher end processor, the stack pointer is
usually read from a non-volatile memory
location, much like the reset vector
For example on a ColdFire microprocessor, the
first sixteen bytes of memory location must be
programmed as follows:
0x00000000: Reset Vector
0x00000008: Stack Pointer
Infinite Loop
Embedded Systems, unlike a PC, never exit
an application
They idle through an Infinite Loop waiting for
an event to happen in the form of an
interrupt, or a pre-scheduled task
In order to save power, some processors
enter special sleep or wait modes instead of
idling through an Infinite Loop, but they will
come out of this mode upon either a timer or
an External Interrupt
Interrupts
Interrupts are mostly hardware mechanisms
which tell the program an event has occurred
They happen at any time, and are therefore
asynchronous to program flow
They require special handling by the
processor, and are ultimately handled by a
corresponding Interrupt Service Routine (ISR)
Need to be handled quickly. Take too much
time servicing an interrupt, and you may miss
another interrupt.
Compilation of C file
Preprocessed
Source
Source
Compiler
Preprocessor
In Memory
Assembler
.s
O
B
Executable
Program
ASM
Executable
Loader
J
Linker
a.out
.o
E
C
T
Breaking Down CC
Preprocessed
Source
source
Compiler
Preprocessor
ASM
Assembler
.s
O
B
Executable
Program
In Memory
Executable
Loader
J
Linker
a.out
.o
E
C
T
C Preprocessor (.cpp)
Define macros
#define NUM 100
#define xx(v,name,op,metrics) \
>metrics)
v=xxinit(op,name,IR-
Breaking Down CC
Preprocessed
Source
source
Compiler
Preprocessor
In Memory
Assembler
.s
O
B
Executable
Program
ASM
Executable
Loader
J
Linker
a.out
.o
E
C
T
Compiler
Compiler consists of
Parser
Code generation
Mysticism
Breaking Down CC
Preprocessed
Source
Source
Compiler
Preprocessor
In Memory
Assembler
.s
O
B
Executable
Program
ASM
Executable
Loader
J
Linker
a.out
.o
E
C
T
Assembler
Breaking Down CC
Preprocessed
Source
Source
Compiler
Preprocessor
In Memory
Assembler
.s
O
B
Executable
Program
ASM
Executable
Loader
J
Linker
a.out
.o
E
C
T
Linker
Breaking Down CC
Preprocessed
Source
Source
Compiler
Preprocessor
In Memory
Assembler
.s
O
B
Executable
Program
ASM
Executable
Loader
J
Linker
a.out
.o
E
C
T
Loader
Editor
Assembler
What is an assembler?
Types of assembler Single Pass & two Pass Assembler
Working on Assemblers procedure
STEP No1: Go to Command line
Open an Editor
>>edit
*/
OR
Integrated Development
Environment (IDE):
All software tools discussed earlier, are kept under one common
unified user interface, i.e. IDE
Debugging tools
Simulators
A simulator can also not talk to your target system, so functions that
rely on external components are difficult to verify
For that reason simulators are best suited to test algorithms that run
completely within the microcontroller
It consists of:
- Hardware board(Evaluation board).
- In system programmer.
- Some software tools like compiler,assembler, linker etc
- sometimes an IDE and code size limited evaluation version of a
compiler
Emulators