Sei sulla pagina 1di 30

Microcontroller Systems:

EEC 2033
General Introduction
Day Two: µcontroller H/W
• Objectives: At the end of this lecture you should
learn:

• The hardware components of a microcontroller

– The microprocessor

– Memory

– Input/Output
Microcontroller
• A microcontroller is a stand alone device and
consist of 3 components

– microprocessor,
– memory and
– -input/output ports

on a single semiconductor chip.


Microcontroller components
• Microprocessor:
– is the heart of a microcontroller,
– it processes data based on instructions stored in
memory
– It communicates with memory, I/Os and controls the
timing of all operations using system bus
• Memory:
– Stores instructions and data.
– Instructions are stored in memory as binary 1s and 0s
known as machine language.
• I/O ports: - can be digital or analog
– The input (Keyboard, mouse, etc)
– Outputs (LEDs, monitor, motor, etc)
Microcontroller components
 In groups of two or three, discuss
where we use microcontrollers in daily
life
 Work quickly. Let your brain storm!
 Share your thoughts with the rest of
the group
Where do we find microcontrollers?
Microcontroller Applications:
Industrial and Consumer products:
• Laboratory instruments,
• Medical equipment,
• automobile dash boards,
• wireless phones
• home appliances- microwave ovens, digital
clocks
• copying machines, mobile phones and music
systems.
Microcontroller or Microcontroller
Unit (MCU)
• 3 components:
– microprocessor,
– memory
– I/O
• Also includes
– timers,
– A/D converters
– and serial I/O
Microprocessor Vs Microcontroller
• Microprocessor:
– It is a computing device that processes information.
– User writes instructions and they are stored in the
program memory as bits -0s and 1s.
– And the processor processes these bits.

• Microcontroller system
– includes hardware and software.
– Hardware:
• It is the physical electronic circuit on PCB with discrete
components.
– Software:
• It is a set of instructions the user writes in to the program memory
so that the hardware perform particular task.
Processor
• The Processor is also called:
– CPU (central processing unit),
– Microprocessor,
– or microprocessor unit (MPU).

• The processor consist of 3 components


– ALU ( Arithmetic Logic Unit)
– Registers
– Control Unit.
Microprocessor Components
• ALU:
– ALU performs arithmetic and logic computation
task specified by the instruction.
• Registers:
– Registers are used for temporary storage.
• Control Unit:
– control unit is used for timing and enabling other
operations.
Memory
Memory
• Memory is a semiconductor chip used to store
information and supply it to the
microprocessor.

– The major memories of a microcontroller are:


• Program Memory
– Used to store Instructions
• Data Memory
– Used to store data
Types of memory
• Read/write (R/W) memory
– Information is stored in the registers and the
processor can write into and read (get information)
from memory
– Also known as RAM (Random Access Memory)
– It is volatile (which means the information is lost
when power is OFF).

• Read only memory (ROM)


– It is non volatile (means information is stored
permanently)
– And the processor can only read from it.
– Information is always available for reading when
power is turned ON after being OFF.
ROM
• ROM is divided into two groups:
– Permanent:
• Permanent ROM includes
– Programmable Read-Only memory (PROM).
» Once PROM memory is programmed, the program is stored
as permanent and is known as OTP( one time
programmable).
– Semi-permanent:
• Erasable Programmable Read-Only Memory(EPROM),
• Electrically Erasable Programmable Read-Only
Memory(EEPROM)
• Flash memory.
Data Types
• Nibble:
– Group of 4 bits

• Byte:
– Group of 8 bits

• Word:
– is group of 16 bits or 2 bytes.

• Double word
– is 32 bits or 4bytes.

• Quad word
– is group of 64 bits.
Memory Inside
• Memory has a sequence of
registers

• Each register can store either 8


or 16 bits.

– For example
• if the memory has 4bit address
lines
– It can address 24 = 16 registers,

• then binary address of the 16


registers vary from (0000)2 to
(1111)2

• And the address lines A3 to A0 is


used identify a register.
Memory size
• The size of memory chip is determined by:
– the total number of registers on the chip and
– the number of bits of each register.
• 4bit address-line memory each having 8bit registers will
have a memory size of:
– 24 * 8 = 16 * 8 = 128bits = 16bytes

• Example: 256x8 memory chip represents 2048


bits or 256 bytes.
– The 256x8 memory chip has:
• 256 lines to write instructions or data,
• each line with 8 bits.
BREAK
Input/output (I/O)
• I/O devices also known as peripherals.
• Input Devices
– Are used to enter binary information, data and instructions
in microprocessor based systems.
– Examples:
• Switches
• Keyboards
• Output Devices
– Microprocessor sends results to these devices for display.
– Examples:
• light-emitting diode(LED),
• seven-segment LEDs,
• video monitors or printers are used to display information.
Interfacing Peripheral Devices:
• Input peripheral to microprocessor system refers to:
– Keyboard, switches and the mouse that provide binary
information as input to the processor.

• Output peripherals such as:


– a video screen, printer, LCD and LEDs accept information from the
processor and display it

• Peripherals need to be interfaced to the microprocessor


through I/O interfacing chips known as I/O ports such as:
– Buffers
• Buffers are bidirectional (allow information to flow in both directions).
• Buffer is used as an input and output interfacing device.
– and latches.
• Latch is mainly used as output interfacing device.
System Bus
• System Bus is a common communication path
between processor, memory and I/O.

• The processor selects one device at a time to


communicate with it using the bus.

• Three types of buses:


– Address bus
– Data bus
– Control bus.
Address Bus
• It is a group of lines used to identify memory
registers and I/O devices.

• It is unidirectional ( information flows in one


direction from the processor to memory and
I/Os).

– 4 bit address bus can identify 16 registers from 0000


to 11112 and

– 12 bit address bus is capable of addressing 212 = 4096


memory address.
Data Bus
• Group of lines that are used to transfer binary
data or instructions.

• Its bidirectional (data can flow both directions):


– From microprocessor to memory and output devices.
– From memory and input devices to microprocessor.

• Processor size:
– The width of data bus is generally used to label the
size of the processor.
Control Bus
• Group of individual lines called Read and write that
are used to enable memory and i/o devices.

Microprocessor – Based System with System bus


Writing and Reading instructions into
or from memory:
• Instructions written by programmer are stored
in the memory.
• During read operation:
– data flows from memory to the processor.
• During write operation:
– the processor writes into memory.
– data flows from processor to the memory
• Processor displays results at output device
such as LEDs.
Before I
summarise:
Any Questions?
Summary
• The hardware components of the
microprocessor have been explained

• These include the microprocessor, the


memory, and the input/output devices
together with support devices.

• These will now be used frequently in


the detailed microcontroller
architecture

Potrebbero piacerti anche