SY Microcontroller Unit 1 Notes-1
SY Microcontroller Unit 1 Notes-1
WEL COME
For
Learning academic subjects through
Digital platform
Microcontroller architecture &
programming
By
Prof. M. G. Kundhare
Assistant Professor (SET,NET)
Electronics Science
Structure of S.Y.B.Sc. (Computer Science)
Electronics
S.Y.B.Sc. (Computer Science)
Electronics
Semester III
Paper I (ELC – 231)
Microcontroller Architecture
& Programming
(2 Credits)
Syllabus:-
Syllabus:-
Introduction to Microprocessor:-
OR
Dia.2 :-up Block Diagram
2
1)
Difference between microprocessor &
microcontroller
Introduction to Intel 8051
microcontroller
1. Processing unit
2. Register set
3. Memory units
4. I/O ports & serial port
5. Interrupt structures
6. Timing and control unit
7. Timers
The 8051 uC architecture consists of
following specific features:-
• 8 - bit CPU with register A
(Accumulator) & register B.
• 16 – bit Program Counter (PC) & Data
Pointer (DPTR) register
• 8 – bit Program Status Word (PSW)
register
• 8 – bit Stack Pointer (SP) register
• Internal ROM of 4 k bytes.
• Internal RAM of 128 bytes.
This RAM is divided into three parts as
i) 32 bytes in 4 Register banks
(R0,R1,R2 &R3) ,each containing 8
registers.
ii) 16 bytes which are bit addressable.
iii) 80 bytes of general purpose data
memory.
The 8051 uC architecture consists of
following specific features:-
• Four 8 – bit ports (P0,P1,P2 & P3)
which contains 32 input/output pins.
• Two 16 – bit timers/counters (T0 & T1)
• Full duplex serial data transmitter/
receiver
• Various Special Function Registers
(SFRs) such as IE, IP, PCON, SBUF,
SCON, TCON, TMOD, TL0, TH0, TL1
& TH1.
• Two external & three internal intuerrept
sources.
• Oscillator and Clock circuits.
Video Lecture Notes
Chapter 1- Basics of Microcontroller & Intel 8051
architecture
2)
Features & Block diagram of 8051
microcontroller
Pin diagram of 8051
microcontroller
Pin diagram of 8051
microcontroller
• The pin diagram of 8051 uC IC is
available in 40 pin DIP package.
• In 8051 uC out of 40 pins, 32 pins are
set aside for the four ports P0,P1,P2 &
P3 where each port has 8 pins.
• The rest of the pins are designated as --
Vcc, Ground, XTAL1, XTAL2, RST,
EA,ALE and PSEN.
• These pins must be connected in order
to work the system properly.
• Some pins are used for more than one
function hence these pins are also
called as the multifunction pins.
Pin diagram of 8051
microcontroller
The function of each pin is described
below:-
3)
Pin diagram of 8051 microcontroller
Internal RAM Organization of 8051
microcontroller
1. Register Banks
• 08 H to 0F H is for Bank 1.
• 10 H to 17 H is for Bank 2.
• 18 H to 1F H is for Bank 3.
Internal RAM
Organization of 8051
microcontroller
Register Bank in 8051 :-
4)
Internal RAM organization of 8051
microcontroller
The Registers of 8051
microcontroller
The 8051 Registers :-
5)
Register A, B, PC & DPTR of 8051
microcontroller
The Flags and PSW Register of
8051 microcontroller
The Flags of 8051 uC :-
• The Flags are 1 – bit registers provided to store the result of
certain program instructions.
• The other instructions can test the condition of flags and make
decision based on the flags states.
• The 8051 has four condition flags namely carry(CY), auxillary
carry(AC), overflow (OV) and Parity(P).
• These flags are affected by the arithmetic and logical
operations.
• In addition to this the 8051 uC has three General Purpose user
flags named as FO, GF0 & GF1.
• In 8051 uC, these flags are grouped into the PSW and PCON
registers.
The Flags and PSW Register of
8051 microcontroller
The PSW register:-
• The PSW (Program Status Word) register is an 8 – bit register .
• It is also known as the Flag register.
• Structure of PSW register :-
The PSW register contains –
• Four conditional flags (CY, AC, OV, P)
• Two register bank select bits (RS1 & RS0)
• One user flag (F0)
6)
The PSW Register of 8051
microcontroller
Stack and Stack Pointer Register
Stack and Stack Pointer Register
Stack and Stack Pointer Register
Stack and Stack Pointer Register
Stack and Stack Pointer Register
Stack and Stack Pointer Register
Stack and Stack Pointer Register
Stack and Stack Pointer Register
Video Lecture Notes
Chapter 1- Basics of Microcontroller & Intel 8051
architecture
7)
The Sack and SP register of 8051
microcontroller
SFR’s of 8051 microcontroller
Reset :-
• It is active high input pin.
8)
The SFR’s & Clock signal of 8051
microcontroller
The External Memory interfacing to
the 8051 microcontroller
9)
External memory interfacing with 8051
microcontroller