Ch-1 1
Ch-1 1
Ch-1 1
Objective:
Microprocessor and microcontroller Software - Assembly language programming (8051) Hardware - Interface design
Credit Hours:
3 credit hours 3 hours of lecture per week 1 hour of tutorial per week (except Week 1) 2 lab sessions
Textbook/Reference:
Koo Voon Chet et al., The 8051 Cookbook: A Complete Guide to Architecture, Programming and Interfacing, 2nd Edition, Prentice Hall, Malaysia, 2006. Walter A. Triebel and Avtar Singh, The 8088 and 8086 Microprocessors, The: Programming, Interfacing, Software, Hardware, and Applications, 4th Edition, Prentice Hall, US, 2003.
Syllabus 2011
Syllabus 2011
Chapter 2 The 8051 Microcontroller Features of the 8051 family, block diagram and definitions of the pin of the 8051, I/O port structure, memory organization: general purpose RAM, bit addressable RAM, register bank, special function registers, external memory, memory space mapping and decoding, bus control signals timing, a typical 8051 micro-controller based system.
Syllabus 2011
Chapter 3 Instruction Set and Assembly Language Programming Addressing modes, the 8051 instruction set and typical examples, assembler operation, assembly language format, assembler directives, operation of assemblers and linkers, programming examples.
Syllabus 2011
Chapter 4 On-chip Peripheral Devices and Interrupt System I/O ports: Operations and uses of port 0, port 1, port 2, port 3, timers: their operations, programming, and applications, serial port: operations and programming, typical applications. Interrupt System: Organization of the interrupt system, interrupt vectors, interrupt timings, serial port interrupts, and external interrupts, implementation of single and multiple interrupts.
Syllabus 2011
Chapter 5 Interfacing Examples Interfacing to external memory, keypad, sevensegment LED display, ADC and DAC chips, and input / output port expansion, description and uses of hardware development tools.
Syllabus 2011
Chapter 6 Contemporary Microprocessors Overview of different generations of microprocessor, highlights of architectural and technological advancement of IA-32 processors (80386, 80486 and Pentium), 64-bit processors (e.g. Intel Itanium, AMD AMD64), multi-core processors (e.g. Intel Core2Duo, AMD X2).
Learning Outcome
At the completion of the subject, students should be able to perform the following tasks:
LO1 Describe the fundamental features and operation of contemporary microcontroller and microprocessor. (cognitive remembering, level 1) - 20% LO2 Explain the pin configuration and memory organization of a typical 8051 microcontroller. (cognitive - understanding, level 2) 13% LO3 Illustrate the 8051 microcontroller memory expansion capability. (cognitive - understanding, level 2) - 9% LO4 Analyze the MCS-51 Instruction Set. (cognitive - analyzing, level 4) - 23% LO5 Develop assembly language source code for applications that use I/O ports, timer and single/multiple interrupts. (cognitive creating, level 6) - 24% LO6 - Produce interfacing examples using 8051 microcontroller. (cognitive - applying, level3) - 11%
Lab Experiments: 10% (Assessment) Midterm Test: 10% (Chapter 1 3) Assignment: 10% (Assessment) 20% (Hardware based, group project) Final Exam: 50%
Previous Assignment
Previous Assignment
Previous Assignment
(2007)
Previous Assignment
Automatic room light controller with visitor counter (2009) A Queuing Display System using 8051-family microcontroller (2008)
Previous Assignment
CHAPTER-1
PRELIMINARIES
Bit: Byte: Nibble: The basic unit of information in a computer, which stands for binary digit, with the values 0 or 1 (low or high) only. A group of 8 bits. A group of 4 bits (half a byte)
Processor word length The size of the group of bits a processor is designed to use as a single unit or word E.g. 8-bit, 16-bit, or 32-bit computer. Most Significant Bit (MSB) & Least Significant Bit (LSB): E.g. For an 8-bit binary number
1
MSB
0
2 LSB
Review of Number Systems: - Decimal (010, 110, 210,.., 910) - Binary (02, 12) - Hexadecimal (016, 116, 216,E16, F16) - Octal (08, 18, 28,..78)
position
0 1 0 12
digit
! 0 v 23 1v 2 2 0 v 21 1v 2 0 ! 510
Binary
Hexa decimal
Octal
Exercises 1
Convert the following numbers:
0011 10102 to decimal 2610 to binary 0011 10102 to octal 0011 10102 to hexadecimal 378 to binary If convert octal and 3F16 to binary
ASCII code:
(American Standard Code for Information Interchange)
A character is represented by a 7 bit binary number (X6X0) Alphanumeric Codes E.g. A 100 00012 41H alphabets,
110 00012
61H
Logic Circuit
The output is decided by the current input only Basic logic gates: inverter, AND, OR, NAND, NOR, XOR E.g. Adder, decoder, multiplexer and etc.
OR AND NOR NAND
Combinational Vs Sequential
XOR
A 0 0 1 1
B 0 1 0 1
A 0 0 1 1
B 0 1 0 1
A 0 0 1 1
B 0 1 0 1
A 0 0 1 1
B 0 1 0 1
A 0 0 1 1
B 0 1 0 1
auxiliary carry
1 0 carry out + 1 1 0
1 0 1 0
1 1 0 0
1 0 1 0
1 1 0 0
1 1 0 0
1 0 1 [45] 1 1 [-45] 0 0
8-bit results
Subtraction:
Borrow 1 1
0 1 0 0 - 0 1 1 0 1 1 1 0
Multiplication:
1 0 1 0 0 0 0 1 1 1 0 1 0 1 0 1 0 1 0
ultiplic n ultiplier rti l pro uct ro uct
[13] [ ]
0 1 1 0 0 0 0 1 0 0
0 0 1
Division:
[4] Divisor 0 1 0 0 0 0 1 0 0 1 0 0 Partial 0 remainder 1 1 0 1 1 0 0 0 1 1 1 0 1 1 0 1 1 0 0 0 1 0 0 1
Quotient Dividend
[11] [45]
Remainder
Overflow:
- Consider the addition of two 8-bit signed numbers
0 + 0 1 1 1 1 0 0 0 1 1 1 0 0 1 1 1 0 0 0 1 1 0 0 0 0 0 0 1 [77] 0 [100] 1 [-79!?] 1 [-79!?]
Parity: number of 1
Even parity: Set the parity bit to 1 or 0 to make the number of 1 is even Odd parity: Set the parity bit to 1 or 0 to make the number of 1 is odd
0 1 0 0 1 1 0 1 0 1 0 0 1 1 0 1