02-01-2013, 10:01 AM
Introduction to Embedded System Design
1Introduction to Embedded.pdf (Size: 204.44 KB / Downloads: 87)
Microcontrollers
A Microcontroller is essentially a small and selfsufficient
computer on a chip, used to control devices
It has all the memory and I/O it needs on board
Is not expandable – no external bus interface
Characteristics of a Microcontroller
• Low cost, on the order of $1
• Low speed, on the order of 10 KHz – 20 MHz
• Low Power, extremely low power in sleep mode
• Small architecture, usually an 8-bit architecture
• Small memory size, but usually enough for the type of
application it is intended for. Onboard Flash.
• Limited I/O, but again, enough for the type of application
intended for
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 the throughput
of the machine by enabling it to always prefetch the
next instruction
The cost of such a system is complexity in hardware
Commonly used in DSPs
Von-Neumann Machine
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.
Today’s processing speeds vastly outpace memory
access times, and we employ a very fast but small
amount of memory (cache) local to the processor
Modern processors employ a Harvard Architecture to
read from two instruction and data caches, when at the
same time using a Von-Neumann Architecture to access
external memory
Little vs. Big Endian
Although numbers are always displayed in the same
way, they are not stored in the same way in memory
Big-Endian machines store the most significant byte of
data in the lowest memory address
Little-Endian machines on the other hand, store the
least significant byte of data in the lowest memory
address
The Intel family of Microprocessors and processors
from Digital Equipment Corporation use Little-Endian
mode
Whereas Architectures from Sun, IBM, and Motorola
are Big-Endian
Architectures such as PowerPC, MIPS, and Intel’s IA-
64 are Bi-Endian, supporting either mode
Unfortunately both methods are in prevalent use
today, and neither method is superior to the other
Interfacing between Big and Little Endian machines
can be a headache, but this is generally only a concern
for TCP/IP stack and other interface developers
Program Counter (PC)
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
Reset Vector
The significance of the reset vector is that it points the
processor to the memory address which contains the
firmware’s 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:$FF
A common mistake which occurs during the debug
phase – when reset vector is not necessary – the
developer takes it for granted and doesn’t program
into the final image. As a result, the processor doesn’t
start up on the final product.