Micro Controllers
Micro Controllers
Microprocessor Vs Microcontroller:
02.Types of microcontroller?
1. Havard Architecture
2. Von Neumann Architecture
1. AVR
2. PIC
3. Hitachi
4. Motorola
EEE3231(Section-B) Microcontrollers Session – 2018-19
Princeton Architecture
Advantage of princeton Architecture
Disadvantage
• Shared memory - a defective program can overwrite another in memory,
causing it to crash
• Memory leaks - some defective programs fail to release memory when
they are finished with it, which could cause the computer to crash due to
insufficient memory
• Data bus speed - the CPU is much faster than the data bus, meaning it
often sits idle (Von Neumann bottleneck)
• Fetch rate - data and instructions share the same data bus, even though
the rate at which each needs to be fetched is often very different
⁕⁕ CISC vs RISC Processor :
CISC Processor RISC Processor
8. Low cycle per second with large code size. 8. High cycle per second with small code
size.
Instruction cycle:
The instruction cycle refers to the sequence of operations that the microcontroller performs
to fetch, decode, and execute a single instruction from memory. This process is fundamental to
the operation of any microcontroller or processor.
Clock cycle:
A clock cycle refers to the basic unit of time used to synchronize operations within the
microcontroller's central processing unit (CPU) and other components. It is also known as a
clock tick or clock pulse.
Q13. Basic feature of 8051 MP.
1. 8-bit CPU
2. Harvard Architecture
5. Timers/Counters
9. Power Modes
Ans:
The 8051 microcontroller has four 8-bit ports named P0, P1, P2, and P3, which serve as parallel
input/output (I/O) ports. Each port has 8 pins that can be individually configured as input or
output. Here's the pin diagram for the 8051 microcontroller, specifically showing the parallel I/O
pins:
Vcc [ 1 ] [ 40 ] GND
P0.0/TXD [ 2 ] [ 39 ] P0.7/RXD
P0.1/RXD [ 3 ] [ 38 ] P1.0/T2
P0.2/TXD [ 4 ] [ 37 ] P1.1/T2EX
P0.3/INT0 [ 5 ] [ 36 ] P1.2
P0.4/INT1 [ 6 ] [ 35 ] P1.3
P0.5/T0 [ 7 ] [ 34 ] P1.4
P0.6/T1 [ 8 ] [ 33 ] P1.5
P0.7/WR [ 9 ] [ 32 ] P1.6/AIN0
EA [10 ] [ 31 ] P1.7/AIN1
ALE [11 ] [ 30 ] P2.0
PSEN [12 ] [ 29 ] P2.1
P2.7 [13 ] [ 28 ] P2.2
P2.6 [14 ] [ 27 ] P2.3
P2.5 [15 ] [ 26 ] P2.4
P2.6 [16 ] [ 25 ] RST
P2.7 [17 ] [ 24 ] XTAL2
P3.0 [18 ] [ 23 ] XTAL1
P3.1 [19 ] [ 22 ] RXD/T1
P3.2 [20 ] [ 21 ] TXD/T0
Explanation:
• The pins labeled P0.0 to P0.7 are the individual pins of Port 0.
• The pins labeled P1.0 to P1.7 are the individual pins of Port 1.
• The pins labeled P2.0 to P2.7 are the individual pins of Port 2.
• The pins labeled P3.0 to P3.2 are the individual pins of Port 3.
Each of these pins can be configured as either input or output, depending on the needs of the
application. The input/output configuration can be set using the appropriate control registers in
the 8051 microcontroller.
• Port-1 Pin Structure Port-1 has 8 pins (P1.1-P1.7) .The structure of a port-1
pin is shown in fig below.
* PORT 2 Pin Structure Port-2 has 8-pins (P2.0-P2.7) . The structure of a port-2 pin
is shown in figure below:
• Port-3 has 8 pin (P3.0-P3.7). Port-3 pins have alternate functions. The
structure of a port-3 pin is shown in figure
Q 14. Basic Architecture of 8051 Microprocessor?
Ans:
RAM, ROM, I/O Ports, and Timers can RAM, ROM, I/O Ports, and Timers
be added externally and can vary in cannot be added externally. These
numbers. components are to be embedded
together on a chip and are fixed in
numbers.
Designers can decide the number of Fixed number for memory or I/O
memory or I/O ports needed. makes a microcontroller ideal for a
limited but specific task.
Instruction cycle consists of fetch, execute and interrupt stage show in below.
If any interrupt occurs, it is indicated by an interrupt flag. The CPU will go to interrupt handler routine.
Interrupt handler then checks the type of interrupt and executes the appropriate function. It involves
overhead but still better than the CPU waiting for I/O completion or other activities.
Interrupt handler activates most prior able activity first and later deferrable part will be handled.
Example
The of data arrives on the network line.
Kernel marks the presence of data (urgent part) and gives the CPU back to the process that was running
before.
Rest of processing can be done later (moving data to buffer where recipient will find it)
Interrupt vector
Table of pointers in memory contains the addresses of interrupt service routines at a fixed location for a
given CPU.
Interrupt processing
Step 1 − First device issues interrupt to CPU.
Step 3 − CPU tests for pending interrupt request. If there is one, it sends an acknowledgment to the
device which removes its interrupt signal.
Step 5 − CPU loads the location of the interrupt handler into the PC register.
Step 6 − Save the contents of all registers from the control stack into memory.
Step 7 − Find out the cause of interrupt, or interrupt type or invokes appropriate routine.