PPT
PPT
PPT
Syllabus
4. Study of programmable peripheral controllers : Timer/counter device Intel 8253; keyboard and display controller Intel 8279. 5. Serial communication : Synchronous and asynchronous communication. Study of the Western Digital 8250 communication controller. Principle of operation of modems. The EIA RS-232C serial interface standard. 6. Special purpose and 16 bit microcotrollers 7. Microcontroller applications : Interfacing of input/output devices, keyboard, switches, seven segment dispaly, LCD display. Design of microcontroller based systems for industrial applications, Temperature scanner and weight measurement systems. Embeded Systems, its hardware and software requirements.
REFERENCE BOOKS:
1. R.S. Gaonkar Microprocessor Architecture, Programming and Applications with 8085A Penram International 2. Muhammad Ali Mazidi Janice Gillispie Mazidi The 8051 Microcontroller and Embedded systems Prentice Hall of India 3. Kenneth J. Ayala The 8051 Microcontroller Architecture, Programming & Applications Penram International 4. V Udayashankara & M S Mallikarjunaswamy 8051 Microcontroller Hardware, software and applications
Marks Distribution
Marks distribution 70 + 20 + 10 = 100 (theory) 15 (10- Evaluation + 5 - attendance) + 20 (Performance) + 15(Viva) = 50 (Practical) Seminar Presentation (In Performance) -> 5 Class work Notebook(In Evaluation)->3 Theory Assignments(In Evaluation) -> 2 Quizzes(In Viva)->5
Brief Discussion
What is Computer?
CPU -> CU + ALU + registers Memory -> RAM (2 TYPES)/ ROM(4 TYPES) I/P AND O/P DEVICES
What is Microprocessor?
Cont.
1960s CPU designed with logic gates LSI Large Scale Integration SSI to LSI called Microprocessor Microcomputer Intel 4 bit microprocessor 4004 in 1971 8 bit microprocessor 8080 8-bit 8085 (8 bit data bus + 16 bit address bus) 16-bit 8086 (16 bit data bus + 20 bit address bus) 16 bit processors 8088,80186,80188, 80286 32 bit processors 80386 , 80486, 80586 (P)
Microprocessors:
General-purpose microprocessor
CPU for Computers No RAM, ROM, I/O on CPU chip itself ExampleIntels x86, Motorolas 680x0
Many chips on mothers board
Data Bus
RAM
ROM
I/O Port
Timer
What is Microcontroller?
LSI to VLSI called Microcontroller To build Microprocessor, memory and I/O devices on a single chip Components Microprocessor A/D Converter D/A Converter Parallel I/O Interface Serial I/O Interface Timers and Counters
Microcontroller :
A smaller computer On-chip RAM, ROM, I/O ports... ExampleMotorolas 6811, Intels 8051, Zilogs Z8
CPU
RAM ROM
A single chip
I/O Port
Serial Timer COM Port Microcontroller
Cont.
Which is the first task faced when learning to use a new computer?
Internal hardware design (architecture) Type, number and size of registers Other circuitry Hardware and software of microcontroller
Choosing A Microcontroller
Computing needs
Speed, packaging, power consumption, RAM, ROM, I/O pins, timers, upgrade to high performance or low-power versions, cost
Availability
Dallas Semiconductor
www.dalsemi.com
8051 Family
Feature
ROM (on chip program space in bytes) RAM (bytes) Timers I/O pins Serial port Interrupt sources
8051
4K 128 2 32 1 6
8052 8031
8k 256 3 32 1 8 0k 128 2 32 1 6
Timer: : : Timer
Interrupt :
8051 Microcontroller
On-chip RAM
Timer 1 Timer 0
Counter Inputs
CPU
Serial Port
OSC
Bus Control
4 I/O Ports
P0 P1 P2 P3
TxD RxD
Address/Data
Features
8 bit CPU 16-bit program counter(PC) and data pointer (DPTR) 8-bit program status word(PSW) 8-bit stack pointer 4 Kbytes of on-chip program memory(ROM) 128 bytes of on-chip data random access memory(RAM)
64Kbytes of program memory address space 64Kbytes of data memory address space Two 16 bit timers/counters 16 bit address bus multiplexed with port 0 and port 2 32 bidirectional I/O lines can be either used as 8 bit ports On-chip clock oscillator Control Registers Serial data receiver/transmitter Interrupt sources
Architecture of 8051
Processor includes
Arithmetic and logic unit Instruction decoder Timing generation unit Accumulator B register Status register
Instruction register is not programmable It cannot be accessed through any instruction Control unit generates control signals necessary for communication between the processor and peripherals
CPU Registers
A Register(E0H)
8 bit Direct connection with ALU In multiplication- one of 8 bit operands stored in A and after operation it stores lower byte in A In division- holds 8 bit dividend & quotient is stored in A
B Register(F0H)
8 bit Used with multiply and divide operations In multiplication- after operation it stores higher byte in B In division- holds 8 bit divisor & reminder is stored in B
Registers
A B R0 R1 R2 R3 R4 R5 R6 Some 8051 16-bit Register PC PC DPTR DPH DPL
RS0-PSW.3 OV-PSW.2
-PPSW.0
Add numbers 56H and 95H AND show how CY,AC and P flags affected???
MOV A,#56H MOV A,#95H 56 -- 0101 0110 + 95 --- 1001 0101 ------------------------------------EBH -1110 1011 CY = 0 (No carry between D7) AC = 0 (No carry from D3 to D4) P = 0 (Accumulator has an even number of bits)
Second Exercise!
Show status of CY,AC and P flags after the addition of 9CH and 64H What is the size of flag register in the 8051? FIND C,AY,P FOR ----MOV A,#02H ADD A,#3DH 0000 0010 0011 1101 ------------- 00 11 11 11
Third Exercise!
Show the contents of PSW register after execution of following instrucitons: MOV A,#0BFH ADD A,#1BH BF 1011 1111 1B 0001 1011 --------------------DA 1101 1010
Cy=0,ac=1,f0=0,rs1=0,rs0=0,ov=0,not used=0, p=1
Answers: 1(CY) 1(AC) 0(P) 1001 1100 0110 0100 ------------0000 0000 Answers: contents of psw = 0100 0001= (65)10= (41)16
Stack Pointer(81H)
8 BIT Contains data item on the top of stack Incremented before data is stored Initialized to 07H
Data Pointer
DPTR (Data Pointer) consists of two 8 bit registers high byte (DPH) and low byte (DPL) 16 bit address To furnish address information for internal and external program memory and for external data memory
Program Counter
16 bit register Specifies the address of next instruction to be executed After reset PC will be set to 0000H 8051 fetches the instruction one byte at a time After increments, it increments PC by 1
MEMORY
4k bytes on chip ROM 128 bytes RAM Program memory is used to hold start up program
Data random access memory is divided into 4 parts: First 128 bytes : 00H TO 1FH (31) Register Banks 20H TO 2FH(47) Bit addressable RAM 30H TO 7FH (127) General purpose registers Next 128 bytes : 80H TO FFH (255) Special function registers
Register Banks
Lowest 32 bytes 4 banks each having 8 registers RS1 and RS0 (4TH BIT AND 3RD BIT) program status word select the bank Each bank contains R0 TO R7 Ex: add A,R2 adds the value contained in R2 to the accumulator RS1=0 and RS0=0 BANK 0 IS SELECTED R2 is which memory location? ADD A,02H
30-7F 20-2F
BANK 3 (R0-R7)
BANK 2 (R0-R7) BANK 1 (R0-R7) BANK 0 (R0-R7)
18-1F
10-17 08-0F 00-07
Write instructions to use the registers of bank 3 and load the same value 05H in reg. r0-r3
SETB PSW.4 SETB PSW.3 MOV R0,#05H MOV R1,#05H MOV R2,#05H MOV R3,#05H
Example: the following instructions enable register bank 3 and move the content of R7 (address 1FH) to the accumulator SETB RS1 SETB RS0 MOV A,R7