22EECF202 Microcontroller Architecture and Programming 2024 25 ODD Final V1 (2)
22EECF202 Microcontroller Architecture and Programming 2024 25 ODD Final V1 (2)
FMTH0301/Rev.5.3
Course Plan
Prerequisites:
Fundamentals of computer organization, logic design, binary arithmetic operations, digital circuits, and
C programming.
1
School of Electrical and Electronics Engineering
2
School of Electrical and Electronics Engineering
E.g.: 1.2.3: Represents program outcome '1', competency '2' and performance indicator' 3'.
3
School of Electrical and Electronics Engineering
Course Content
Content Hrs
Unit - 1
Chapter 1: Microprocessors and Microcontroller 2 hrs
Introduction to Microprocessors and Microcontrollers, A Microcontroller Survey, RISC &
CISC CPU Architectures, Harvard & Von-Neumann CPU architecture.
Chapter 2: The 8051 Architecture 4 hrs
8051 Microcontroller Hardware, Input / Output Pins, Ports and Circuits, semiconductor
Memories, Interfacing external RAM & ROM memories.
Chapter 3: Addressing Modes and Operations 5 hrs
Addressing modes, External data Moves, Code Memory, Read Only Data Moves /
Indexed Addressing mode, Data exchanges, stack concept and related instructions,
example programs. Arithmetic Operations: Introduction, Flags, Incrementing and
Decrementing, Addition, Subtraction, Multiplication and Division, Decimal Arithmetic,
Example Programs. Logical Operations: Introduction, Byte level, logical Operations, Bit-
level Logical Operations, Rotate and Swap Operations, Example Programs, Jump
Operations: Introduction, The JUMP and CALL, Program range, Jump calls and
Subroutines Interrupts and Returns, Example Problems.
Chapter 4: 8051 Programming in 'C' 3 hrs
Data Types and Time delays in 8051C, I/O Programming, Logic operations, Data
serialization.
Unit - 2
Chapter 5: Counter/Timer Programming in 8051 4 hrs
Introduction, Timer SFRs, Programming 8051 Timers, Programming Timer0 and Timer1 in
assembly and C language.
Chapter 6: Serial Communication 4 hrs
Basics of Serial Communication, 8051 connections to RS-232,8051 Serial Communication
modes, Programming, Serial port programming in C.
Chapter 7: 8051 Interfacing and Applications 3 hrs
Interfacing external peripherals to 8051 microcontrollers like LCD, Keyboard, Stepper
Motor, and DC Motor.
Chapter 8: Interrupts 3 hrs
Introduction to interrupts, interrupts vs. polling, classification of interrupts, interrupt priority,
interrupt vector table, interrupt service routine
4
School of Electrical and Electronics Engineering
Text Book:
1. "The 8051 Microcontroller Architecture, Programming & Applications" by Kenneth J.
Ayala', Penram International, 1996
2. "The 8051 Microcontroller and Embedded systems", by Muhammad Ali Mazidi and
Janice Gillispie Mazidi', Pearson Education, 2003
References:
1. "Programming and Customizing the 8051 Microcontroller ", by 'Predko', TMH.
Evaluation Scheme
ISA Scheme
( 23∗50)∗x
ISA 1
ISA 2 A 50
Post Test / Assignment 50
Review-1 Assembly
Programming
Review-2 C
Programming B
( 13∗50)∗ y 80
80
Review-3 Module
Development
Total A+B 50 130
ESA Scheme
5
School of Electrical and Electronics Engineering
Note
1. Each Question carries 15 marks and may consists of sub-questions.
2. Mixing of sub-questions from different chapters within a unit (only for Unit I and Unit II) is allowed in
ISA I, II and ESA
3. Answer 2 full questions of 15 marks each (two full questions from Unit I and II) out of 6 questions in
ESA.
6
School of Electrical and Electronics Engineering
7
School of Electrical and Electronics Engineering
Learning Outcomes: -
At the end of the topic, the student should be able to:
Lesson Schedule
Class No. - Portion covered per hour / per Class
1. Introduction to Microprocessor and Microcontroller architecture
2. RISC & CISC Instruction Architectures, Harvard & Von-Neumann Memory architecture.
Review Questions
Sl.No. - Questions TLOs BL PI Code
1. List 3 essential items needed to make up a development system for TLO1 L2 1.4.3
programming microcontroller
2. Differentiate between RISC & CISC TLO2 L2 1.4.3
3. Explain Harvard & Von-Neumann CPU architecture with a neat block TLO2 L2 1.4.3
diagram.
4. Differentiate between Microprocessors and Microcontrollers TLO1 L2 1.4.3
Chapter Number and Title: 2: The 8051 Architecture Planned Hours: 4 hrs
Learning Outcomes: -
At the end of the topic, the student should be able to:
Lesson Schedule
Class No. - Portion covered per hour / per Class
1. 8051 Microcontroller hardware features.
2. Internal Memory Organization
3. Special function registers
4. Input / Output Pins, Ports and Circuits
Review Questions
Sl.No. - Questions TLOs BL PI Code
1. With a neat block diagram, explain the architecture of the 8051 TLO1 L2 1.4.3
Microcontroller
2. Explain the data and program memory organization of the 8051 TLO2 L2 1.4.3
Microcontroller.
3. What are special function registers? List SFRs available in 8051. TLO3 L2 1.4.3
4. Explain the unique functions of port P3. TLO4 L2 1.4.3
5. With a neat register format, discuss the PSW register. TLO3 L2 1.4.3
9
School of Electrical and Electronics Engineering
Learning Outcomes: -
At the end of the topic, the student should be able to:
Lesson Schedule
Class No. – Portion covered per hour / per Class
1. Addressing modes and Instruction Classifications.
2. Data movement instructions, Stack concept and related instructions, example programs.
3. Arithmetic Operations: Introduction, Flags, Addition, Subtraction, Multiplication, Division,
Increment, Decrement and Decimal Arithmetic, Example Programs.
4. Logical Operations: Introduction, Byte level, Bit-level Logical Operations, Rotate and Swap
Operations, Example Programs.
5. Branch Instructions: Introduction, Byte level and Bit-level branch Operations, Example
Programs, Jump calls and Subroutines, Interrupts and Returns Example Problems.
Review Questions
Sl.No. – Questions TLOs BL PI Code
1. Explain the different addressing modes available in the 8051 TLO1 L2 1.4.3
Microcontroller.
2. Explain the external addressing using MOVX & MOVC instructions. TLO2 L2 1.4.3
3. Explain how PUSH/POP instruction works with 8051. TLO2 L2 1.4.5
4. Write a program to divide the data in RAM locations 3EH by 12H, put TLO3 L2 1.4.5
the quotient in R4 and reminder in R5 in the current register bank.
Give explanatory comments.
5. Explain the significance of the overflow flag in arithmetic operations. TLO3 L2 1.4.5
10
School of Electrical and Electronics Engineering
6. Write a program to divide data in RAM location 13H by the data in TLO3 L3 1.4.5
RAM location 14H. Restore the original data in 13H by multiplying the
result by the data in 14H.
7. Explain the following instructions TLO1 L2 1.4.5
SWAP, CJNE, DJNZ, ACALL, AJMP, JNZ, ANL,
8. Write a program to sort n 8-bit numbers in ascending order. TLO5 L3 1.4.5
9. Write an ALP to convert the given hex data to BCD. TLO4 L2 1.4.5
10. The government has released vaccination to the age group of 18 to TLO5 L3 2.1.2
44. A total of 10 people have registered for the vaccination. It is
required to schedule the vaccination dates based on higher age to
lower age. Develop an assembly language program to arrange the
age and assign dates to each person, assuming one day one person.
(Assume the input to be age, and the dates available are from
1\7\2021 to 20\7\2021.)
Note: Display only the date as the month and year are fixed in
the given format.
0x40:Age1 0x41:date1
0x42:Age2 0x43:date2
11. Write a program to find the factorial of a number using a subroutine. TLO6 L3 1.4.5
12. Calculate the minimum number of address lines needed for the row [GATE 2015 Set 1]
decoder if the 16 Kb (=16,384 bit) memory array is designed as a
square with an aspect ratio of one (the number of rows equals the
number of columns).
13. Which device is used to store information in DRAM [GATE 2017 Set 2]
14. How many MOS transistors are there in each cell of SRAM [GATE 1996]
15. For computers based on three-address instruction formats, each [GATE CSE 2015 set
address field can be used to specify which of the following: 1]
(S1) A memory operand
(S2) A processor register
(S3) An implied accumulator register
16. Suggest legal program counter if CPU has 24-bit instructions. A [GATE CSE 2006]
program starts at address 300 (in decimal).
17. Suggest the most appropriate matching for the following pairs [GATE CSE 2000]
Indirect addressing Loops
Indirect addressing Pointers
Indirect addressing Constants
11
School of Electrical and Electronics Engineering
Learning Outcomes: -
At the end of the topic, the student should be able to:
Lesson Schedule
Class No. - Portion covered per hour / per Class
1. I/O Programming
2. Data Types and Time Delays in 8051
3. Logic operations, Data serialization
Review Questions
Sl.No. - Questions TLOs BL PI Code
1. Explain different 8051 C data types TLO1 L2 1.4.5
2. A door sensor is connected to the P1.1 pin, and the buzzer is TLO2 L3 2.1.2
connected to P1.7; write the 8051 C program to monitor the door sensor,
and when it opens, sound the buzzer.
3. Write an 8051 C program to send out the value serially 1 bit at a time TLO3 L3 1.4.5
through P1.0. The LSB should go out first.
4. Write an 8051 C program to send your first and last names to P2. TLO3 L3 1.4.5
5. Write a program to generate a triangular waveform of 10KHz on P1.1 TLO2 L3 1.4.5
12
School of Electrical and Electronics Engineering
Learning Outcomes: -
At the end of the topic, the student should be able to:
Lesson Schedule
Class No. - Portion covered per hour / per Class
1. Timer introduction, Modes of operations and Timer SFRs.
2. Programming 8051 Timers.
3. Counter Programming.
4. Programming Timer0 and Timer1 in 8051C
Review Questions
Sl.No. - Questions TLOs BL PI Code
1. Discuss the operation of Timer 0 in mode 2. TLO1 L2 1.4.3
2. With a neat register format, explain the TMOD register. TLO2 L2 1.4.3
3. Assume that XTAL = 11.0592MHz. What value do we need to load TLO3 L3 1.4.3
into the Timer's registers if we want a time delay of 5ms? Show the
program for Timer 0 to create a pulse width of 5 ms on P2.3.
4. Write an 8051 C program to create a frequency of 2500hz on pin P2.7. TLO3 L3 1.4.3
Use timer1 mode2 to create the delay.
13
School of Electrical and Electronics Engineering
Learning Outcomes: -
At the end of the topic, the student should be able to:
Lesson Schedule
Class No. - Portion covered per hour / per Class
1. Basics of Serial Communication
2. 8051 connections to RS232
3. 8051 Serial Communication modes
4. Serial port programming.
Review Questions
Sl.No. - Questions TLOs BL PI Code
1. Explain half/full duplex transmission. TLO1 L2 1.4.3
3. Write the steps in programming 8051 for serial communication using TLO1 L2 1.4.5
mode 1.
4. Explain the importance of the TI/RI flag in serial communication. TLO3 L2 1.4.5
5. Write a program to continuously transfer the message "yes" serially at TLO4 L3 1.4.5
9600 baud, 8-bit data, and one stop bit.
14
School of Electrical and Electronics Engineering
Learning Outcomes: -
At the end of the topic, the student should be able to:
Lesson Schedule
Class No. - Portion covered per hour / Class
1. Interfacing techniques and programming: switches, LED, Seven-segment
2. LCD Programming
3. Keypad, Stepper Motor and DC Motor
Review Questions
Sl.No. - Questions TLOs BL PI Code
1. Develop a C program to control the ON and OFF action of LEDs using TLO1 L2 1.4.5
switches
2. With a neat diagram, discuss how seven segments are interfaced with TLO2 L2 1.4.3
the 8051 Microcontroller
3. Explain the pin descriptions for LCD and interfacing of LCD to the TLO2 L2 1.4.3
8051 Microcontroller
4. With a neat diagram, explain the interfacing of the stepper motor and TLO2 L2 1.4.3
define the following w.r.t Stepper motor.
i) Step angle ii) Motor speed
5. Interface 4x4 keypad to 8051 and write a program to scan a key TLO3 L3 1.4.5
pressed
6. Interface the DC motor to 8051 and write a C program to rotate it in TLO3 L3 1.4.5
both directions.
7. The door sensor is connected to count the number of people attending TLO4 L3 2.1.2
the conference. The conference hall is automated to control the AC and
FAN. Develop the above-said system to cater to the needs of the
auditorium.
15
School of Electrical and Electronics Engineering
8. A password based door locking system is connected to the door. TLO4 L3 2.1.2
Develop an application program using suitable input and output device to
open the door upon password match, else alert the authorized person.
9. Develop an application program to demonstrate grocery billing system TLO4 L3 2.1.2
using suitable input and output device. (Assume the data as necessary)
16
School of Electrical and Electronics Engineering
Learning Outcomes: -
At the end of the topic, the student should be able to:
Lesson Schedule
Class No. - Portion covered per hour / per Class
1. 8051 Interrupts, Different interrupts supported by 8051 Microcontroller.
2. Steps involved in handling an interrupt.
3. Interrupt Vector Table
Review Questions
Sl.No. - Questions TLOs BL PI Code
1. What are interrupts? Discuss the different types of interrupts TLO1 L2 1.4.3
supported by the 8051 Microcontroller.
2. Discuss the sequence of operations the processor performs to handle TLO2 L2 1.4.3
interrupts
3. What is ISR? TLO2 L2 1.4.3
4. In the 8051, what memory area is assigned to the interrupt vector TLO2 L2 1.4.3
table? Can the programmer change the memory space assigned to the
table?
17
School of Electrical and Electronics Engineering
0x42:Age2 0x43:date2
Follow this pattern for display.
3b Develop an ALP to search a given number in an array of
10 bytes and find the factorial of the same using a 6 CO2 L3 1 1.4.5
subroutine.
18
School of Electrical and Electronics Engineering
19
School of Electrical and Electronics Engineering
0x42:Age2 0x43:date2
Follow this pattern for display.
3b Discuss the data types supported by the 8051 7 CO3 L2 1 1.4.3
20
School of Electrical and Electronics Engineering
21
School of Electrical and Electronics Engineering
Evaluation Scheme
22
School of Electrical and Electronics Engineering
Review No. COs Level 1.4.5 2.1.2 4.2.1 5.2.2 10.1.2 Total
Marks
(80)
Review 1 2 3 7 - 6 7 5 25
Review 2 3 3 7 - 6 7 5 25
Review 3 4 3 6 6 6 7 5 30
Evaluation Rubrics
23
School of Electrical and Electronics Engineering
24
School of Electrical and Electronics Engineering
25