0% found this document useful (0 votes)
13 views

MC Module Questions With Key Answers

The document discusses differences between microcontrollers and microprocessors, Harvard and von Neumann architectures, CISC and RISC architectures, and interrupts. Microcontrollers integrate peripherals on a single chip while microprocessors require external components. Harvard architecture uses separate memory for instructions and data while von Neumann uses unified memory. RISC emphasizes simplicity and pipelining while CISC supports complex instructions. An interrupt is a request for the CPU to pause normal processing and attend to an event.

Uploaded by

rahulsda864
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views

MC Module Questions With Key Answers

The document discusses differences between microcontrollers and microprocessors, Harvard and von Neumann architectures, CISC and RISC architectures, and interrupts. Microcontrollers integrate peripherals on a single chip while microprocessors require external components. Harvard architecture uses separate memory for instructions and data while von Neumann uses unified memory. RISC emphasizes simplicity and pipelining while CISC supports complex instructions. An interrupt is a request for the CPU to pause normal processing and attend to an event.

Uploaded by

rahulsda864
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 15

MC module questions with key answers.

1. Difference between Microcontroller and MicroProcessor?


● Microprocessor consists only of a processing unit. Memory and peripherals
need to be interfaced externally.
● Microcontroller consists of all the peripherals, along with a processing unit
integrated into a single chip like uP+RAM+ROM+timers.
● uP is More Flexible, since you can change the externally connected
peripherals.
● uC is Less Flexible, since all are integrated on a single IC you cannot
change the peripherals .
● uP has More design complexity.
● uC has less design complexity.

Comparison Table

Aspect Microprocessor Microcontroller

Function Designed for Designed for specific and


general-purpose processing dedicated tasks in embedded
tasks. systems.

Component Consists primarily of the Integrates CPU, memory, I/O


s CPU; external components ports, timers, and sometimes
may be required (memory, peripherals on a single chip.
I/O devices).

Complexity More complex and powerful; Less complex; optimized for


capable of handling a wide efficiency in specific applications.
range of tasks. May sacrifice some
general-purpose computing
power.

Application Commonly used in devices Found in embedded systems such


s like desktop computers, as washing machines, microwave
laptops, servers, etc. ovens, automotive control
systems, medical devices, etc.
Versatility Versatile, suitable for a Specialized for control-oriented
broad spectrum of applications in embedded
computing tasks. systems.

Example Intel Core series, AMD ARM Cortex-M series, Atmel AVR,
Platforms Ryzen series. PIC.

2. Difference between Harvard and von Neumann architecture.


The von Neumann architecture and the Harvard architecture are two fundamental
approaches to organizing the structure of a computer system, specifically in terms of
how they handle memory and data. Here are the key differences between von Neumann
and Harvard architectures:

Von Neumann Architecture:


​ Memory Structure:
● Unified Memory: In von Neumann architecture, there is a single memory
space that is used for both data and program storage. Instructions and
data are stored together in the same memory module.
​ Data and Instruction Fetch:
● Single Bus System: Von Neumann architecture employs a single bus for
both data and instruction transfer. This means that data and instructions
share the same communication pathway.
​ Program and Data Access:
● Sequential Access: Program instructions and data are accessed
sequentially from memory. The CPU fetches an instruction, executes it,
and then fetches the next one in a linear fashion.
​ Flexibility:
● Easier Modification: Von Neumann architecture is flexible, allowing for
easy modification of the stored program. However, it may lead to some
performance bottlenecks due to the shared bus.
​ Examples:
● Traditional microprocessors, like early Intel and AMD CPUs, follow the von
Neumann architecture.

Harvard Architecture:
​ Memory Structure:
● Separate Memory Spaces: Harvard architecture maintains separate
memory spaces for instructions and data. There are distinct memory
modules for program storage (instructions) and data storage.
​ Data and Instruction Fetch:
● Multiple Buses: Harvard architecture typically employs separate buses for
data and instructions. This enables parallel access to both program
memory and data memory.
​ Program and Data Access:
● Simultaneous Access: The CPU can fetch an instruction and access data
at the same time, improving overall throughput. This simultaneous access
can enhance performance in certain scenarios.
​ Security:
● Isolation: Harvard architecture inherently provides a level of isolation
between program and data memory, which can enhance security.
​ Examples:
● Many microcontrollers and digital signal processors (DSPs) follow the
Harvard architecture. Examples include the Atmel AVR series and some
ARM Cortex-M microcontrollers.

Summary:
● Von Neumann Architecture: Uses a single memory space for both data and
instructions, sharing the same bus for communication. It provides flexibility but
may face bottlenecks in terms of simultaneous data and instruction access.
● Harvard Architecture: Maintains separate memory spaces for instructions and
data, often utilizing distinct buses for parallel access. This architecture allows for
simultaneous access to program and data memory, potentially improving
performance in certain scenarios.

The choice between von Neumann and Harvard architectures depends on the specific
requirements of the system. While von Neumann architecture is more flexible, Harvard
architecture can provide advantages in terms of parallelism and performance
optimization, particularly in embedded systems and specialized computing devices.

3.Difference between CISC and RISC


RISC (Reduced Instruction Set Computing) and CISC (Complex Instruction Set
Computing) are two different CPU (Central Processing Unit) design philosophies that
represent contrasting approaches to the architecture of a computer's instruction set.
Here are the key differences between RISC and CISC:

RISC (Reduced Instruction Set Computing):


​ Instruction Set:
● Simplicity: RISC architectures have a reduced and simplified instruction
set. Each instruction typically performs a single, simple operation.
● Fixed Length: Instructions are often of fixed length, making them easier to
decode and execute in a single clock cycle.
​ Pipeline Architecture:
● Pipeline Efficiency: RISC architectures often feature a deep pipeline,
allowing instructions to be processed in a series of stages. This can result
in higher instruction throughput.
​ Registers:
● Register Usage: RISC architectures typically have a larger number of
general-purpose registers. The idea is to minimize the need for memory
access by keeping more data in registers.
​ Memory Access:
● Load/Store Architecture: RISC architectures usually follow a load/store
architecture, meaning that arithmetic and logic operations only operate on
data in registers. Memory operations are performed using separate load
and store instructions.
​ Optimized for Compiler:
● Compiler Optimization: RISC architectures are designed with the
assumption that compilers can optimize code well. The goal is to have
simple, easily pipelined instructions that compilers can efficiently
schedule.
​ Examples:
● ARM, MIPS, PowerPC are examples of RISC architectures.

CISC (Complex Instruction Set Computing):


​ Instruction Set:
● Complexity: CISC architectures have a more extensive and complex
instruction set, with instructions that can perform multiple operations in a
single instruction.
​ Pipeline Architecture:
● Variable Length Instructions: Instructions in CISC architectures can vary in
length, which can complicate the pipeline design. Some instructions may
take multiple clock cycles to execute.
​ Registers:
● Limited Registers: CISC architectures typically have fewer general-purpose
registers compared to RISC. This means that more operations may involve
memory access.
​ Memory Access:
● Memory Operands: CISC architectures often allow operations to be
performed directly on memory, reducing the need for explicit load/store
instructions.
​ Optimized for Hardware:
● Hardware Optimization: CISC architectures are designed to handle
complex instructions directly in hardware, assuming that the hardware
itself can efficiently execute a wide range of instructions.
​ Examples:
● x86 (Intel and AMD processors) is a prominent example of a CISC
architecture.

Summary:
● RISC: Emphasizes simplicity, fixed-length instructions, a large number of
registers, and efficient compiler optimization.
● CISC: Emphasizes a richer, more complex instruction set, variable-length
instructions, and the ability to perform multiple operations in a single instruction.

Both architectures have their advantages and trade-offs. RISC architectures often excel
in terms of power efficiency and performance for specific workloads, while CISC
architectures may provide more functionality in a single instruction, potentially
simplifying programming but at the cost of increased complexity in hardware design.
The choice between RISC and CISC often depends on the specific design goals and
application requirements.

4.What is an Interrupt?
An interrupt is a communication process set up in a microprocessor or
microcontroller in which:
● An internal or external device requests the MPU to stop the processing
● The MPU acknowledges the request
● Attends to the request
● Goes back to processing where it was interrupted

5.What is an ISR

An ISR(Interrupt Service Routine) is an interrupt handler, a callback subroutine


(function)which is called when an interrupt is encountered.

6.Difference between RET and RETI?

Return from Subroutine (RET) :

● To return from a subroutine is to return execution of code to the point it was


before the subroutine was called.
Return from Interrupt (RETI):

● To return from interrupt is to return code execution to the point it was at


before the interrupt has occurred along with saving flags into flag register.

7.What is the return type of ISR (interrupt)?


ISR does not return anything. An ISR returns nothing because there is no
caller function in the code to read the returned values.

8. Types of interrupt

1. Software interrupt
2. Hardware interrupt
a. non - maskable
b. Maskable
i. External
ii. Internal

8. Difference between I2C and SPI?

SPI I2C
Spi supports a single master with I2c supports multiple master with
multiple slaves. multiple slaves

No.of interfacing lines are more. So, No.of interfacing lines are less. So,
hardware size will be increased hardware size will also be less.

It is full duplex communication It is a half duplex

The speed of the communication can The speed of the communication can
go upto 10 megabits / sec go upto 5 megabits / sec

SPI does not have any start and stop I2C has extra overhead i.e. start and
bits stop bits
9. Difference between C and embedded C

C Embedded C

C is a general-purpose programming Embedded C is a variant of the C


language that allows structured language that is specifically designed
programming. for developing embedded systems.

C is hardware independent. Embedded C is hardware dependent.

In C language, the standard compiler Embedded C requires specific compilers


helps to compile and execute the that are capable of generating
program. microcontroller based outputs.

Network drivers, interpreters, compilers, Embedded C helps to develop embedded


operating systems, and text editors are systems such as robots, vehicle tracking
some examples for C applications. systems, smart monitoring systems, etc.

10. What are the different types of configurations in SPI ? Which one is
preferred?
1. Independent method
- no.of interfacing lines are more.
- inorder to transmit the data it will take less time, because it is
having the separate slave select line.
2. Daisy chain method
- no.of interfacing lines are less.
- inorder to transmit the data it will take more time, because it is
sharing the miso , mosi lines.

It depends on ES. While developing the ES if you want to reduce the


hardware size then Daisy chain method is preferred . Because the no.of
interfacing lines are less.
If you want to transmit the data within less time , then an independent
method is preferred . Because it has separate slave select lines.

11. Clock stretching


I2C supports multiple masters and multiple slaves. But at a time one
master and one slave can communicate over a bus. If 2 masters want to
communicate with each other , one controller will act as a master and the other
controller will act as a slave.
During communication , after the acknowledgement controller which is
acting as slave , for that controller if there was an interrupt. So the slave
controller will take some extra time to resume the communication as it has to
attend the interrupt. During that time it will inform the master controller to wait for
the communication. So the slave controller will inform the master by holding the
clock pulse low. The slave controller will hold the clock pulse by pulling the SCK
to 0.

12. Data Arbitration

When 2 masters try to communicate at the same time on the i2c, the master
which generates the lowest unique id will win the bus, this is called data
arbitration .

13.What is an Interrupt Vector Table and the size is it?


An interrupt vector table (IVT) is a data structure that associates a list of interrupt
handlers with a list of interrupt requests in a table of interrupt vectors. Each entry
of the interrupt vector table, called an interrupt vector, is the address of an
interrupt handler (also known as ISR).
14.What are real time applications of CAN.

Controller Area Network (CAN) is a robust and widely used communication


protocol in real-time applications, particularly in the automotive and industrial
sectors. Here are some real-time applications of CAN:

​ Automotive Systems:
● Engine Control Units (ECUs): CAN is extensively used for
communication between different ECUs in a vehicle, such as those
controlling the engine, transmission, brakes, and suspension
systems.
● Body Control Modules (BCMs): CAN facilitates communication
between various components in the body control system, including
lights, windows, mirrors, and central locking.
● Instrument Clusters: Communication between the instrument cluster
and other vehicle systems, such as the engine and transmission, is
often implemented using CAN.
​ Industrial Automation:
● PLC Communication: Programmable Logic Controllers (PLCs) in
industrial automation use CAN for real-time communication between
different machines and control systems.
● Motion Control Systems: CAN is employed in systems that require
precise control of motors and actuators, such as robotic arms and
conveyor belts.
● Process Control: In manufacturing environments, CAN is used to link
sensors and control units for real-time monitoring and adjustment of
processes.
​ Medical Devices:
● Patient Monitoring Systems: CAN is used in medical devices to
enable communication between different monitoring systems,
ensuring real-time data exchange.
● Diagnostic Equipment: Instruments like scanners and diagnostic
devices use CAN for communication between different modules and
components.
​ Avionics:
● Flight Control Systems: CAN is employed in avionics for
communication between different systems involved in flight control,
navigation, and monitoring.
● Cabin Systems: Communication between various avionic systems in
the aircraft, including lighting, entertainment, and climate control,
can be handled using CAN.
​ Marine Applications:
● Boat Control Systems: CAN is used for communication between
different control units on boats, managing functions such as
propulsion, navigation, and communication systems.
● Monitoring Systems: In maritime applications, CAN facilitates
real-time communication for monitoring and controlling various
parameters like engine performance, navigation, and safety systems.
​ Home Automation:
● Smart Home Systems: CAN can be utilized in smart home
applications to enable real-time communication between different
devices, such as lighting, security systems, and climate control.
​ Railway Systems:
● Train Control Systems: CAN is used in railway applications for
communication between different control units on trains, managing
functions like traction control, braking, and monitoring.

In these applications, CAN provides a reliable and deterministic communication


protocol, making it suitable for real-time and safety-critical systems. It is known
for its low latency, high reliability, and ability to operate in harsh environments.

15. Explain the frame format in UART

1. S - start bit
- start bit indicating the start of the frame .The start bit is a transition
from the idle high state to a low state.
2. D0 to D7 - data bits
- Data bits are used to carry the data to be transmitted over the frame.
Actual data will be transmitted with the data frame . There can be 5 to 9
(including parity) user data bits. These data bits are usually transmitted
with the LSB first.
3. P - parity bit
- parity bit that can be used for error detection( it was an optional bit). The
value of the parity bit depends on the type of parity being used (even or
odd) .
- In even parity, this bit is set such that the total number of 1s in the
frame will be even.
- In odd parity, this bit is set such that the total number of 1s in the
frame will be odd.
4. ST - stop bit
- The stop bit indicates the end of user data. The stop bit is either a
transition back to the high or idle state or remaining at the high state for an
additional bit time. A second (optional) stop bit can be configured, usually
to give the receiver time to get ready for the next frame, but this is
uncommon in practice.

16. What is address bus and data bus


An address bus: this determines the location in memory that the processor
will read data from the memory or write data to the memory.
A data bus: this contains the contents that have been read from the
memory location or are to be written into the memory location.

17. WAP to blink an LED every 1 sec using a timer

#include<xc.h>

Void init_timer0
{

/*Setting 8 bit timer register*/

T08BIT = 1;
/* Selecting internal clock source */
T0CS = 0;

/* Enabling timer0*/
TMR0ON = 1;

/* disabling prescaler*/
PSA = 1;

TMR0 = 6;

/* Clearing timer0 overflow interrupt flag bit */


TMR0IF = 0;

/* Enabling timer0 overflow interrupt */


TMR0IE = 1;

void __interrupt() isr(void)


{
static unsigned short count;

if (TMR0IF)
{
TMR0 = TMR0 + 8;

if (count++ == 20000)
{
count = 0;
RB0= !RB0;
}
TMR0IF = 0;
}
}

Void init_config()
{
/*peripheral interrupt enable bit */
PEIE = 1;
/* Clear old content */
PORTB = 0x00;

/* Set PORTB as a Output */


TRISB = 0x00;

/* Config PORTB as digital */


ADCON1 = 0x0F;

init_timer0();

GIE = 1;

}
Void main()
{
init_config();

while (1)
{
;
}

18. What are active elements and passive elements in electronics?

Active elements:
● A circuit component which can deliver power or power gain in an
electric circuit for an infinite duration of time is known as active
component.
● The common examples of active components are energy sources
(voltage or current source), generators, semiconductor devices
like transistors, solar cells, SCR, etc.
● Active components can provide power gain in the electric circuit.
● Active components receive energy in the forms such as thermal
energy, chemical energy, hydraulic energy, etc. and deliver it to
the circuit in the form of electrical energy.

Passive elements:
● A circuit element which only absorbs the power and converts it in
heat or stores it in an electric field or magnetic field is known as
a passive component.
● The examples of passive components are resistor, inductor,
capacitor and transformer, etc.
● The passive components act as load in the circuit.
● Passive components cannot provide power gain.
● Passive components receive electrical energy and either convert
it in the other forms such as heat, light, rotation, etc. or store it
in the magnetic field or electric field.

What is sampling? How you convert analog to digital signal.


What are counters?
What is bit rate and baud rate?
What is a multiplexer?
What is an oscillator?
. Inductance capacitance
V-I characteristics for passive elements.
. Explain with a circuit diagram how to glow a LED using 230V ac supply.
XOR operation.
Electronics components which are used in vehicles.
about speedometer
difference between ac and dc and its applications

Explain about NPN Transistor, Diode, opAMP?

Which controller is used in Arduino ?

Explain the 8051 Block Diagram?

Which Ports are used for memory in 8051?

Explain the pic18f4580 Block Diagram?

You might also like