Students can Download 2nd PUC Electronics Chapter 11 Microcontrollers Questions and Answers, Notes Pdf, 2nd PUC Electronics Question Bank with Answers helps you to revise the complete Karnataka State Board Syllabus and score more marks in your examinations.
Karnataka 2nd PUC Electronics Question Bank Chapter 11 Microcontrollers
2nd PUC Electronics Microcontrollers One Mark Questions and Answers
What is a microcontroller?
Microcontroller is a small computer on a single IC consisting of a relatively simple CPU combined with support functions.
What is an Accumulator?
Accumulator is a device which stores a number and which on receipt of another number, adds the two and stores the sum. It can also sense the signal, clear and complement etc.
What is a Program Counter?
Program counter is a circuit, which holds the address of a byte in memory. It also specifies the address of the next instruction to be fetched and executed.
What is a Stack pointer?
Stack is the area of the memoiy (RAM) that is used in some instructions to store and retrieve data quickly. Stack pointer is used to hold an internal RAM address. When a program jumps to some branch the address of the next instruction is stored in Stack.
What is an interrupt circuit?
It is an electronic circuit, which breaks in the normal flow of system or routine and flow can be resumed from that point at a later time.
What is the need of clock circuit?
Clock circuit generates the internal clock pulses and all the internal operations are synchronised with this pulse.
How much is the ROM of microcontroller 8051?
Microcontroller 8051 has on chip ROM of 4k bytes.
How much is the RAM of microcontroller 8051?
Microcontroller 8051 has 128 bytes of RAM.
How many serial ports are there in microcontroller 8051?
Microcontroller 8051 has one serial port for communication.
How many interrupt sources are there in microcontroller 8051?
Microcontroller 8051 has six(6) interrupt sources.
What is an addressing mode?
Addressing modes specify the way in which the operands are accessed by the instruction.
What is an Operational code (op code)?
Operational code (op code) is the short form of expressing the instruction. It consists of mnemonic and operands.
What is the meaning of MOV A, R0?
The content of R0 is moved (copied) to register A (accumulator).
What is the meaning of MOV R5, A?
Copy the contents of register A(Accomulator) to Register 5.
What is the purpose of register addressing mode?
In register addressing mode data is moved between registers A, DPTR, Carry bit and registers R0-R7 are used as part of opcode mnemonics as source or destination.
What is the use of direct addressing mode?
In direct addressing mode 128 bytes of internal RAM and SFRs may be addressed directly using single byte address assigned to each RAM location and each SFR.
What is the direct address of working register R5 in register bank 2?
The direct address of register R5 in register bank 2 is ID.
Write the direct address of the Accumulator.
The direct address of accumulator register is OEO.
Write the mnemonic for the operation “Save content of A in RAM location 45H”.
The mnemonic for saving content of register A in location 45H is MOV 45H, A.
What is meaning of MOV A, @R1?
The meaning of MOV A, @R1 is to copy the contents of RAM location whose address is stored in R1 into accumulator A.
How do you write the mnemonic for the operation “copy the contents of RAM location whose address is stored in R0 into accumulator A” in an indirect addressing mode?
The mnemonic for copy the contents of RAM location whose address is stored in R0 into accumulator A is MOV A, @ R0.
Which sign is used as the mnemonic for immediate data?
The mnemonic for immediate data is hash (#).
What is meaning of MOV A, #22H?
The meaning of MOV A, #22H is to load value 22H into accumulator A.
Write the mnemonic for the operation “load the decimal value 66 into R3”.
The mnemonic for loading decimal value 66 into R3 is MOV R3, #66.
What is meaning of MOV DPTR, #1246H?
The meaning of MOV DPTR, #1246H is to load 16 bit number (1246H) immediately into register DPTR.
What does ‘jump’ instruction do?
The jump instruction permanently changes the contents of program counter either conditionally or unconditionally.
What does ‘call’ instruction do?
The call instruction temporarily changes the contents of program counter to allow another part of the program to run either conditionally or unconditionally.
What is the description of the mnemonic JNZ and ACALL?
JNZ is conditional jump instruction, here contents of PC changes only when the result of operation is non zero. ACALL allows to specify 11- bit address in the instruction and calling subroutine within 2k program memory block, starting from the address of the next instruction is possible.
Why is ROM called non volatile?
ROM is called non volatile because it does not depend on electrical power to store the numbers.
Why is RAM called volatile?
RAM is called volatile because it depends on electrical power to store the numbers, when power is OFF it loses its information.
What is a program?
Computer program is a sequence of operations that the computer is to perform.
Electrical Erasable Programmable Read Only Memory.
Static Random Access Memory.
Random Access Memory or Read write memory.
What is data address?
Address in memory that is used by the CPU to read or write is called data address.
What is a machine language?
Machine language is one in which information is available only in binary form.
Why is assembly language programming called low level programming?
Assembly language is low level programming because, it is machine dependant.
How many bits of binary data can a register A hold?
Register A can hold 8 bits of binary data.
How many bits of binary data can a register R hold temporarily?
Register R can hold 8 bit of binary data temporarily.
How many bits of address can a register PC hold?
Register PC can hold 16- bit of address number.
How much “PAL register PC” can hold code address?
Practice Assembly Language (PAL) Register can hold code address from 0000H to FFFFH (64K).
What are directives?
Assembly language instructions like ADD and MOV are statements called directives.
What does directive do?
Instructions tell the computer what to do, while directives give directions to the assembler.
What is a PIC microcontroller?
PIC microcontrollers are a family of microcontroller chips produced by microchip technology.
PIC is Peripheral Interface Controller.
How many accumulators are there in PIC microcontroller?
PIC microcontrollers has one accumulator.
Mention the maximum operating frequency of PIC16F877.
Maximum operating frequency of PIC16F877 is 20MHz.
How many times data can be written in PIC16F877?
In PIC16F877 microcontrollers 8k ROM memory in flash technology upto 105 times chip can be reprogrammed.
What is the working voltage range of PIC16F877?
PIC microcontrollers has working voltage range of 2.0V to 5.5V.
How much is the EEPROM memory?
EEPROM memory has 128 bytes.
What is the largest hex value that can be moved into an 8 bit register?
FFH is the largest value that can be moved into an 8 bit register.
2nd PUC Electronics Microcontrollers Two Marks Questions and Answers
Mention two differences between microprocessor and microcontroller.
|Most MPs have very less bit handling instructions||MCs have many bit handling instructions|
|MPs are intended for general purpose applications||MCs are for a specific application only|
What is an addressing mode? Why is it necessary?
The CPU can store data may be in registers, memory or in an external source. The ways by which these data source address are specified are called addressing modes. These are necessary because, the data can be accessed using any one of the modes.
Mention the different opcodes used in 8051.
MOV dest, sour; PUSH sour; POP dest; XCH dest, sour; ADD A, Rn etc are some of the opcodes used in 8051.
What are the different parts of memory of 8051?
The memory is divided into Internal RAM, Intrenal SFR, External RAM, internal and External ROM.
What is the main feature of MOV opcode? Give an example.
MOV opcode transfers data within the 8051 memory. MOV A, Rl; MOV R0,22H; MOV A, #54H; MOV R2,#40.
What is direct addressing? Explain.
In direct addressing mode all 128 bytes of internal RAM and SFRs may be addressed directly using single-byte address assigned to each RAM and SFR registers. MOV R0, 40H save the content of location 40H in R0 register. MOV B, Rl means copy the content of Rl to B.
What is an assembly language?
Assembly language fills the gap between low level machine language and high level language. It is written in instruction mnemonics.
Write ALP to represent “load 15H into R2”
Write the summary of unsigned multipliers
Multiplication operation use registers A and B as both source and destination addresses for the operation. MUL AB multiplies contents of A and B.
|Multiplication||Operand 1||Operand 2||Result|
|Byte x Byte||A||B||A = lower byte
B = High byte
Write the summary of division of unsigned numbers.
In the division of unsigned numbers 8051 supports byte over byte only. DIV AB, after division quotient is in A and remainder in B
Mention any two core features of PIC microcontroller.
Instruction set simplicity and programmable timer options.
Mention the main features of PIC microcontroller.
Operating frequency-0-20MHz, Power supply voltage 2.0 to 5.5V, power saving sleep mode, ADC, Watch dog timer, US ART module etc.
Mention the power supply and power consumption of PIC16F877.
Power suppy 2.0V to 5.5V and power consumption is 220mA (2.0V, 4MHz), llmA(2.0V. 32kHz), 50nA standby mode.
Briefly explain Data transfer instruction.
In data transfer instructions, data is moved(copied) from the source to destination. Most ofthe instructions in this group does not affect the PSW flags. MOV, PUSH, POP and XCH are the commonly used instructions in this group.
Briefly explain Arithmetic instruction.
Various arithmetic operations are carried out in this group of instructions. ADD, SUB, INC, DEC, MUL, DIV are the basic operations used.
Briefly explain Logical instructions.
Logical operations like AND, OR, XOR, complement, rotate are performed by these instructions. One of the operand is always register A.
Briefly explain programming instructions.
These are also called branching instructions. Conditional and unconditional branching instructions are used. JMP, AJMP, LJMP, CALL, ACALL are some examples.
What is the function of register A?
The register A is used to store the data temporarily and also to hold the result of arithmetic and logical instructions.
What is the function of register R?
Register R stores numbers temporarily.
What is the function of register PC?
It is a 16 bit register. Program instruction bytes are fetched from locations in memory that are addressed by PC. The PC is automatically incremented after every instruction byte is fetched and may also be altered by certain instructions.
Briefly explain about structure of Assembly Language.
Assembly language is a series of lines of assembly language instructions consisting of mnemonics, one or two operands. The four fields of assembly language are: label; mnemonic; operand; comment.
2nd PUC Electronics Microcontrollers Three Marks Questions and Answers
Mention the reason to write computer instructions in assembly language.
a. To speed computer operation. Programs written in assembly language can be stored compactly, and less time is spent fetching the code. High level languages are converted to code by utility programs named compilers. Because of general nature of high level languages, the compilers often produce excess or over head-code.
b. To reduce the size of the program. Assembly language requires no extra overhead code because the assembly language programmer is aware of extra needs of the program for any given situation.
c. To write programs for special situations. Often, particularly when dealing with machine control, no standard programs exist. Robot arms and antilock brakes, for instance, have no standard drivers. It is generally more efficient to write nonstandard driver programs in assembly code, also, when speed of response is critical, assembly-coded programs execute rapidly because of the exact fit of program code to task requirements.
d. To make economical. Small computer systems such as those that are embedded inside other machines, are often produced in large numbers. Reducing code size also reduces the cost of associated ROM chips.
e. To better understand how computer operates. In order to fully understand what is going on “under the hood” of the CPU, you should learn to program the CPU in assembly language.
Mention the different programs required ALPs converted into code memory bit charges,
The different programs required ALPs converted into code memory bit charges are:
a. An operating system program, which controls the operation of the personal computer used for the entire programming process. DOS is the operating system program used by many PCs. Windows is another.
b. A word processing, often called a text editor program. Programs in assembly language mnemonics are written using the text editor and stored on a disk as files that, normally, end in the extension asm.The asm files are intended for the use of another program called the assembler programs. Any text editor that can produce an ASCII (text) file is suitable for writing assembly language, asm files.
c. An assembler program, which takes the. asm assembly language program file and converts it to a machine code, obj file. The assembler converts the ASCII mnemonic text file into an. obj file that contains machine code instructions to the CPU, in binary form.
d. A testing program, which lets you run and test your program under controlled conditions. Testing your program is the most important step of the programming process. To be able to test program one must be able to execute each instruction and see the results. Utility programs that allow the user to test programs are called debuggers or simulators.
Briefly explain the different bits of binary memories of different registers.
Figure shows the different bits of binary memories of different registers.
What are the different fields present in ALP (PAL – Practice Assembly language)?
PAL contains three internal registers:
Register A: Performs all operations in the CPU Register B: Stores numbers temporarily
Register PC: Holds the address of the next instruction to be executed in code memory. Register A and R can hold 8 bits of binary data and register PC can hold a 16-bit address number. PAL is called an 8-bit computer because the working registers A and R can hold a 1-byte number. PAL register PC limits the number of code byte addresses to 64k because it can hold code address from address 0000H to address FFFFH.
Write ALP to represent load 15H into R2
MOV R2, #15h
Write the description of ALP ADDA, R2
The content of register R2 is added with the content of accumulator and the the sum is stored in the accumulator.
Mention the different types of addressing modes.
There are four addressing modes in 8051
- Immediate addressing mode
- Register addressing mode
- Direct addressing mode
- Indirect addressing mode
Briefly explain data transfer instructions.
These instructions move the content of one register to another one. Data can also be transferred to stack with the help of PUSH and POP instructions.
Briefly explain arithmetic instructions.
These instructions perform several basic arithmetic operations. After execution, the result is stored in the first operand. 8 bit addition, subtraction, multiplication, increment-decrement instructions can be performed in 8051.
ADDA, #8 bit data
ADDC A, Direct
ADDC A, Rn
ADDC A, @Ri
ADDC A, #8 bit data
SUBB A, Rn
SUBB A, Direct
SUBB A, @Ri
SUBB A, #8 bit data
MUL A B
Briefly explain logical instructions.
These instructions perform logical operations between two register contents on a bit by bit’ basis. After execution, the result is stored in the first operand.
ANL A, Rn
ANL A, Direct
ANL A, @Ri
ANL A, #8 bit data
ANL Direct, A
ANL Direct, #8 bit data
QRL A, Direct
ORL A, #8 bit data
ORL Direct, A
ORL Direct, #8 bit data
XRL A, Rn
XRL A, Direct
XRL A, @Ri
XRL A, #8 bit data
XRL Direct, A
XRL Direct, #8 bit data
Briefly explain programming instructions.
Assembly language programming consists of writing programs using instr uction mnemonics that are specified by the manufacturer. An instruction consists of a label, an instruction mnemonic, operands and operational comments. The instruction mnemonic specifies the action to be taken by the CPU and the operands specify the addresses of data used in the action. Labels are the names given to the address numbers in program code memory.
Mention three key features,
i. Max operating frequency
ii. Flash programming memory
iii. No. of pins of 16F877.
i. Operating speed:
- DC – 20 MHz oscillator/clock input
- DC – 200 ns instruction cycle
ii. Flash memory size:
- 100,000 write Flash endurance
- 1,000,000 write EEPROM endurance
- Flash/Data EEPROM retention: > 40 years
iii. No. of pins of 16F877: 28 pins
Mention the value of ROM, RAM and EEPROM of PIC16F877.
- 100,000 write Flash endurance
- 1,000,000 write EEPROM endurance
- Flash/Data EEPROM retention: > 40 years
2nd PUC Electronics Microcontrollers Five Marks Questions and Answers
Compare a microprocessor with a microcontroller
|μP have many operational codes for moving data and performing operations, but it has only few bit-handling instructions.||μC have one or two operational codes for moving data from and performing operations, but it has many bit- handling instructions.|
|μP is concerned with rapid movement of code and data from external addresses to the chip.||μC is concerned with rapid movement of bits within the chip.|
|μP need external digital parts (Hardware) to perform its tasks as computer.||μC can function as computer without addition of external digital parts.|
|μP are used in general purpose computing devices, supports wide range of applications with general hardware.||μC are used in embedded systems and supports only dedicated applications with customized hardware.|
Mention the features of 8051.
1. Eight-bit CPU with registers A (Accumulator) and B.
2. Sixteen-bit program counter (PC) and data pointer(DPTR)
3. Eight-bit program status word (PSW)
4. Eight-bit stack pointer(SP)
5. Internal ROM or EPROM (8751) of 4k bytes
6. Internal RAM of 128 bytes :
- Four register banks, each containing eight registers
- Sixteen bytes, which may be addressed at the bit level
- Eight bytes of general purpose registers
7. Four 8-bit I/O ports (P0-P3)
8. Two 16-bit timer/counter TO and T1
9. Full duplex serial data receiver/ transmitter : SBUF
10. Control register: TCON, TMOD,SCON,PCON,IP and IE
11. Two external and two internal interrupt sources
12. Oscillator and clock circuits
Draw the pin diagram of 8051
Briefly explain the core features of pic microcontroller(PIC 16F887)
Briefly explain the steps used in creating a program.
The steps to create a program are:
- Program editor is used to type in the program. The editor must be able to produce ASCII file for many assembler and will have the extension “.asm” or “src”.
- Assembler on receiving the file in “.asm” form converts the instructions into steps to creat a program machine code. Assembler will produce an object file “.obj” and list file “.1st”.
- Linker program links one or more object files and produce an absolute object file “.abs”.
- The “.abs” file is fed to object to hex converter(OH) and create an extension “.hex” and is ready to bum ROM.
Briefly explain signed and unsigned subprogram.
Subtraction of unsigned numbers: In 8051 SUBB is used to subtract two numbers by using unsigned representation by setting the bit CY=0 or CY=1. Whereas, in signed representation the sum or difference should not be greater than or less than -128 or 127.
Explain the core features of PIC16F887 microcontroller.
24/35 I/O pins with individual direction control:
- High current source/sink for direct LED drive
- Interrupt-on-Change pin
- Individually programmable weak pull-ups
- Ultra Low-Power Wake-up (ULPWU)
Analog Comparator module with:
- Two analog comparators
- Programmable on-chip voltage reference (CVREF) module (% of VDD)
- Fixed voltage reference (0.6V)
- Comparator inputs and outputs externally accessible
- SR Latch mode
- External Timer 1 Gate (count enable)
- 10-bit resolution and 11/14 channels
- Timer O: 8-bit timer/counter with 8-bit programmable prescaler
Enhanced Timer 1:
- 16-bit timer/counter with prescaler
- External Gate Input mode
- Dedicated low-power 32 kHz oscillator
Timer2: 8-bit timer/counter with 8-bit period register, prescaler and postscaler
Enhanced Capture, Compare, PWM+ module:
- 16-bit Capture, max. resolution 12.5 ns
- Compare, max. resolution 200 ns
- 10-bit PWM with 1, 2 or 4 output channels, programmable “dead time”, max. frequency 20 kHz
- PWM output steering control
Capture, Compare, PWM module:
- 16-bit Capture, max. resolution 12.5 ns
- 16-bit Compare, max. resolution 200 ns
- 10-bit PWM, max. frequency 20 kHz
Enhanced USART module:
- Supports RS-485, RS-232, and LIN 2.0
- Auto-Baud Detect
- Auto-Wake-Up on Start bit
- In-Circuit Serial Programming TM (ICSPTM) via two pins
- Master Synchronous Serial Port (MSSP) module – supporting 3-wire SPI (all 4 modes) and 12C™ Master and Slave Modes with I2C address mask
Briefly explain different addressing modes in the 8051.
There are four addressing modes in 8051.
- Immediate addressing mode: the data source is available immediately as a part of instruction itself. Example: MOV A, #8bit data
- Register addressing mode: the source and destination register names are parts of the opcode in instruction. Example: MOV A, R0
- Direct addressing mode: the source and/or destination may be the internal RAM locations. Example: MOV 90h, #50h
- Indirect addressing mode: the source or destination address may be indicated the content of index register. Example: MOV @Rl,#40h
Problems with Solutions
Write the instructions to move value 34H into register A and value 3FH into register B, then add them together.
MOV A, #34h
MOV 0F0, #3Fh
ADD A, 0F0
Write the instructions to add the values 16H and CDH, place the result in register R2.
MOV A, #16h
MOV R2, #CDh
ADD A, R2
LCALL 0003 h
Add 25H and 34H and put the result in register A.
MOV A, #25h
Write a program to add two 8-bit numbers and store it in R6. The numbers are 01EH and 01CH.
MOV A, #lEh
ADD A, #lCh
MOV R6, A
Subtract 21H from 30H and write the program and solve.
MOV A, #30h
SUBB A, #21h