Embedded Systems Embedded Processors-1
Embedded Systems Embedded Processors-1
2 Lesson
Embedded Processors and
10
Memory Embedded Processors - I
Version 2 EE IIT, Kharagpur 1 Version 2 EE IIT, Kharagpur 2
In this lesson the student will learn the following
Performance
Digital Electronics Embedded control 32-bit
embedded
10.1 Introduction controllers/processor
It is generally difficult to draw a clear-cut boundary between the class of microcontrollers and
8- or 16-bit
general purpose microprocessors. Distinctions can be made or assumed on the following controller
grounds.
x Microcontrollers are generally associated with the embedded applications
x Microprocessors are associated with the desktop computers 4-bit
controller
x Microcontrollers will have simpler memory hierarchy i.e. the RAM and ROM may exist
on the same chip and generally the cache memory will be absent.
Cost
x The power consumption and temperature rise of microcontroller is restricted because of
the constraints on the physical dimensions. Fig. 10.1 The Performance vs Cost regions
x 8-bit and 16-bit microcontrollers are very popular with a simpler design as compared to
large bit-length (32-bit, 64-bit) complex general purpose processors.
However, recently, the market for 32-bit embedded processors has been growing.
Further the issues such as power consumption, cost, and integrated peripherals differentiate a
desktop CPU from an embedded processor. Other important features include the interrupt
response time, the amount of on-chip RAM or ROM, and the number of parallel ports. The
desktop world values processing power, whereas an embedded microprocessor must do the job
for a particular application at the lowest possible cost.
A/D
Input Input Parallel I/O
Analog Clock and PTS
and and
I/O Power Mgmt.
output output Timer
D/A
ports ports
PWM
RAM
Fig. 10.3 The Architectural Block diagram of Intel 8XC196 Microcontroller
Fig. 10.1 shows the performance cost plot of the available microprocessors. Naturally the more is
the performance the more is the cost. The embedded controllers occupy the lower left hand
corner of the plot.
Fig.10.2 shows the architectural difference between two systems with a general purpose
microprocessor and a microcontroller. The hardware requirement in the former system is more
than that of later. Separate chips or circuits for serial interface, parallel interface, memory and
AD-DA converters are necessary On the other hand the functionality, flexibility and the
complexity of information handling is more in case of the former.
Version 2 EE IIT, Kharagpur 5 Version 2 EE IIT, Kharagpur 6
Register Arithmetic-logic Unit (RALU)
CPU Memory Controller
The RALU contains the microcode engine, the 16-bit arithmetic logic unit (ALU), the master
Register File RALU program counter (PC), the processor status word (PSW), and several registers. The registers in
Prefetch Queue
the RALU are the instruction register, a constants register, a bit-select register, a loop counter,
Microcode and three temporary registers (the upper-word, lower-word, and second-operand registers). The
Engine Slave PC PSW contains one bit (PSW.1) that globally enables or disables servicing of all maskable
interrupts, one bit (PSW.2) that enables or disables the peripheral transaction server (PTS), and
Register ALU Address Register six Boolean flags that reflect the state of your program. All registers, except the 3-bit bit-select
RAM register and the 6-bit loop counter, are either 16 or 17 bits (16 bits plus a sign extension). Some
of these registers can reduce the ALU’s workload by performing simple operations.
Master PC Data Register
The RALU uses the upper- and lower-word registers together for the 32-bit instructions and as
temporary registers for many instructions. These registers have their own shift logic and are used
PSW for operations that require logical shifts, including normalize, multiply, and divide operations.
The six-bit loop counter counts repetitive shifts. The second-operand register stores the second
CPU SFRs
Registers Bus Controller operand for two-operand instructions, including the multiplier during multiply operations and the
divisor during divide operations. During subtraction operations, the output of this register is
complemented before it is moved into the ALU. The RALU speeds up calculations by storing
constants (e.g., 0, 1, and 2) in the constants register so that they are readily available when
Fig. 10.4 The Architectural Block diagram of the core complementing, incrementing, or decrementing bytes or words. In addition, the constants register
generates single-bit masks, based on the bit-select register, for bit-test instructions.
CPU: Central Processing Unit; RALU: Register Arithmetic Logic Unit; ALU: Arithmetic Logic
Unit;
Code Execution
Master PC: Master Program Counter; PSW: Processor Status Word; SFR: Special Function
Registers The RALU performs most calculations for the microcontroller, but it does not use an
accumulator. Instead it operates directly on the lower register file, which essentially provides
256 accumulators. Because data does not flow through a single accumulator, the
CPU Control microcontroller’s code executes faster and more efficiently.
The CPU is controlled by the microcode engine, which instructs the RALU to perform
operations using bytes, words, or double-words from either the 256-byte lower register file or Instruction Format
through a window that directly accesses the upper register file. Windowing is a technique that
maps blocks of the upper register file into a window in the lower register file. CPU instructions These microcontrollers combine general-purpose registers with a three-operand instruction
move from the 4-byte prefetch queue in the memory controller into the RALU’s instruction format. This format allows a single instruction to specify two source registers and a separate
register. The microcode engine decodes the instructions and then generates the sequence of destination register. For example, the following instruction multiplies two 16-bit variables and
events that cause desired functions to occur. stores the 32-bit result in a third variable.
Register File
The register file is divided into an upper and a lower file. In the lower register file, the lowest 24 Memory Interface Unit
bytes are allocated to the CPU’s special-function registers (SFRs) and the stack pointer, while
the remainder is available as general-purpose register RAM. The upper register file contains only The RALU communicates with all memory, except the register file and peripheral SFRs, through
general-purpose register RAM. The register RAM can be accessed as bytes, words, or double the memory controller. The memory controller contains the prefetch queue, the slave program
words. The RALU accesses the upper and lower register files differently. The lower register file counter (slave PC), address and data registers, and the bus controller. The bus controller drives
is always directly accessible with direct addressing. The upper register file is accessible with the memory bus, which consists of an internal memory bus and the external address/data bus.
direct addressing only when windowing is enabled. The bus controller receives memory-access requests from either the RALU or the prefetch
queue; queue requests always have priority.
FXTAL 1 The rising edges of PH1 and PH2 generate the internal CLKOUT signal (Fig. 10.6). The
XTAL 1 Divide-by-two
Circuit clock circuitry routes separate internal clock signals to the CPU and the peripherals to provide
flexibility in power management. Because of the complex logic in the clock circuitry, the signal
Disable Clocks on the CLKOUT pin is a delayed version of the internal CLKOUT signal. This delay varies with
(Powerdown)
temperature and voltage.
XTAL 2 Peripheral Clocks (PH1, PH2)
Clock
Disable Generators CLKOUT I/O Ports
Oscillator CPU Clocks (PH1, PH2)
(Powerdown) Individual I/O port pins are multiplexed to serve as standard I/O or to carry special function
Disable Clocks signals associated with an on-chip peripheral or an off-chip component. If a particular special-
(Idle, Powerdown) function signal is not used in an application, the associated pin can be individually configured to
serve as a standard I/O pin. Ports 3 and 4 are exceptions; they are controlled at the port level.
Fig. 10.5 The clock circuitry When the bus controller needs to use the address/data bus, it takes control of the ports. When the
address/data bus is idle, you can use the ports for I/O. Port 0 is an input-only port that is also the
Internal Timing analog input for the A/D converter. For more details the reader is requested to see the data
manual at
The clock circuitry (Fig. 10.5) receives an input clock signal on XTAL1 provided by an www.intel.com/design/mcs96/manuals/27218103.pdf.
external crystal or oscillator and divides the frequency by two. The clock generators accept the
divided input frequency from the divide-by-two circuit and produce two non-overlapping Serial I/O (SIO) Port
internal timing signals, Phase 1(PH1) and Phase 2 (PH2). These signals are active when high.
The microcontroller has a two-channel serial I/O port that shares pins with ports 1 and 2. Some
versions of this microcontroller may not have any. The serial I/O (SIO) port is an
asynchronous/synchronous port that includes a universal asynchronous receiver and transmitter
(UART). The UART has two synchronous modes (modes 0 and 4) and three asynchronous
modes (modes 1, 2, and 3) for both transmission and reception. The asynchronous modes are full
duplex, meaning that they can transmit and receive data simultaneously. The receiver is buffered,
so the reception of a second byte can begin before the first byte is read. The transmitter is also
buffered, allowing continuous transmissions. The SIO port has two channels (channels 0 and 1)
with identical signals and registers.