lecture 1
TRANSCRIPT
1
Center for Advanced Studies in Engineering
Microcontroller Based Embedded Systems
Lecture1
2
IntroductionMicroprocessor (µP)(MPU)
A µP is a CPU on a single chip. Components of CPU
ALU, instruction decoder, registers, bus control circuit, etc.
Micro-computer (u-Computer)small computerµP + peripheral I/O + memory specifically for data acquisition and control applications
Microcontroller (µC) u-Computer on a single chip of silicon
3
µP vs. µCA µPP
only is a single-chip CPU bus is availablebus is availableRAM capacity, num of port is selectable RAM is larger than ROM (usually)
A µCcontains a CPU and RAM,ROM ,Peripherals, I/O port in a single ICinternal hardware is fixedCommunicate by portROM is larger than RAM (usually)Small power consumptionSingle chip, small board Implementation is easyLow cost
4
ApplicationsµCs are suitable to control of I/O devices in designs requiring a minimum componentµPs are suitable to processing information in computer systems.
µP vs. µC – cont.
5
µP vs. µC – cont.µC is easy to use and design.
Only single chip can be a complete system interfacing to other devices,
for example, motors, displays, sensors, and communicate with PC.
In contrast, similar system that builds from µP would require a lot of additional units,
such as RAM, UART, I/O , TIMER and etc.
6
µC is a Reusable HardwareLogic circuit provides limited function for one single design. In order to change circuit’sfunctionality, we need to redesign the circuits.µC can reprogram and change functionality of every port, input to output or digital to analog on the fly.
7
MicrocontrollersMany µCs are existing right now.
PIC, 8051, 68HC11, MSP430, ARM series, and etc.We may widely divide it with how it is designed
RISC/CISC architecture.
What is the main difference between RISC/CISC?Does it make any difference to our application?
8
The Microprocessor (MPU)The µP is the ‘brain of the microcomputer’Is a single chip which is capable of
processing datacontrolling all of the components which make up the microcomputer system
µP used to sequence executions of instructions that is in memoryµP Fetch , Decode , and Execute the instructionThe internal architecture of the microprocessor is complex.
9
The Microprocessor (MPU)
Microprocessor (MPU) typically containsRegisters: Temporary storage locations for program instruction or data.
The Arithmetic Logic unit (ALU): This part of the MPU performs both arithmetic and logical operations
Timing and Control Circuits: that keep all of the other parts of system (Regs, ALU, memory & I/O) working together in the right time sequence
10
MicrocomputersAll Microcomputers consist of (at least)
1. Microprocessor Unit (MPU)2. Program Memory (ROM)3. Data Memory (RAM)4. Input / Output ports5. Bus System (and Software)
MPU is the brain of microcomputer
11
Microcomputers
12
The Input/Output (I/O) SystemI/O is the link between the MPU and the outside world. An input port is a circuit through which an external device can send signals (data?) to the MPU.An output port is a circuit that allows the MPU to send signals (data?) to external devices.I/O ports connect both digital and analogue devices by DAC and ADC
13
BusA Bus is a common communications pathway used to carry information between the various elements of a computer systemThe term BUS refers to a group of wires or conduction tracks on a printed circuit board (PCB) though which binary information is transferred from one part of the microcomputer to anotherThe individual subsystems of the digital computer are connected through an interconnecting BUS system.
14
Bus
There are three main bus groupsADDRESS BUSDATA BUSCONTROL BUS
15
Data BusThe Data Bus carries the data which is transferred throughout the system. ( bi-directional)Examples of data transfers
Program instructions being read from memory into MPU.Data being sent from MPU to I/O portData being read from I/O port going to MPUResults from MPU sent to Memory
These are called read and write operations
16
Address Bus
An address is a binary number that identifies a specific memory storage location or I/O port involved in a data transferThe Address Bus is used to transmit the address of the location to the memory or the I/O port.The Address Bus is unidirectional ( one way ): addresses are always issued by the MPU.
17
Control BusThe Control Bus: is another group of signals whose functions are to provide synchronization ( timing control ) between the MPU and the other system components. Control signals are unidirectional, and are mainly outputs from the MPU.Example Control signals
RD: read signal asserted to read data into MPUWR: write signal asserted to write data from MPU
18
Main memoryThe duties of the memory are :
To store programs To provide data to the MPU on requestTo accept result from the MPU for storage
Main memory TypesROM : read only memory. Contains program (Firmware). does not lose its contents when power is removed (Non-volatile)RAM: random access memory (read/write memory) used as variable data, loses contents when power is removed volatile. When power up will contain random data values
19
Read-Only Memory
µP can read instructions from ROM quicklyCannot write new data to the ROMROM remembers the data, even after power cycledTypically, when the power is turned on, the microprocessor will start fetching instructions from the still-remembered program in ROM (bootstrap )
20
Available ROMsMasked ROM or just ROMPROM or programmable ROM(once only)EPROM (erasable via ultraviolet light)Flash (can be erased and re-written about 10000 times, usually must write a whole block not just 1 byte or 2 bytes, slow writing, fast reading)EEPROM (electrically erasable read-only memory, also known as EEROM—both reading and writing are very slow but can program millions of times…useless for storing a program but good for say configuration information.
21
ROM A0A1
A2
Am
D0
Dn
D1
D2
OECE
n+1 bitData
12 +m
m+1 bitAddress
Capacity :
OE : Output Enableconnect to RD of µP
)(CSCE
)1(2 1 +×
: Chip Enableto Address decoder
+ nm
ROMPROM
EEPROM
22
Timing Diagram for a Typical ROM
CE
A0-Am
D0-Dn
OE falls to data valid
Addr valid to data valid
OE
23
RAM (Random Access Memory)
The µP can read the data from RAM quickly The µP can write new data quickly to RAMRAM forgets its data if power is turned offTwo type of is available :
Static RAM(SRAM): ff base, fast, expensive, low cap/vol, applied for cache , no refresh Dynamic RAM (DRAM): cap base, slow , low cost high capacity/volume , applied for main memory(pc) need refresh.
24
RAM(Static) A0A1
A2
Am
D0
Dn
D1
D2
RDWR
n+1 bitData
12 +mCapacity :
m+1 bitAddress
CS : Chip Selectto Address decoder
)1(2 1 +×+ nm
RAM
CS
RD : Read signalconnect to MemRD of µP
WR : Write signalconnect to MemWR of µP
Data bus isBidirectional
25
SUMMARY