MC Module Questions With Key Answers
MC Module Questions With Key Answers
Comparison Table
Example Intel Core series, AMD ARM Cortex-M series, Atmel AVR,
Platforms Ryzen series. PIC.
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.
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
8. Types of interrupt
1. Software interrupt
2. Hardware interrupt
a. non - maskable
b. Maskable
i. External
ii. Internal
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.
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
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.
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 .
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.
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.
#include<xc.h>
Void init_timer0
{
T08BIT = 1;
/* Selecting internal clock source */
T0CS = 0;
/* Enabling timer0*/
TMR0ON = 1;
/* disabling prescaler*/
PSA = 1;
TMR0 = 6;
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;
init_timer0();
GIE = 1;
}
Void main()
{
init_config();
while (1)
{
;
}
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.