Presentation is loading. Please wait.

Presentation is loading. Please wait.

Unit – Microcontroller Tutorial Class - 2 ANITS College

Similar presentations


Presentation on theme: "Unit – Microcontroller Tutorial Class - 2 ANITS College"— Presentation transcript:

1 Unit – 1 8051 Microcontroller Tutorial Class - 2 ANITS College 30.11.2018

2 What is 8051 Microcontroller?

3 The Intel 8051 microcontroller is one of the most popular general purpose microcontrollers in use today. It is an 8-bit family of microcontroller developed by Intel in the year 1981. This microcontroller was also referred as “system on a chip” Because it has 128 bytes of RAM, 4Kbytes of ROM, 2 Timers, 1 Serial port, and four ports on a single chip.

4 Unlike microprocessors, microcontrollers make use of batteries because they have: a) high power dissipation b) low power consumption c) low voltage consumption d) low current consumption

5 Unlike microprocessors, microcontrollers make use of batteries because they have: Answer: b) low power consumption Explanation: Micro Controllers are made by using the concept of VLSI technology. So here, CMOS based logic gates are coupled together by this technique that consumes low power.

6 What is the most appropriate criterion for choosing the right microcontroller of our choice? a) speed b) availability c) ease with the product d) all of the mentioned

7 What is the most appropriate criterion for choosing the right microcontroller of our choice? Answer: d) all of the mentioned Explanation: For choosing the right microcontroller for our product we must consider its speed so that the instructions may be executed in the least possible time. It also depends on the availability so that the particular product may be available in our neighboring regions or market in our need. It also depends on the compatibility with the product so that the best results may be obtained.

8 What is the order decided by a processor or the CPU of a controller to execute an instruction? a) decode, fetch, execute b) execute, fetch, decode c) fetch, execute, decode d) fetch, decode, execute

9 What is the order decided by a processor or the CPU of a controller to execute an instruction? Answer: d) fetch, decode, execute Explanation: While any instruction is being executed, a microcontroller first fetches the instruction (captures its operand and operator). After capturing it converts these operands and operators into their corresponding hex codes. Hence after this, an instruction can be executed as now it is in the form of 0’s and 1’s (the format understood by a microcontroller).

10 How are the performance and the computer capability affected by increasing its internal bus width? a) it increases and turns better b) it decreases c) remains the same d) internal bus width doesn’t affect the performance in any way

11 How are the performance and the computer capability affected by increasing its internal bus width? Answer: a) it increases and turns better Explanation: As the bus width increases, the number of bits carried by bus at a time increases as a result of which the total performance and computer capability increases.

12 8051 series has how many 16 bit registers? a) 2 b) 3 c) 1 d) 0

13 8051 series has how many 16 bit registers? Answer: a) 2 Explanation: It has two 16 bit registers DPTR and PC.

14 When 8051 wakes up then 0x00 is loaded to which register? a) DPTR b) SP c) PC d) PSW

15 When 8051 wakes up then 0x00 is loaded to which register? Answer: c) PC Explanation: When a program wakes up, then 0x00 is loaded to the program counter register because at this place the first op code is burnt.

16 Auxiliary carry is set during which condition? a) When carry is generated from D3 to D4 b) When carry is generated from D7 c) When carry is generated from both D3 to D4 and D7 d) When carry is generated at either D3 to D4 or D7

17 Auxiliary carry is set during which condition? Answer: a) When carry is generated from D3 to D4 Explanation: When carry is generated from D3 to D4, it is set to 1, it is used in BCD arithmetic.

18 Which pin provides a reset option in 8051? a) Pin 1 b) Pin 8 c) Pin 11 d) Pin 9

19 Which pin provides a reset option in 8051? Answer: d) Pin 9 Explanation: Reset pin is utilized to set the micro controller 8051 to its primary values, whereas the micro controller is functioning or at the early beginning of application. The reset pin has to be set elevated for two machine rotations / cycles.

20 External Access is used to permit ____________ a) Peripherals b) Power supply c) ALE d) Memory interfacing

21 External Access is used to permit ____________ Answer: d) Memory interfacing Explanation: External Access input is employed to permit or prohibit outer memory interfacing. If there is no outer memory needed, this pin is dragged by linking it to Vcc.

22 How are the status of the carry, auxiliary carry and parity flag affected if the write instruction MOV A,#9C ADD A,#64H a) CY=0,AC=0,P=0 b) CY=1,AC=1,P=0 c) CY=0,AC=1,P=0 d) CY=1,AC=1,P=1.

23 How are the status of the carry, auxiliary carry and parity flag affected if the write instruction MOV A,#9C ADD A,#64H Answer: b) CY=1,AC=1,P=0 Explanation: On adding 9C and 64, a carry is generated from D3 and from the D7 bit so CY and AC are set to 1. In the result, the number of 1’s present are even so parity flag is set to zero.

24 What is an Interrupt service routine?

25 When Microcontroller is under sudden interrupt, it will call ISR (Interrupt service routine) The controller pushes the address of next instruction in the program sequence It takes the control to new interrupt memory address (ISR Program) After the interrupt, the control will transfer back to its previous address.

26 How are the bits of the register PSW affected if we select Bank2 of 8051? a) PSW.5=0 and PSW.4=1 b) PSW.2=0 and PSW.3=1 c) PSW.3=1 and PSW.4=1 d) PSW.3=0 and PSW.4=1

27 How are the bits of the register PSW affected if we select Bank2 of 8051? Answer: d) PSW.3=0 and PSW.4=1 Explanation: Bits of PSW register are CY, AC, F0, RS1, RS0, OV, -, P so for selecting bank 2 RS1=1 and RS0=0 which are fourth and third bit of the register respectively.

28 If we push data onto the stack then the stack pointer a) increases with every push b) decreases with every push c) increases & decreases with every push d) none of the mentioned

29 If we push data onto the stack then the stack pointer Answer: a) increases with every push Explanation: If we push elements onto the stack then the stack pointer increases with every push of element.

30 Find the machine cycle for (a) XTAL = 11.0592 MHz (b) XTAL = 16 MHz

31 Solution: (a) 11.0592 MHz / 12 = 921.6 kHz; machine cycle = 1 / 921.6 kHz = 1.085  s (b) 16 MHz / 12 = 1.333 MHz; machine cycle = 1 / 1.333 MHz = 0.75  s

32 How Much Total External Data Memory that can be interfaced To The 8051?

33 How Much Total External Data Memory that Can Be Interfaced To The 8051? Answer : 64K data memory

34 On power up, the 8051 uses which RAM locations for register R0- R7 a) 00-2F b) 00-07 c) 00-7F d) 00-0F

35 On power up, the 8051 uses which RAM locations for register R0- R7 Answer: b) 00-07 Explanation: On power up register bank 0 is selected which has memory address from 00H-07H.

36 How many bytes of bit addressable memory is present in 8051 based microcontrollers? a) 8 bytes b) 32 bytes c) 16 bytes d) 128 bytes

37 How many bytes of bit addressable memory is present in 8051 based microcontrollers? Answer: c) 16 bytes Explanation: 8051 microcontrollers have 16 bytes of bit addressable memory.

38 Microcontrollers are normally less expensive than Microprocessors True or False

39 Microcontrollers are normally less expensive than Microprocessors Answer: True Explanation: Microcontrollers are designed for specific application with limited performance. It is not general purpose.

40 A Microcontroller normally has which of the following devices on chip? a) RAM b) ROM c) I/O d) All of the above

41 A Microcontroller normally has which of the following devices on chip? Answer: d) All of the above Explanation:

42 What is the major difference between the 8051 and 8052 Microcontrollers? a) RAM b) ROM c) Timers d) Interrupt sources

43 What is the major difference between the 8051 and 8052 Microcontrollers? Answer: RAM and ROM Doubled, One Additional Timer, 2 – additional interrupts Explanation:

44 Write the instructions to move the value 34H into register A and value 3FH into register B, then add them together

45 Answer: MOV A, #34H MOV B, #2FH ADD A, B Explanation: Move Instruction: MOV Destination, Source Add instruction : ADD A, source

46 Precautions with in MOV instruction 1. Values can be loaded directly into any of registers A, B, or R0 – R7. However, to indicate that it is an immediate value, it must be preceded with a ‘#’ sign 2. Use a ‘0’ between # and alphabets (A to F) in case of hexadecimal numbers 3. If values 0 to F are moved to an 8 – bit register, the rest of the bits are assumed to be all ‘0s’ 4. Moving a value that is too large into a register will cause an error 5. Moving values between R0 – R7 is illegal.

47 Precautions with in ADD instruction 1. MOV A, #22H ADD A, #33H is legal 2. The source operand can be either a register or immediate data 3. The destination must always be register A 4. ADD R2, #32H is invalid

48 How are the performance and the computer capability affected by increasing its internal bus width? Answer: a) it increases and turns better Explanation: As the bus width increases, the number of bits carried by bus at a time increases as a result of which the total performance and computer capability increases.

49 What is the file extension that is loaded in a microcontroller for executing any instruction? a).doc b).c c).txt d).hex

50 What is the file extension that is loaded in a microcontroller for executing any instruction? Answer: d).hex Explanation: Microcontrollers are loaded with.hex extension as they understand the language of 0’s and 1’s only.


Download ppt "Unit – Microcontroller Tutorial Class - 2 ANITS College"

Similar presentations


Ads by Google