Microcontroller Class Notes
Microcontroller Class Notes
• Hence, use slow and low-cost memory devices to get substantial savings—essential for high-
volume applications like digital cameras.
• Also, reduce the area of the die taken up by the embedded processor; smaller the area used by
the embedded processor, reduced cost of the design and manufacturing for the end product.
4.hardware debug technology: ARM has incorporated hardware debug technology within the
processor so that software engineers can view what is happening while the processor is executing code.
With greater visibility, software engineers can resolve issues faster.
5.Not a pure RISC architecture: The ARM core is not a pure RISC architecture because of the
constraints of its primary application—the embedded system. In some sense, the strength of the ARM
core is that it does not take the RISC concept too far.
MODULE: 2
1. Explain ARM core dataflow model?
• The arrows represent the flow of data, the lines represent the buses, and the boxes represent either
an operation unit or a storage area.
Flow of data:
• Data enters the processor core through the Data bus
• The instruction decoder translates instructions before they are executed.
• The ARM processor, like all RISC processors, uses load-store architecture-
✓ load instructions copy data from memory to registers in the core
✓ store instructions copy data from registers to memory.
• There are no data processing instructions that directly manipulate data in memory. Thus, data
processing is carried out in registers.
• Data items are placed in the register file - a storage bank made up of 32-bit registers.
• The sign extend hardware converts signed 8-bit and 16-bit numbers to 32-bit values as they are
read from memory and placed in a register.
• ARM instructions typically have two source registers, Rn and Rm, and a single result or
destination register, Rd. Source operands are read from the register file using the internal buses
A and B, respectively.
• The ALU (arithmetic logic unit) or MAC (multiply-accumulate unit) takes the register values
Rn and Rm from the A and B buses and computes a result. Data processing instructions write
the result in Rd directly to the register file. Load and store instructions use the ALU to generate
an address to be held in the address register and broadcast on the Address bus.
• One important feature of the ARM is that register Rm alternatively can be preprocessed in the
barrel shifter before it enters the ALU. Together the barrel shifter and ALU can calculate a wide
range of expressions and addresses.
• After passing through the functional units, the result in Rd is written back to the register file
using the Result bus. For load and store instructions the Incrementer updates the address register
• The CPSR is divided into four fields, each 8bits wide: flags, status, extension, and control.
✓ The control field contains the processor mode, state, and interrupt mask bits.
✓ The flags field contains the condition flags.
• Some ARM processor cores have extra bits allocated. For example, the J bit, which can be found
in the flags field, is only available on Jazelle-enabled processors, which execute 8-bit instructions.
5. Explain pipeline?
• A pipeline is the mechanism in a RISC processor, which is used to execute instructions.
• Pipeline speeds up execution by fetching the next instruction while other instructions are being
decoded and executed.
• As the pipeline length increases, the amount of work done at each stage is reduced.
Fetch loads an instruction from memory.
Decode identifies the instruction to be executed.
Execute processes the instruction and writes the result back to a register.
✓ In the first cycle, the core fetches the ADD instruction from memory.
✓ In the second cycle, the core fetches the SUB instruction and decodes the ADD instruction.
✓ In the third cycle, both the SUB and ADD instructions are moved along the pipeline.
✓ The ADD instruction is executed, the SUB instruction is decoded, and the CMP instruction is
fetched. This procedure is called filling the pipeline.
➢ Five stage pipelining: The ARM9 core increases the pipeline length to five stages. The ARM9 adds
a memory and write stages to the pipelining which is increases the instruction throughput in ARM9
by around 13% compared with an ARM7.
Six stage pipelining: The ARM10 increases the pipeline length still further by adding a sixth stage
called ‘issue’. It have about 34% more throughput than an ARM7 processor core but again at a higher
latency cost.
6. With a neat diagram, explain the main hardware component of an ARM based embedded device.
four main hardware components:
i. ARM processor: The ARM processor controls the embedded device. Different versions of
the ARM processor are available to suit the desired operating characteristics. An ARM
processor comprises a core (the execution engine) plus the surrounding components (memory
and cache) that interface it with a bus. These components can include memory management
and caches.
ii. Controllers: Controllers coordinate important functional blocks of the system. Two
commonly found controllers are interrupt and memory controllers.
• Memory controller: it connect different types of memory to the processor bus. On power-up
a memory controller is configured in hardware to allow certain memory devices to be active.
• Interrupt controller: it provides a programmable governing policy that allows software to
determine which peripheral or device can interrupt the processor at any specific time by setting
the appropriate bits in the interrupt controller registers.
There are 2 types:
▪ The standard interrupt controller sends an interrupt signal to the processor core when an
external device requests servicing.
▪ The vector interrupt controller (VIC): it prioritizes interrupts and simplifies the
determination of which device caused the interrupt.
iii. The peripherals provide all the input-output capability external to the chip and are responsible
for the uniqueness of the embedded device. Each peripheral device usually performs a single
function and may reside on-chip. All ARM peripherals are memory mapped—the programming
interface is a set of memory addressed registers.
iv. A bus is used to communicate between different parts of the device.
7. Explain interrupts?