EE3404-MICROPROCESSOR AND MICROCONTROLLER
UNIT I INTRODUCTION TO 8085 ARCHITECTURE
PART A
1. What is microprocessor ? Give the power supply and clock frequency
A microprocessor is a multipurpose, programmable logic device binary instructions from a storage
device called memory accepts binary da and processes data according to those instructions and
provides result as o power supply of 8085 is +5 V and clock frequency in 3 MHz.
2. What are the functions of an accumulator ?
The accumulator is the register associated with the ALU open sometimes I/O operations. It is an
integral part of ALU. It holds one of processed by ALU. It also temporarily stores the result of the
operation per the ALU.
3. List the 16 - bit registers of 8085 microprocessor.
Stack pointer (SP) and Program counter (PC).
4 Mention the purpose of SID and SOD lines.
SID (Serial input data line) : It is an input line through which the microprocessor accepts serial data.
SOD (Serial output data line): It is an output line through which the microprocessor sends output
serial data.
5 What is the function of IO/M signal in the 8085 ?
It is a status signal. It is used to differentiate between memory locations and I/O operations. When this
signal is low it denotes the memory related operations. When this signal is
high it denotes an I/O operation.
6 What is the use of bi-directional buffers ?
It is used to increase the driving capacity of the data bus. The data bus of a microcomputer system is
bi-directional, so it requires a bi-directional buffer that allows the data to flow in both directions.
7 Explain the signals HOLD, READY and SID.
HOLD indicates that a peripheral such as DMA controller is requesting the use of address bus, data
bus and control bus. READY is used to delay the microprocessor read or write cycles until a slow
responding peripheral is ready to send or accept data. SID is used to accept serial data bit by bit.
8. What is the need for ALE signal in 8085 microprocessor ?
The ALE signal is used to demultiplex (separate) AD0 - AD7 lines to Ao - A7 (address lines) and D0 -
D7 (data lines). The separation of address lines and data lines is achieved by connecting a external
latch to AD0 - AD7 lines and enabling the latch when ALE signal is active.
9. To obtain a 320 ns clock, what should be the input clock frequency ? What is the frequency of
clock signal at CLK OUT ?
Ans. :
10.What is tri-state logic ?
Logic outputs have two normal states, LOW and HIGH, corresponding to logic values 0 and 1.
However, some outputs have a third electrical state that is not logic state at all, called the high-
impedance or floating state. In this state the output behaves as if it isn't even connected to the circuit,
except for a small leakage current that may flow into or out of the output pin. The circuit having such
three states is called tri-state logic.
11. What is the function of the Ready signal of 8085 ?
It is used by the microprocessor to sense whether a peripheral is ready or not for data transfer. If not,
the processor waits. It is thus used to synchronize slower peripherals to the microprocessor.
12. List the five interrupt pins available in 8085.
The five interrupt pins available in 8085 are : TRAP, RST 7.5, RST 6.5, RST 5.5, and INTR.
13. Specify the size of data, address, memory word and memory capacity of 8085 microprocessor.
Size of data bus = 8-bits Size of address bus = 16-bits
Size of memory word = 8-bits Memory capacity = 64 kbytes
14. List the special purpose registers of 8085
The special purpose registers of 8085 are: 1. A (Accumulator) 2. Flag register 3. Instruction register
4. program counter 5. Stack pointer.
15. List the signals provided for DMA operation by 8085 and explain their use.
HOLD : This signal indicates that another master is requesting for the use of address bus, data bus
and control bus.
HLDA : This active high signal is used to acknowledge HOLD request.
16. What are the content of PC and INTE flag after reset ?
After reset, PC is loaded with 0000H and INTE flag is cleared.
17. What is the need of bus drivers ?
Typically, the 8085 buses can source 400 ,µA and sink 2 mA of current, i.e. it can drive only one
TTL load. Therefore, it is necessary to increase driving capacity of the 8085 buses. Bus drivers,
buffers are used to increase the driving capacity of the buses.
18. What is the function of program counter ?
Program counter stores the address of the next instruction to be fetched. Thus it is used as pointer to
the instruction.
19. What is stack and what is the function of stack pointer ? |
The stack is a reserved area of the memory in the RAM where temporary information may be stored.
A 16-bit stack pointer is used to hold the address of the most recent stack entry.
20. What are the various flags used in 8085 ?
Various flags in 8085 are : S (Sign flag), Z (Zero flag), AC (Auxiliary carry flag), P (Parity flag), and
CY (Carry flag)
21.Differentiate between software and hardware interrupts.
The type of interrupts where microprocessor pins are used to receive interrupt requests, are called
hardware interrupts. In software interrupts, the cause of the interrupt is an execution of the instruction.
These are special instructions supported by the microprocessor. After execution of these instructions
microprocessor completes the execution of the instruction it is currently executing and transfers the
program control to the subroutine program.
22. Name the vectored and nonvectored interrupt of 8085 system.
Vectored interrupt of 8085 are : RSTO - RST7, TRAP, RS7.5, R6.5 and RST 5.5. The only non
vectored interrupt of 8085 system is INTR.
23. What is meant by level-triggered interrupt ? Which of the interrupts in 8085 are level triggered
?
A level triggered interrupt is an interrupt signalled by maintaining the interrupt line at a high or low
level. A device wishing to signal a level triggered interrupt drives the interrupt request line to its
active level (high or low), and then holds it at that level until it is recognized by microprocessor. In
8085 microprocessor, RST 5.5, RST 6.5, INTR and TRAP are level triggered interrupts. Note that
trap is both level as well as edge triggered interrupt.
24. What is meant by edge-triggered interrupt ? Which of the interrupts in 8085 are edge
triggered?
Ans. : An edge-triggered interrupt is an interrupt signalled by a level transition on the interrupt line,
either a falling edge (high to low) or a rising edge (low to high). A device, wishing to signal an
interrupt, drives a pulse onto the line and then releases the line to its inactive state. In 8085
microprocessor, RST 7.5 and trap are edge-triggerred interrupts.
25. What are the different machine cycles in 8085 microprocessor ?
Ans. : The different machine cycles in 8085 microprocessor are :
1. Opcode fetch
2. Memory read
3. Memory write
4. I/O read
5. I/O write
6. Interrupt acknowledge
7. Bus idle
26. List out the machine cycles for executing the instruction MVI A, 34 H.
AU : Dec.-16
Ans. : Opcode fetch and memory read.
PART B
1. with neat block diagram, explain the various functional building blocks of 8085 microprocessor.
2. With pin diagram explain 8085 microprocessor.
3. What is meant by memory interfacing? Explain with an example.
4. Describe the data transfer concepts in 8085 microprocessor.
5. Draw the timing diagram for I/O read and write machine cycles.
6. Describe the interrupts of 8085 and its types with service routine.
UNIT II-8085 INSTRUCTION SET AND PROGRAMMING
1.What is the use of addressing modes, mention the different types.
Ans. : The various formats of specifying the operands are called addressing modes, it is used to access
the operands or data. The different types are as follows :
• Immediate addressing
• Register addressing
• Direct addressing
• Indirect addressing
• Implicit addressing
2.What is meant by immediate addressing mode?
In an immediate addressing mode 8 or 16 bit data can be specified as a part of instruction. ‗I‘
indicatesthe immediate addressing mode. Eg; MVI A, 20 H
3.What is meant by register addressing mode?
The register addressing mode specifies the source operand, destination operand, or both to becontained
in an 8085 registers. This results in faster execution, since it is not necessary to accessmemory
locations for operand. Eg : MOV A, B
4.What is meant by direct addressing mode?
The direct addressing mode specifies the 16 bit address of the operand within the instruction itself.The
2nd and 3rd bytes of the instruction contain this 16 bit address.Eg: LDA 2050 H .
5. What is the significance of 'XCHG' and 'SPHL' instructions ?
Ans. : XCHG : This instruction exchanges the contents of the register H with that of D and of L with
that of E.
SPHL : This instruction copies the contents of HL register pair into the stack pointer. The contents of H
register are copied to higher order byte of stack pointer and contents of L register are copied to the
lower byte of stack pointer. This allows indirect way of initializing stack pointer.
6. Differentiate cascade stack and memory stack.
Ans. : In a cascaded stack, CPU registers are used as a stack. In memory stack, the part of memory is
used for stack.
7. What is the function of SIM instruction in 8085 ?
Ans. : The SIM instruction masks the interrupts as desired. It also sends out serial data through the SOD
pin.
8. Write the operation carried out when 8085 executes RSTO instruction.
Ans. : When 8085 executes RSTO instruction, the program control is transferred to memory address
0000H. Before transfer of program control RSTO instruction saves the current program counter
contents on the stack and decrements stack pointer by 2.
9. Write the difference between opcode and operand.
Ans. : Opcode indicates the operation to be performed and operand is a data on which the operation is
performed.
10. Write the stack related instructions in 8085 microprocessor.
Ans. : The stack related instructions in 8085 microprocessor are :
1. PUSH rp 2. PUSH PSW 3. POP rp
4. POP PSW 5. SPHL 6. XTHL
11. Write the machine control instructions of 8085 microprocessor.
Ans. : Machine control instructions of 8085 microprocessor are
1. EI
2. DI
3. NOP
4. HLT
5. SIM
6. RIM
12.Mention the instructions used for data transfer with I/O ports.
Ans. : The instructions used for data transfer with I/O ports are :
1. IN addr 2. OUT addr
13. Differentiate CALL instruction from JUMP instruction.
14. What do you understand by the term 'program status word' and state how it can be read ?
Program status word is the flag register of microprocessor. In 8085 microprocessor the program status
word can be read as follows :
PUSH PSW
POP rP
Now contents of PSW are available in lower byte of specified register pair.
15. What is the value of register A after each of the following instructions ?
MOV A, # 26H,
RR A
RR A
RR A
RR A
SWAP A
Ans : A 26H
16.Write a program to load the accumulator with the value 82H and c the accumulator 700 times.
MVI B, 0AH ; Initialize outer counter =10
START : MVI C, 46H ; Initialize inner counter = 70
MVI A, 82H ; Load accumulator with 82H
BACK : CMA ; Complement accumulator
DCR C ; Decrement lower byte of counter
JNZ BACK ; if not 0, repeat
DCR B ; Decrement higher byte of counter
JNZ START ; if not 0, repeat
17.State the advantages of subroutine.
Ans. : The advantages of subroutine are :
1. Subroutines make programs shorter as well as easier to read and understand, because they break
program code into smaller sections.
2. You can test subroutines separately, rather than having to test the whole program. This makes
programs easier to debug.
3. Writing subroutines allow to distribute various tasks in the program amongst different programmers.
4. You can use a subroutine many times in a program; if you wanted to repeat the same set of instructions
several times in a program.
5. If something needs to be changed in a subroutine, it only needs to be changed once, within the
subroutine code. This change will then take effect wherever in the program the subroutine is used.
6. Data that is passed to a subroutine can be customised, so a subroutine can perform the same action on
different data.
7. You can add subroutines to a library so that you can use them in other programs.
18.Mention the similarity and difference between compare and Subtract instructions (M/J
COMPARE: This instruction compares the given numbers by subtracting it and gives the result if the
number is greater than, lesser than or equal to the status of sign and carry flag will be affected.
SUBTRACT: This instruction subtracts the two given numbers and the flag registers will not be
affected.
19.What is the use of branching instructions? Give examples. M/J2012
These instructions allow the processor to change the sequence of the program either conditionally or
unconditionally or under certain test conditions. These include branch instructions, subroutine call
and return instructions.
20 .What is the function of stack? M/J 2013
Stack is s portion of Read /Write memory location set aside by the user for the purpose of storing the
information temporarily. When the information is written on the stack the operation is PUSH and
when the information is read from the stack it is POP. The type of operation performed in stack is
LIFO( last in first out)
PART-B
1. Explain the types of addressing modes in 8085 with suitable example.
2. Explain the types of instruction in 8085 with example.
3. Explain the data transfer instructions with examples.
4. Explain the concept of loop structure with counting and indexing.
5. Explain the following 1. Lookup table 2. Stack
6. Describe about subroutine and instruction used for it.
UNIT III INTERFACING BASICS AND ICS
PART-A
1. What is programmable peripheral device?
If the function performed by the peripheral device can be altered or changed
by a program instruction then the peripheral device is called programmable device.
It have control register. The device can be programmed by sending control word in
the prescribed format to the control register.
2. What are the different ways to end the interrupt execution in 8259 PIC? (A/M‟11)
AEOI (Automatic End of Interrupt) mode the ISR bit is reset at the end of the
second INTA pulse. Otherwise, the ISR bit remains set until the issue of an appropriate
EOI command at the end of the interrupt subroutine.
3. What is the function of Scan section in 8279 programmable keyboard/Display
controller?(A/M‟11)
Scan section which has two modes (i) Encoded Mode (ii) Decoded Mode Encoded
Mode: In this mode, Scan counter provides a binary count from 0000 to 1111 the
four scan lines (SC3 – SC0) with active high outputs.
Decoded Mode: The internal decoder decodes the least significant 2 bits of binary
count and provides four possible combinations on the scan lines
(SC3- SC0) : 1110,1101,1011 and 0111.
4. State the use of ISR and PR registers in 8259 PIC. (N/D‟11)
ISR- Interrupt service Register Stores all the levels that are currently being
serviced.
PR– Priority Resolver determines the priorities of the bits set in the IRR
(Interrupt Request register). The bit corresponding to the highest priority interrupt
input is set in the ISR during the INTA input.
5. What are the features of INTEL 8259?(NOV 2013,MAY 2014)
1. It manages 8 interrupt request.
2. The interrupt vector addresses are programmable.
3. The priorities of interrupts are programmable.
4. The interrupt can be masked or unmasked individually.
6. How data is transmitted in asynchronous serial communication? M/J „14
Data is transmitted by setting transmission enable bit in the command
instruction. When transmitter is enabled and CTS =0 the transmitter is ready to
transfer data on Tx D line. The data bits is framed with one start bit and stop bits and
then transmitted.
7. What are the applications of D/A converter interfacing with 8255? M/J „12
Generating square, triangular and sine waveform, used in automatic process
control
8. What is keyboard interfacing? M/J 12
Keyboard interfacing is interfacing an input device. Push button switches are
used.in simplekeyboard interface one input line is required to interface one key and
this number will increasewith number of keys. It is in the form of matrix with rows
and columns and at the intersection aswitch is present.
9. What is the need for 8259 PIC?
It is necessary to solve multiple interrupt requests (more than five) we use an
external device called a PIC. It is possible to increase the interrupt handling capacity
of the microprocessor. When executing an interrupt an ISR can be serviced.
10. What are the basic modes of 8255? N/D 2013
BSR mode
I/O mode which is operated in mode 0, mode 1 and mode 2
11. What are the operating modes of IC 8253 / 8254 Timer? MAY 2017
There are 6 operating modes in IC 8254 Timer they are
Mode 0: Interrupt on Terminal Count
Mode 1: Hardware – Triggered one shot
Mode 2 – Rate Generator
Mode 3 – Square wave generator
Mode 4 – Software triggered strobe
Mode 5- Hardware triggered strobe
12. What is key de bouncing?
The push button keys when pressed, bounces a few times, closing and opening
the contact before providing a steady reading. The reading taken during the bouncing
period may be wrong. Therefore, microprocessor must wait until the key reach to a
steady state known as key debounce.
13. What is the difference between A/D and D/A converters?
Digital-to-analog is used to get a proportional analog voltage or current for the
digital data given out by the microprocessor. An ADC converts the input analog
voltage levels to the corresponding discrete digital signals.
14. Define the following terms for D/A converters.
Resolution: Resolution of a converter determines the degree of accuracy in
conversion. It is equal to 1/2n.
Accuracy: Accuracy is the degree to which information on a map or in a
digital data base matches true or accepted values. Accuracy is an issue pertaining to
the quality of data and the number of errors contained in a dataset or map.
Monotonicity : If a clock has monotonicity, then each successive time reading
from that clock will yield a time further in the future than the previous reading.
Conversion time: The time required by an analog to digital converter to fully
convert and analog input sample.
15. What is meant by Baud rate?
The rate at which the serial data is being transferred is called Baud rate.
16. What is meant by doubling the baud rate in the 8051?
We can double the baud rate in 8051 using two ways By
doubling the crystal frequency.
By making SMOD bit in the PCON register from 0 to 1.
17. What is meant by Handshake signals in 8255 PPI?
The MPU and peripherals operates at different speed; signals are exchanged
prior to data transferbetween the fast responding MPU and slow responding
peripherals such as printer and dataconverters. These signals are called Handshake
signals.
18. How does a serial communication classified?
The serial communication is classified according to the direction and data
flow as Simplex transmission- data transmitted in only one direction,
eg – transmission from a microcomputer to a printer.
Duplex Transmission – data flows in both direction.
If data gets transmitted one way at a time called as half duplex and if
data gets transmitted in both directions called as full duplex.
Eg. transmission between two computers, between a computer and a
terminal.
19. What are the types of priority modes in 8259 PIC?
Fully Nested Mode, Automatic rotation mode, specific rotation mode and end of
Interrupt.
20. What is meant by two key lockout and N key roll over in 8279?
The keys are automatically de bounced and the keyboard can operate in two
modes:
Two key Lock out – In this mode if two keys are pressed almost simultaneously,
only thefirst key is recognized.
N key roll over- In this mode simultaneous keys are recognized and their codes are
storedin the internal buffer; it can also be set up so that no key is recognized until one
key remainspressed.
21. How data is transmitted in asynchronous serial communication? (MAY 2014)
1.Start signal is sent prior to each byte, character or code word and a stop signal is
sent after each code word
2.The start signal serves to prepare the receiving mechanism for the reception and
registration of a symbol
3.The stop signal serves to bring the receiving mechanism to rest in preparation for
the reception of the next symbol.
4.Used to transfer one character at a time.
5.Speed is less
6.Transmitter & receiver can use separate clock pulse.
PART-B
1. Explain the interfacing concept of analog to digital conversion with 8085 microprocessor.
2. Explain the interfacing concept of digital to analog conversion with 8085 microprocessor.
3. With necessary diagram, explain the different modes of operation of 8254, in detail.
4. With a neat diagram, explain the internal architecture of keyboard and display controller IC-8279.
5. With a neat diagram, explain the internal architecture of 8251 USART.
6. Explain the working of 8259 with a neat block diagram.
7. Draw the functional diagram of 8255 and explain its control word, modes of operation.
UNIT IV INTRODUCTION TO 8051 MICROCONTROLLER
PART-A
1. What is meant by micro controller?
A device which contains the microprocessor with integrated
peripherals like memory, serial ports, parallel ports, timer/counter, interrupt
controller, data acquisition interfaces like ADC, DAC is called micro controller.
2. List the features of 8051 micro controllers? [( MAY 2011,2015),NOV (2013)]
Single supply +5v operation using HMOS technology.
4096 bytes program memory on-chip.
128 data memory on chip.
4 register banks
2 multiple modes, 16 bit timer/counter
Extensive Boolean processing capabilities.
64KB external RAM size.
32 bi-directional I/O lines.
3. How many ports are bit addressable in 8051 microcontroller. (Nov/Dec-2012)
P0, P1, P2 & P3 (all the four ports are bit addressable)
4. Give the details of PSW register in 8051. ( April/may -2010, May/June -
2012,May/June - 2014)
5. List the alternative functions assigned to Port 3 pins of 8051
microcontroller.(April/may - 2011)
The alternative functions of PORT 3 pins are:
P 3.0 (RXD) Serial data Input
P 3.1 (TXD) Serial data Output
P 3.2 (INT0) External Interrupt 0
P 3.3 (INT1) External Interrupt 1
P 3.4 (T0) External timer 0 Input
P 3.5 (T1) External timer 1 Input
P 3.6 (WR) External memory write pulse
P 3.7 (RD) External memory read pulse
6. Mention the size of DPTR in 8051 microcontroller. (April/may -2011)
The Data Pointer (DPTR) is a 16 bit data Register and Stack pointer (SP) is
8 bit Register.
7. What are the addressing modes of 8051? (May/June -2013, Nov/Dec-2011,2014)
The addressing modes of 8051 are:
Immediate.
Register.
Register indirect.
Direct.
Indexed.
8. What is the function of R register in 8051? (May/June -2013) may 2016
The 8051 uses 8 "R" registers which are used in many of its
instructions. These "R"registers are numbered from 0 through 7 (R0, R1, R2,
R3, R4, R5, R6, and R7). These registers aregenerally used to assist in
manipulating values and moving data from one memory location toanother.
9. Mention the purpose of PSEN and EA in 8051 microcontroller. (May/June -2014)
PSEN:If external ROM is used for storing program then a logic zero
(0) appears onit every time the microcontroller reads a byte from memory.
EA:By applying logic zero to this pin, P2 and P3 are used for data and
address transmissionwith no regard to whether there is internal memory or not.
It means that even there is aprogram written to the microcontroller, it will not
be executed. Instead, the program written toexternal ROM will be executed.
By applying logic one to the EA pin, the microcontroller will useboth
memories, first internal then external (if exists).
10. List the interrupt sources in 8051. (May/June -2014,NOV 2015, MAY 2016D)
There are 5 interrupts which occurs in 8051
3 Internal Interrupts provided by
Timer flag 0
Timer flag 1
Serial port interrupt (R1 /T1)
2 External Interrupt provided by
( PORT PIN 3.2)
( PORT PIN 3.3)
11. List the on-chip peripherals of 8051 microcontroller. (Nov/Dec-2011)
Program memory
data memory
4 parallel ports
serial port
timers and
interrupt controller
12. Define machine cycle of 8051?
8051 machine cycle consists of 6 states, S1 through S7. One state is made
up of 2 clock pulses. Thus 12 clock period constitute one machine cycle.
Two clock periods in a state is termed as phase 1 and phase 2.
13. What are the special function of port 0 of 8051?(NOV 2013)
Port 0 is used as a multiplexed low order address/data bus during the external
memory access. When ALE is enabled, the address on port 0 pins are latched
and bus is ready to act as a data bus when ALE is low.
14. What are the flags supported by 8051 controller? (NOV 2013)
· Carry flag
· Auxiliary carry flag
· Over flow flag
· General purpose user flag
· Register bank select bit one
· Register bank select bit zero
· Parity flag
15. What is meant by Power-on- Reset in 8051 controller?
When RESET pin is activated, the 8051 jumps to address location
0000H. This is called as Power-on-Reset. Reset pin is considered as a sixth
interrupt source of 8051.
16. What are the significance of SFRs?( NOV 2010)
SFRs denotes Special function Registers of 8051 controller. All the
controller registers such as port latches, timer register, peripheral control
register, accumulator, PC and DPTR all are available in SFR region.
17. What are the different group of instructions supported by 8051?
· Data Transfer Group
· Arithmetic Group
· Logical Group
· Branching Group
· Bit manipulation Group
18. What is SCON?
SCON is the serial port control register , which contains not only the mode selection bits
(SM0 – SM2 ,REN), but also the 9th data bit for transmit and receive (TB8 and RB8) and
the
serial port interrupt bits (TI and RI).
SM0 – Serial port mode control bit 0
SM1 – Serial port mode control bit 1
SM2 – Serial port mode control bit 2
REN – Receiver enable control bit
TB8 – Transmit bit 8
RB8 – Receive bit 8
TI – Transmit Interrupt flag
RI – Receive interrupt flag
19 .What is PCON register?
PCON – Power Control Register As the name indicates, this register is used for
efficient power management of 8051 micro controller. Commonly referred to
as PCON register, this is a dedicated SFR for power management alone. From
the figure below it can be observed that there are 2 modes for this register :-Idle
mode and Power down mode. Setting bit 0 will move the micro controller to
Idle mode and Setting bit 1 will move the micro controller to Power down mode.
20.What is USART?
USART isUniversal Synchronous-Asynchronous ReceiverTransmitter. is a
microchip that facilitates communication through a computer's serial port using the RS-
232C protocol.
PART B
1 Describe the architecture of 8051 with neat diagram.
2 Explain the different operand addressing modes in 8051 microcontroller
with examples.
3 Briefly explain the methodology of interfacing and configuring an external memory
with 8051 microcontrollers.
4 Discuss in detail about timer mode and control operations of 8051 microcontrollers
with the relevant special function registers.
5 Explain the interrupt structure of 8051 microcontroller.
6 Describe about the interfacing stepper motor with 8051 controller.
7 Explain the keyboard and display interfacing with 8051 controller.
8 With neat sketch explain the temperature control system using 8051 controller.
9 Explain the pinouts of 8051 microcontroller.
UNIT V INTRODUCTION TO RISC BASED ARCHITECTURE
PART A
1. What is PIC microcontroller?
i)PIC is a Peripheral Interface Microcontroller which was developed in the year 1993
by the General Instruments Microcontrollers.
ii)t is controlled by software and programmed in such a way that it performs different
tasks and controls a generation line.
iii)PIC microcontrollers are used in different new applications such as smartphones,
audio accessories, and advanced medical devices.
2. Write a short note on PIC16C6X Microcontroller Core Features?
CPU (Central Processing Unit)
RAM (Random Access Memory)
ROM (Read-Only Memory)
Internal Oscillator (the main timer of the MCU)
I/O (Input/Output) Ports
Peripheral Controller Chips (other optional accessories and components).
3. Define watch dog timer (WDT)?
A watchdog timer (WDT) is a timer that monitors microcontroller (MCU)
programs to see if they are out of control or have stopped operating.
4. Addressing modes of the PIC microcontroller
The PIC microcontrollers support only TWO addressing modes .They are
(i)Direct Addressing Mode (ii) Indirect Addressing mode
5. Classify instruction set of the PIC microcontroller
All the instructions of the PIC microcontroller are classified into nearly 9 groups. They
are
given below with examples
(i) Arithmetic Operations
(ii) Logical Instructions
(iii)Increment/Decrement Instructions
(iv) Data Transfer instructions :
(v) Clear Instructions
(vi) Rotate Instructions
(vii) Branch Instructions
(viii) Miscellaneous
(ix) Bit manipulation.
6. What are the CPU REGISTERS
(i) Working Register-W (Similar to Accumulator)
(ii) Status Register
(iii)FSR – File Select Register (Indirect Data memory address pointer)
(iv) INDF
(v) Program Counter
7. Explain Pipelining with example?
Pipelining refers to a technique where the processor can fetch the next instruction to be
executed while the current instruction is still being processed, essentially allowing multiple
instructions to overlap during execution, thereby improving overall processing speed and
efficiency; it's like a manufacturing assembly line where different parts of a product are
worked on simultaneously.
8.What is Working Register?
Working Register is used by many instructions as the source of an operand. It also serves
as the destination for the result of instruction execution and it is similar to accumulator in
other cs and ps.
9. What is Status Register:
This is an 8-bit register which denotes the status of ALU after any arithmetic operation
and also RESET status and the bank select bits for the data memory.
C: Carry/borrow bit
DC: Digit carry/borrow bit
Z: Zero bit
NOT_PD : Reset Status bit (Power-down mode bit)
NOT_TO : Reset Status bit (tme- out bit)
RPO: Register bank Select
The bits 7 and 6 of Status Register are unused by 16c6x/7x. The ‗C‘ bit is set when two
8-bit operands are added together and a 9-bit result occurs. This 9-bit is placed in the
carry bit.
The DC or Digit carry bit indicates that a carry from the lower 4 bits occurred during an
8-bit addition.
Example: 0011 1000
0011 1000
0111 0000
Here DC=1 as a result of the carry from the bit 3 to the bit 4 position.
The Z or zero bits is affected by the execution of arithmetic or logic instructions.
9. What is FSR – (File Select Register):
It is the pointer used for indirect addressing. In the indirect addressing mode the 8-bit
register
file address is first written into FSR. It is a special purpose register that serves as an
address
pointer to any address throughout the entire register file.
10.What is the function of capture mode?
The Basic function of capture mode by CCP1 or CCP2 module is that the exact point of
time of occurrence of that input edge change can be detected. For this purpose, timer1
must be running in timer mode.
11.What are the different capture modes available in the capture module of PIC
microcontroller?
Three modules are there.
(i) CCP1
(ii) CCP2
(iii) CCP3
12.What is flash memory?
Erasure of the entire contents takes less than a second or one might say in a flash, hence
its name flash memory. Flash memory‘s contents are erased (or written to), the entire
device is erased.
13. Compare CISC and RISC.
14. What is TIMER 0 ?
The Timer0 module is a simple 8-bit overflow counter.
The clock source can be either the internal system clock or an external clock
When the clock source is an external clock, the Timer0 module can be selected to
increment on either the rising or falling edge.
The Timer0 module also has a programmable prescaler option.
This prescaler can be assigned to either the Timer0 module or the Watchdog Timer.
Bit PSA (OPTION) assigns the prescaler, and bits PS2:PS0 (OPTION) determine the
prescaler value.
TMR0 can increment at the following rates: 1:1
when the prescaler is assigned to Watchdog Timer, 1:2, 1:4, 1:8, 1:16, 1:32, 1:64,
1:128, and 1:256. Synchronization of the external clock occurs after the prescaler.
When the prescaler is used, the external clock frequency may be higher then the device‘s
frequency.
The maximum frequency is 50 MHz, given the high and low time requirements of the clock.
15.List the CPU REGISTERS ?
The CPU registers are used in the execution of the instruction of the PIC microcontroller.
The PIC PIC16F877 Microcontroller has the following registers.
1. Working Register-W (Similar to Accumulator)
2. Status Register
3. FSR – File Select Register (Indirect Data memory address pointer)
4.INDF
5.Program counter.
16.Indirect Addressing Mode
In the indirect addressing mode the 8-bit register file address is first written into a Special
Function Register(SFR) which acts as a pointer to any address location in the register file. A
subsequent direct access of INDF will actually access the register file using the content of
FSR as a pointer to the desired location of the operand.
17.The instruction set of PIC is divided into Three basic categories. They are
(a) Byte oriented Instructions
(b) Bit oriented Instructions
(c) Literal and Control Instructions
18.Bit Oriented Instruction
In bit oriented instructions, b represents a bit field designator which selects the number of the
bit affected by the operation and f represents the number of the file in which the bit is
located.
BCF f , b ; Bit clear f
BSF f, b ; Bit set f
BTFSC f , b ; Bit test f ,skip if set
19.What is bank switching?
Bank switching is a feature of PIC microcontrollers that allows the microcontroller to
access different registers and memory.
Bank switching is used to access multiple registers and memory.
It allows the microcontroller to use short instruction words to save space.
However, it requires extra instructions to access registers that are used
infrequently.
The internal RAM in the PIC 16F is arranged in banks.
Each bank contains 128 RAM registers.
The first 128 RAM locations are in bank 0, the next 128 RAM locations are in
bank 1, and so on.
20. What is Table processing: PIC 18F microcontrollers have a ROM area equal to
2MB,which is also known as program memory. This program memory is under the direct
control of program counter register. So, to fetch the data from this ROM we need a
special function register and hence this method is widely known as register indirect
addressing mode.This process of accessing the Code in the ROM is also called Table
processing.
PART – B
1. Explain the architecture of PIC16F877.
2. Describe about the memory organization in PIC microcontroller.
3. State and explain the different addressing modes of PIC controller.
4. Write detailed notes on instruction set of PIC16F877.
5. Write short nots on 1. Timers in PIC controller
6. IO ports in PIC controller
7. Explain about the interrupt programming in PIC16F877