8051 Microcontroller Interview Questions
Introduction Of 8051 Microcontroller Architecture?
In 1981, Intel Corporation launched an 8-bit microcontroller referred to as the 8051. The 8051 grew to become broadly well-liked after Intel allowed different producers to make and market any flavors of the 8051. They please with the situation that they continue to be code-compatible with the 8051. This has led to many, variations of the 8051 with totally different speeds and quantities of on-chip ROM marketed by greater than half a dozen producers. It is necessary to notice that though there are totally different flavors of the 8051 by way of pace and quantity of on-chip ROM, they’re all suitable with the unique 8051 so far as the directions are involved. This signifies that when you write your program for one, it’ll run on any of them whatever the producer.
Intel 8051 Follows Which Architecture?
Intel 8051 is Harvard Architecture.
What Is The Difference Between Harvard Architecture And Von Neumann Architecture?
The identify Harvard Architecture comes from the Harvard Mark. The most blatant attribute of the Harvard Architecture is that it has bodily separate indicators and storage for code and information reminiscence. It is feasible to entry program reminiscence and information reminiscence concurrently. Typically, code (or program) reminiscence is read-only and information reminiscence is read-write. Therefore, it’s unimaginable for program contents to be modified by this system itself.
The von Neumann Architecture is known as after the mathematician and early laptop scientist John von Neumann. Von Neumann machines have shared indicators and reminiscence for code and information. Thus, this system might be simply modified by itself since it’s saved in read-write reminiscence.
8051 Was Developed Using Which Technology?
Intel’s authentic MCS-51 household was developed utilizing NMOS expertise, however later variations, recognized by a letter C of their identify (e.g., 80C51) used CMOS expertise and devour much less energy than their NMOS predecessors. This made them extra appropriate for battery-powered units.
Why 8051 Is Called 8 Bit Microcontroller?
The Intel 8051 is an 8-bit microcontroller which signifies that most out there operations are restricted to eight bits.
What Is The Width Of Data Bus?
8-bit information bus.
What Is The Width Of Address Bus?
16-bit handle bus.
List Out The Features Of 8051 Microcontroller?
- 40 Pin IC.
- 128 bytes of RAM.
- 4K ROM.
- 2 Timers (Timer Zero and Timer 1).
- 32 Input/ Output pins.
- 1 serial port.
- 6 Interrupts (Including Reset).
What Location Code Memory Space And Data Memory Space Begins?
At location 0x00 for inside or exterior reminiscence.
How Much On Chip Ram Is Available?
128 bytes of RAM (from 0x00 to 0x7F) and can be utilized to retailer information.
List Out Addressing Modes In Mcs-51?
- Direct Addressing
- Register Addressing
- Register Indirect Addressing
- Implicit Addressing
- Immediate Addressing
- Index Addressing
How Much Total External Data Memory That Can Be Interfaced To The 8051?
64Ok information reminiscence
What Is Special Function Registers (sfr)?
The reminiscence addresses from 80H to 0FFH are referred to as SFR. These are 128 bytes registers specifically designed for interrupts and few different operations.
Give Example Of Bit Address And Byte Address?
Example: bit handle 87h –> byte handle 80h, bit #7
What Are The Types Of Interrupts In 8051?
- External interrupt 0 (IE0) has highest precedence amongst interrupts.
- Timer interrupt 0 (TF0).
- External interrupt 1 (IE1).
- Timer interrupt 1 (TF1) has lowest precedence amongst different interrupts.
- Serial port Interrupt.
What Are The Four Distinct Types Of Memory In 8051?
- Internal RAM
- Special operate registers
- Program reminiscence
- External information reminiscence
Tell The Addresses Which Are Bit Addressable?
The bit addressable reminiscence in 8051 is compose from 210 bits: bit handle house: 20H – 2FH bytes RAM = 00H – 7FH bits handle, SFR registers.
What Is Lst File?
This file can also be referred to as as listing file.
- It lists the opcodes, addresses and errors detected by the assembler.
- List file is produced solely when indicated by the person.
- It might be accessed by an editor and displayed on monitor display or printed.
- Programmer makes use of this file to search out the syntax errors and later repair them.
- DB is named as outline byte used as a directive within the assembler.
- It is used to outline the Eight bit information in binary, hexadecimal or decimal codecs.
- It is the one directive that can be utilized to outline ASCII strings bigger than two characters.
- DB can also be used to allocate reminiscence in byte sized chunks.
- The assembler all the time converts the numbers into hexadecimal.
What Is Equ?
- EQU is the equate assembler directive used to outline a relentless with out occupying a reminiscence location.
- It associates a relentless worth with information label.
- Whenever the label seems in this system, fixed worth is substituted for label.
- Advantage: The fixed worth occurring at varied positions in a program might be modified directly utilizing this directive.
- Syntax: label EQU fixed worth
How Are Labels Named In Assembly Language?
- Label identify must be distinctive and should comprise alphabetic letters in each uppercase and lowercase.
- 1st letter ought to all the time be an alphabetic letter.
- It also can use digits and particular characters?,.,@,_,$.
- Label shouldn’t be one of many reserved phrases in meeting language.
- These labels make this system a lot simpler to learn and preserve.
Are All The Bits Of Flag Register Used In 8051?
- The flag register additionally referred to as as this system standing phrase makes use of solely 6 bits.
- The two unused bits are person definable flags.
- Carry, auxiliary carry, parity and overflow flags are the conditional flags utilized in it.
- 1 is a person definable bit and PSW.5 can be utilized as normal function bit.
- Rest all flags point out some or the opposite situation of an arithmetic operation.
Which Bit Of The Flag Register Is Set When Output Overflows To The Sign Bit?
The 2nd little bit of the flag register is ready when output flows to the signal bit. This flag can also be referred to as because the overflow flag. Here the output of the signed quantity operation is simply too massive to be accommodated in 7 bits. For signed numbers the MSB is used to point the whether or not the quantity is optimistic or destructive. It is simply used to detect errors in signed quantity operations.
What Are Issues Related To Stack And Bank 1.?
- Bank 1 makes use of the identical RAM house because the stack.
- Stack pointer is incremented or decremented in response to the push or pop instruction.
- If the stack pointer is decremented it makes use of places 7, 6, 5… which belong to register financial institution 0.
- If a given program makes use of R1 then stack is offered new reminiscence location.
- The push instruction may additionally take stack to location Zero i.e.it’ll run out of house.
- It is a command used to leap if no carry happens after an arithmetic operation. It is named as soar if no carry (conditional soar instruction). Here the carry flag bit in PSW register is used to make choice. The processor appears on the carry flag to see whether it is raised or not.
- If carry flag is 0, CPU fetches directions from the handle of the label.
Can Port 0 Be Used As Input Output Port?
Yes, port Zero can be utilized as enter output port. Port Zero is an open drain in contrast to ports 2, 3, 4. To use it as enter or output the 10ok ohm pull-up resisters are linked to it externally. To make port Zero as enter port it should be programmed by writing 1 to all bits.
Which 2 Ports Combine To Form The 16 Bit Address For External Memory Access?
- PortZero and port2 collectively type the 16 bit handle for exterior reminiscence.
- PortZero makes use of pins 32 to 39 of 8051 to present the decrease handle bits(AD0-AD7)
- Port2 makes use of pins 21 to 28 of 8051 to present the upper handle bits(A8-A15)
- This 16 bit handle is used to entry exterior reminiscence if connected.
- When linked to exterior reminiscence they can’t be used as enter output ports.
Can Single Bit Of A Port Be Accessed In 8051?
Yes, 8051 has the potential of accessing solely single little bit of a port.
Here solely single bit is accessed and relaxation is unaltered.
SYNTAX: “SETB X. Y”.
Here X is the port quantity and y is the specified bit.
Example: SETB P1.2
Here the second little bit of port 1 is ready to 1.
Other Than Setb, Clr Are There Any Single Bit Instructions?
There are in whole 6 single-bit directions.
- CPL bit: complement the bit (bit= NOT bit).
- JB bit, goal: Jump to focus on if bit equal to 1.
- JNB bit, goal: Jump to focus on if bit is the same as 0.
- JCB bit, goal: Jump to focus on if bit is the same as 1 after which clear bit.