0% found this document useful (0 votes)
15 views12 pages

Unit-6 Endsem Q - A

The document discusses various applications and features of the 8051 microcontroller, highlighting its use in automation, medical devices, energy management, and consumer electronics. It also details the architecture, memory, timers, input/output ports, and exception handling of microcontrollers. Additionally, it explains interrupt management in the 80386 processor and describes specific exceptions such as divide error, invalid opcode, and overflow.

Uploaded by

nayankokane62
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views12 pages

Unit-6 Endsem Q - A

The document discusses various applications and features of the 8051 microcontroller, highlighting its use in automation, medical devices, energy management, and consumer electronics. It also details the architecture, memory, timers, input/output ports, and exception handling of microcontrollers. Additionally, it explains interrupt management in the 80386 processor and describes specific exceptions such as divide error, invalid opcode, and overflow.

Uploaded by

nayankokane62
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

Q.List and elaborate on different applications of microcontrollers.

Ans-Application of 8051 Microcontroller –

●​ Automation: The 8051 microcontroller is widely used in


automotive applications.​
They are widely used in hybrid vehicles to control engine
options. In addition, functions such as cruise control and
anti-brake mechanism have been further enhanced thanks
to the integration of a microcontroller.
●​ Medical Devices: Convenient medical devices such as blood
glucose and blood pressure monitors contain
microcontrollers that display measurements.
●​ Energy management: Competent measurement systems
support energy consumption calculations in home and
industrial environments. These measuring systems are
prepared by integrating a microcontroller.
●​ Touch Screen: Many microcontroller vendors incorporate
touch functionality into their designs. Portable devices such
as media players, and gaming devices.
●​ Consumer Electronics Products – Any automatic home
appliance like Robots, Toys, Cameras, Washing machines,
Microwave Ovens, etc.
●​ Instrumentation and Process Control – Multimeter, Leakage
Current Tester, Oscilloscopes, Data Acquisition and Control,
etc.
●​ Fire Detection – Security alarm, Safety devices, etc.
●​ Medical Instruments – Medical machines like ECG,
Accu-Chek, etc.
●​ Communication technology – Telephone Sets, Cell Phones,
Answering Machines, etc.
●​ Multimedia Application – Mp3 Player, PDAs, etc.
●​ Office Machines – Fax machine, Printers, etc.
●​ Automobile – Auto-braking system, Speedometer, etc.
Q.Explain various features of the 8051 Microcontroller.
Ans-

Features of 8051 Microcontroller


An 8051 microcontroller comes bundled with the following features −

●​ 4KB bytes on-chip program memory (ROM)


●​ 128 bytes on-chip data memory (RAM)
●​ Four register banks
●​ 128 user defined software flags
●​ 8-bit bidirectional data bus
●​ 16-bit unidirectional address bus
●​ 32 general purpose registers each of 8-bit
●​ 16 bit Timers (usually 2, but may have more or less)
●​ Three internal and two external Interrupts
●​ Four 8-bit ports,(short model have two 8-bit ports)
●​ 16-bit program counter and data pointer
●​ 8051 may also have a number of special features such as UARTs, ADC,
Op-amp, etc.
Q.Differentiate between Microprocessor and Microcontroller.
Q.Draw and Explain the Architecture of a Typical Microcontroller.

Memory :
Memory spaces such as RAM, ROM, EPROM or EEPROM are there to
store data and programs.
For data storage, volatile memory RAM is used while for the program
and operating parameter storage ROM and other memory spaces are
used.
A microcontroller usually has a certain amount of RAM and ROM
(EEPROM, EPROM, etc) or flash memories for storing program source
codes.

Timers/counters :

This is the one of the useful function of a microcontroller.


A microcontroller may have more than one timer and counters.
The timers and counters provide all timing and counting functions
inside the microcontroller.
The major operations of this section are performed clock functions,
modulations, pulse generations, frequency measuring, making
oscillations, etc.
This also can be used for counting external pulses.
There is a watchdog timer. A watchdog timer is a portion of hardware
that can be used to automatically detect software
anomalies/malfunctions and reset the processor if any occur.

Parallel input/output ports :

Parallel input/output ports are mainly used to drive/interface various


devices such as LCD’S, LED’S, printers, memories, etc to a
microcontroller.

Serial ports :

Serial ports provide various serial interfaces between a microcontroller


and other peripherals like parallel ports.

Interrupt control :

The interrupt control used for providing interrupt (delay) for a working
program.

The interrupt may be external (activated by using interrupt pin) or


internal (by using interrupt instruction during programming)

Special functioning block :


Some microcontrollers used only for some special applications (e.g.
space systems and robotics) these controllers containing additional
ports to perform such special operations.
This considered as special functioning block

Analog to Digital Converter (ADC):

ADC converters are used for converting the analog signal to digital form.
The input signal in this converter should be in analog form (e.g. sensor
output) and the output from this unit is in digital form.
The digital output can be used for various digital applications (e.g.
measurement devices).

Digital to Analog Converter (DAC) :


DAC perform reversal operation of ADC conversion. DAC converts the
digital signal into analog format. ′ It usually used for controlling analog
devices like DC motors, various drives, etc.
Q. Explain the following exception conditions with an example: Faults,
Traps, and Aborts.

Exception Conditions
The following sections describe each of the possible exception conditions in detail.
Each description classifies the exception as a fault, trap, or abort.

This classification provides information needed by systems programmers for


restarting the procedure in which the exception occurred:

Faults
The CS and EIP values saved when a fault is reported point to the instruction
causing the fault.
Traps
The CS and EIP values stored when the trap is reported point to the instruction
dynamically after the instruction causing the trap.
If a trap is detected during an instruction that alters program flow, the reported
values of CS and EIP reflect the alteration of program flow.

For example, if a trap is detected in a JMP instruction, the CS and EIP values
pushed onto the stack point to the target of the JMP, not to the instruction after
the JMP.

Aborts
An abort is an exception that permits neither precise location of the instruction
causing the exception nor restart of the program that caused the exception.

Aborts are used to report severe errors, such as hardware errors and inconsistent
or illegal values in system tables.
Q.Differentiate and Explain the Interrupt gate and Trap gate
descriptor.

Difference between Call Gate, Interrupt Gate, and Trap Gate:

Call Gate Interrupt Gate Trap Gate

Called by the
Called by the
instruction CALL and Called by the instruction INT
instruction INT
JMP

Stored in GDL and LDT Stored in IDT Stored in IDT

Has a special feature A special feature is these gates


of transferring the all additionally prohibit future No special feature
parameters interrupt acceptance

Flexibility is more as
Flexibility is more as compared
Flexibility is very less compared to Interrupt
to trap gate
gate

More portability
Very less portable More portability options as
options as compared
options compared to trap gate
to Interrupt gate
Q.Explain the process of Enabling and Disabling Interrupts in 80386.
Ans- Enabling and Disabling Interrupts in 80386.

The processor services interrupts and exceptions only between the end
of one instruction and the beginning of the next. When the repeat
prefix is used to repeat a string instruction, interrupts and exceptions
may occur between repetitions. Thus, operations on long strings do not
delay interrupt response.

Certain conditions and flag settings cause the processor to inhibit


certain interrupts and exceptions at instruction boundaries.

NMI Masks Further NMIs

While an NMI handler is executing, the processor ignores further


interrupt signals at the NMI pin until the next IRET instruction is
executed.

IF Masks INTR

The IF (interrupt-enable flag) controls the acceptance of external


interrupts signalled via the INTR pin. When IF=0, INTR interrupts are
inhibited; when IF=1, INTR interrupts are enabled. As with the other flag
bits, the processor clears IF in response to a RESET signal. The
instructions CLI and STI alter the setting of IF.

CLI (Clear Interrupt-Enable Flag) and STI (Set Interrupt-Enable Flag)


explicitly alter IF (bit 9 in the flag register). These instructions may be
executed only if CPL <= IOPL. A protection exception occurs if they are
executed when CPL > IOPL.

The IF is also affected implicitly by the following operations:

●​ The instruction PUSHF stores all flags, including IF, in the stack
where they can be examined.
●​ Task switches and the instructions POPF and IRET load the flags
register; therefore, they can be used to modify IF.
●​ Interrupts through interrupt gates automatically reset IF, disabling
interrupts. (Interrupt gates are explained later in this chapter.)

RF Masks Debug Faults

The RF bit in EFLAGS controls the recognition of debug faults. This


permits debug faults to be raised for a given instruction at most once,
no matter how many times the instruction is restarted . (Refer
to Chapter 12 for more information on debugging.)

MOV or POP to SS Masks Some Interrupts and Exceptions

Software that needs to change stack segments often uses a pair of


instructions; for example:
MOV SS, AX
MOV ESP, StackTop
If an interrupt or exception is processed after SS has been changed but
before ESP has received the corresponding change, the two parts of the
stack pointer SS:ESP are inconsistent for the duration of the interrupt
handler or exception handler.
Q.Explain the following exceptions in brief.
i) Divide error
ii) Invalid Opcode
iii) Overflow

Interrupt 0 -- Divide Error


The divide-error fault occurs during a DIV or an IDIV instruction when
the divisor is zero.

Interrupt 6 -- Invalid Opcode


This fault occurs when an invalid opcode is detected by the execution
unit. (The exception is not detected until an attempt is made to execute
the invalid opcode; i.e., prefetching an invalid opcode does not cause
this exception.) No error code is pushed on the stack. The exception can
be handled within the same task.
This exception also occurs when the type of operand is invalid for the
given opcode. Examples include an intersegment JMP referencing a
register operand, or an LES instruction with a register source operand.
Interrupt 4 -- Overflow
This trap occurs when the processor encounters an INTO instruction and
the OF (overflow) flag is set. Since signed arithmetic and unsigned
arithmetic both use the same arithmetic instructions, the processor
cannot determine which is intended and therefore does not cause
overflow exceptions automatically. Instead it merely sets OF when the
results, if interpreted as signed numbers, would be out of range. When
doing arithmetic on signed operands, careful programmers and
compilers either test OF directly or use the INTO instruction.

You might also like