Beruflich Dokumente
Kultur Dokumente
Question Bank
Part-A
INTRODUCTION TO PIC MICROCONTROLLER
1. What are the advantages of having RISC Processor?[APR/MAY 2017]
This architecture uses less chip space due to reduced instruction set. This makes
to place extra functions like floating point arithmetic units or memory
management units on the same chip.
The execution of instructions in RISC processors is high due to the use of many
registers for holding and passing the instructions as compared to CISC processors.
2. What is a PIC microcontroller?
The family of PIC16Cxx is a family of
Low-cost
High-performance
CMOS
Fully-static
8-bit microcontrollers
The family of PIC16Cxx microcontrollers employ an advanced RISC architecture.
The PIC16Cxx family uses Harvard architecture of separate instruction and data bus.
The PIC16Cxx family has 14-bit wide instruction bus and 8-bit data bus.
PIC16C6X,PIC16C7X,0IC16CXX
5. What are the special features of PIC16Cxx family?
There are four oscillator options in PIC16C6x family
(I) Single pin RC oscillator provides low cost solution
(II) LP Oscillator minimizes power consumption
(III) XT is the standard crystal
(IV) HS is the high speed crystal
The SLEEP (Power down) mode offers a power saving mode. The user can wake
up the chip from sleep through several internal and external interrupts and resets.
Watch Dog Timer: A reliable watch dof timer with its on-chip RC oscillator
provides protection against software lock up.
A UV erasable CERDIP packaged version is ideal for code development, while
the cost-effective One-Time Programmable(OTP) version is suitable for
production in any volume.
6. What are the applications of PIC microcontroller?
The PIC16C6x is used in applications such as
Automative and appliance control
Keyboards
Telecom sensors
7. What do you mean by Working Register(W) in PIC?
The working register is equivalent to the accumulator in other microcontrollers. The
working register is an eight bit register used for loading temporary variables in an ALU.
PIPELINING
CKCET/EEE/VII Sem/EE6008/MSD Prepared By: J.Jayashree AP/EEE Page: 3
14. What is meant by Harvard Architecture
Harvard architecture implies that separate buses are used to access program memory
and data memory
Harvard Architecture achieves an exceptionally fast execution speed with a given
clock rate.
15. What do you mean by two stage pipelining?
The overlapping of the execute cycle of one instruction with the fetch cycle of the
next instruction, leading to the execution of a new instruction every cycle is called two
stage pipelining.
ADDRESSING MODES
21. What are the addressing modes of PIC family[NOV/DEC 2016]
There are two types of addressing modes in PIC family:
Direct addressing mode
INSTRUCTION SET
24. What are the types of instructions in PIC family
Byte oriented instructions
Literal instructions
25. What are the single bit manipulation instructions
Bcf PORTB,0 ;clear bit 0 of port B
Bsf STATUS,C ; set the carry bit.
26. What are the clear instructions of PIC?
Clrw ; clear the working register W
Clrf TEMP1 ; clear temporary variable TEMP1
27. What are the mov instructions in PIC
Movlw 5 ;load 5 into W
Movwf TEMP1 ;Move W into TEMP1
Movwf TEMP1,F ; Incorrect syntax
Movf TEMP1,W ;Move TEMP1 into W
28. What are the swap instructions in PIC
Swapf TEMP1,F ;swap 4 nibbles of TEMP1
Swapf TEMP1,W ; move temp1 to W, swapping nibbles and leave TEMP1 unchaged
29. What are the increment/decrement instructions in PIC
incf TEMP1,F ; increment TEMP1
PART-B
1. Draw and explain the architecture of PIC16 microcontroller
[NOV/DEC 2016][MARKS 10]
Hint:
(i) Architectural Diagram
(ii) Registers
(iii) Instruction Set
(iv) Brown out Reset
(v) Arithmetic Logic Unit
(vi) Memory Organization
(vii) Register File Structure
(viii) Parallel I/O Ports
(ix) Timer Module
(x) CCP Module
[Ref. Page No:3-11]
2. With neat functional diagram explain the architecture of PIC16C7x microcontroller in
detail [APR/MAY 2017][MARKS 16]
Hint:
(i) Architectural Diagram
(ii) Registers, Instruction Set, Brown out Reset
(iii) Arithmetic Logic Unit, Memory Organization
(iv) Register File Structure, Parallel I/O Ports
(v) Timer Module, CCP Module
(vi) A/D Converter
[Ref. Page No:13-22]
CKCET/EEE/VII Sem/EE6008/MSD Prepared By: J.Jayashree AP/EEE Page: 7
3. Discuss in detail about the memory organization of PIC Microcontroller.
[APR/MAY 2017] [MARKS 8]
(or)
Explain about the Various Memory Organization of PIC Microcontroller
[NOV/DEC 2016][MARKS 16]
4. Explain about the pipelining structure of PIC family. [MARKS 8]
5. Explain about the various addressing modes in PIC, for accessing data memory
[APR/MAY 2017][MARKS
8]
6. Explain about the instruction set of microcontroller. [NOV/DEC 2016][MARKS 6]
7. Explain about simple operations in PIC? [8 Marks]
The interrupt control register (INTCON) records individual interrupt requests in flag
bits.
It also has an individual and Global Interrupt Enable bits.
Global Interrupt Enable bit, GIE(INTCON <7>) enables (set) all unmasked interrupts
and disables (clears) all interrupts.
2. Mention the interrupts available in PIC microcontroller?[NOV/DEC 2016]
The PIC16cxx family has upto 11 sources of interrupt. [Timers 0,1,2, Port B[RB0, RB1,
RB2], USART [TX,RX], Port B-Change Interrupt, ADC, CCP]
3. Write a assembly language program to activate Port –A using PIC[APR/MAY 2017]
MOVLW 0x0
MOVWF TRISA
CKCET/EEE/VII Sem/EE6008/MSD Prepared By: J.Jayashree AP/EEE Page: 8
4. What is the purpose of Global Interrupt enable(GIE)
Global Interrupt Enable bit, GIE(INTCON <7>) enables (set) all unmasked interrupts and
disables (clears) all interrupts.
5. How can we set or clear the GIE in INTCON programmatically.
The GIE bit in the INTCON register can be set and cleared under program control
with
Bsf INTCON, GIE ; Global Interrupt enable
And bcf INTCON, GIE ; Global Interrupt enable
GIE is automatically cleared when an interrupt occurs, suspending further interrupts
for the duration if interrupt service routine execution. GIE is automatically set when
Retfie ; return from interrupt service routine
Is executed at the end of interrupt service routine reenabling interrupts at the same
time that program control is returned to the mainline program.
6. What happens in PIC after the occurrence of interrupt
Whenever an interrupt occurs, the CPU automatically pushes the return address in the
Program counter into the stack and clears the GIE(Global Interrupt Enable) bit clearing
further interrupts.
The first job of ISR is set aside the content of W and of status. At the end of ISR, they
were returned to the same state, where the interrupt occurred before i.e., to the location of
main line code.
7. What do you mean by critical region in PIC.
A Critical region is a sequence of instructions in the mainline code, that must be protected
from an intervening interrupt or suffer a possible erroneous result.
8. What is the minimum and maximum clock frequency of PIC16Cxx[NOV/DEC
2016]
4 MHz, 16 MHz
9. How is PIC able to secure the data in working register when an interrupt is serviced
The PIC microcontroller has one pin RB0/INT , that serves as its primary external
interrupt input. The pin is 0 bit of PortB. Before initializing the interrupt circuitry, PortB
itself should be initialized.
The INTEDG bit provided in OPTION_REG register permits us to set up this input to
generate an interrupt on either a rising edge or falling edge.
T01F can cause an Interrupt and also if that Interrupt source can be enabled(T01E=1)
Timer0 can be assigned an eight bit prescaler that can divide counter inputs by
2,4,8,16……..256. Writing the TMR0 resets the prescaler assigned to it.
Timer0, or its prescaler(if employed by Timer0) can be connected to either of two
input sources.
(i) OSC/4, the PIC’s internal clock
(ii) RA4/TOCKI, the input connected to bit 4 of PORT A.
13. What is the purpose of timer1 in PIC.
Timer1 is a 16-bit counter
PART-B
1. Explain about PIC microcontroller interrupts. [Marks 16]
PART-A
CKCET/EEE/VII Sem/EE6008/MSD Prepared By: J.Jayashree AP/EEE Page: 13
1. What do you mean by I2C
I2C means Inter Integrated Circuit. I2C bus provides 2-wire bidirectional interface to a
variety of chips that can provide powerful adjunct(assistant) to PIC
I2C serves as a means for connecting master PIC to one or more slave PICs using only
two wires for the connection.
I2C contains three small eight pins and low cost ports.
A peripheral chip address and read/write bit designating the peripheral chip, is to
write successive bytes.
A peripheral internal register or address byte.
Data to be written into one or more successive addresses.
The I2C requires two open/drain I/O pins. These two pins are
SCL(Serial Clock)
SDA(Serial Data)
7. How are byte transfers done in I2C
I2C bus transfers consists of a number of byte transfers between
CKCET/EEE/VII Sem/EE6008/MSD Prepared By: J.Jayashree AP/EEE Page: 14
START condition and another START condition.
An analog multiplexers
A track and hold circuit for the signal on the selected input channel.
8-bit conversion
Baud rate =
LCD is incorporated with refreshing controller. Hence CPU is relieved of the task of
refreshing LCDs.
LCD is the ease of programming and graphics.
15. What is the significance of Register Select pin used in LCD interfacing.
There are two important registers used inside the LCD.
If RS=0, the instruction command code register is selected allowing the user to send
the command such as clear display, cursor at home and so on.
If RS=1, the data register is selected allowing the user to send data to be displayed on
the LCD.
16. What are the two important processes in the programming of keyboard interfacing
CKCET/EEE/VII Sem/EE6008/MSD Prepared By: J.Jayashree AP/EEE Page: 16
i. Key press detection
ii. Key identification.
17. What are the ways by which the PIC controller can perform key press detection:
There are two ways by which the PIC controller can perform key press detection:
i. Interrupt detection
ii. Scanning method
18. What is the principal of working of a transducer.
A physical quantity is converted to electrical (voltage, current) signals using a device called
transducer. Transducers are otherwise called as Sensors.
19. What are the steps to be taken for programming a A/D converter.
To program the A/D converter of PIC the following steps must be taken:
i. Turn on the ADC module of the PIC, since it is disabled upon power on reset to save
power.
ii. Make a pin for the selected ADC channel an input pin.
iii. Select reference voltage and A/C input channel
iv. Select the conversion speed. The registers ADCON1 and ADCON0 may be used.
v. Wait for the required acquisition time.
vi. Activate the start conversion bit of GO/DONE.
vii. Wait for the conversion to be completed by polling the end of conversion
(GO/DONE) bit.
After the GO/DONE bit has gone LOW, read the ADRESL and ADRESH registers to get the
digital input data high.
20. What are the two methods for converting analog to digital signals
The two methods of creating DAC are
Binary weighted and
R/2R method.
21. What do you mean by signal conditioning in PIC.
Signal conditioning is widely used in the world of data acquisition. The most common
transducers produce an output in the form of voltage, current, charge, capacitance and
CKCET/EEE/VII Sem/EE6008/MSD Prepared By: J.Jayashree AP/EEE Page: 17
resistance. The signals are needed to be converted into voltage in order to send an input to A-
D converter. This conversion is commonly called as Signal conditioning. Signal conditioning
may be current to voltage conversion or signal amplification.
22. How is the temperature sensor interfaced with PIC microcontroller[APR/MAY
2017]
PART – B
1. Explain about I2C. [Marks 16]
2. Explain about I2C bus subroutines [Marks 8]
3. Explain about Serial EEPROM [Marks 16]
4. Explain about the in-built Analog to digital converter in PIC. [Marks 16]
5. Explain the features of UART peripheral in PIC. [Marks 16]
6. Explain about LCD interfacing [Marks 16]
7. Explain in detail about interfacing of PIC with keyboard interface. [Marks 16]
8. Explain about the interfacing of analog to digital converter with PIC [Marks 16]
9. Explain about the interfacing of digital to analog converter with PIC. [Marks 8]
10. Explain about the interfacing of sensors with PIC microcontrollers. [Marks 16]