Embedded Processors Key Cum Scheme of Valuation
Embedded Processors Key Cum Scheme of Valuation
Max. Marks: 60
Time: 3 Hours
[12M]
[12M]
3. Explain how the interrupts can be handled using the register IE and IP.
[12M]
[12M]
[12M]
6. Draw and explain the structure of General Interrupt Control Register and explain the programming of
edge triggered and level triggered external interrupts.
[12M]
- Architecture: A microprocessor typically consists of only the CPU core, requiring external components
such as memory, input/output (I/O) ports, timers, etc., for a complete system. Conversely, a
microcontroller integrates the CPU core, memory (RAM, ROM/Flash), I/O ports, timers, and other
peripherals onto a single chip.
- Purpose: Microprocessors are designed for applications where flexibility and customization are key,
such as in personal computers, servers, and high-end embedded systems. Microcontrollers are
optimized for embedded applications where cost, power, and space constraints are critical, such as in
consumer electronics, automotive systems, and industrial automation.
- Complexity: Microprocessors tend to be more complex and powerful, often featuring higher clock
speeds and larger instruction sets. Microcontrollers are simpler and more specialized, with lower clock
speeds and smaller instruction sets tailored to specific applications.
- External Components: Microprocessors require additional components like memory chips, I/O
devices, and support chips to function, resulting in a more modular system design. Microcontrollers
have all necessary components integrated on a single chip, simplifying system design and reducing
board space.
- Cost: Microprocessors can be more expensive due to the need for additional components.
Microcontrollers are typically more cost-effective due to their integrated design and lower external
component count.
- Power Consumption: Microprocessors may consume more power due to their higher complexity and
external components. Microcontrollers are designed for low power consumption, making them suitable
for battery-powered applications and energy-efficient systems.
- On-Chip Memory: It has on-chip RAM (RAM), ROM (Read-Only Memory), and often programmable
Flash memory for program storage.
- I/O Ports: The 8051 typically features multiple I/O ports for interfacing with external devices and
peripherals.
- Timers/Counters: It includes one or more timers/counters, which can be used for various timing and
counting applications such as generating delays, measuring time intervals, or generating PWM signals.
- Serial Communication: Support for serial communication protocols such as UART (Universal
Asynchronous Receiver/Transmitter) for asynchronous communication and SPI (Serial Peripheral
Interface) for synchronous communication.
- Interrupt System: The 8051 microcontroller has a versatile interrupt system that supports both
external and internal interrupts, allowing the processor to respond to critical events in real-time.
- Low Power Modes: Some variants of the 8051 offer low-power operating modes, enabling energy-
efficient operation in battery-powered applications.
- IE Register (Interrupt Enable Register): This register is used to enable or disable interrupts. Each bit in
the IE register corresponds to a specific interrupt source. Setting a bit to 1 enables the corresponding
interrupt, while setting it to 0 disables the interrupt.
- IP Register (Interrupt Priority Register): This register is used to set the priority level of each interrupt.
Higher priority interrupts are serviced first when multiple interrupts occur simultaneously. The IP
register typically contains bits corresponding to each interrupt source, where setting a bit to 1 indicates
high priority and setting it to 0 indicates low priority.
3. If the priority level allows, the microcontroller services the interrupt by executing the corresponding
interrupt service routine (ISR).
4. After servicing the interrupt, the microcontroller resumes normal program execution.
The ATmega32 microcontroller features a Harvard architecture with separate address spaces for
program memory (Flash), data memory (SRAM), and I/O memory. Here's a brief overview of the
memory mapping:
- Program Memory (Flash): The program memory holds the firmware or executable code. It typically
starts at address 0x0000 and extends to the maximum address supported by the microcontroller.
Instructions are fetched from program memory during execution.
- Data Memory (SRAM): The data memory is used for storing variables, temporary data, and stack. It
starts at a certain address (usually 0x0000 or 0x0040, depending on the specific model) and extends to
the maximum address supported by the microcontroller. Data is read from and written to SRAM during
program execution.
- I/O Memory: This memory space is reserved for memory-mapped I/O (input/output) peripherals.
Special function registers (SFRs) within this space control the behavior of various on-chip peripherals
such as timers, UART, GPIO, etc.
- EEPROM (Electrically Erasable Programmable Read-Only Memory): Some microcontrollers, including
certain variants of the ATmega32, include on-chip EEPROM for non-volatile data storage. EEPROM
memory is typically accessed via special instructions or registers and is used for storing data that needs
to be retained even when power is removed.
- Analog-to-Digital Converter (ADC): ADC devices are electronic circuits or modules that convert analog
signals, such as voltage or current, into digital data, which can be processed by digital systems like
microcontrollers or computers.
- Resolution: The resolution of an ADC refers to the number of bits in the digital output. Higher
resolution ADCs provide finer granularity in representing analog signals.
- Sampling Rate: The sampling rate determines how often the ADC samples the input signal per
second. Higher sampling rates allow capturing fast-changing signals accurately.
- Accuracy: ADC accuracy refers to how closely the digital output represents the true analog input.
Factors affecting accuracy include linearity, noise, and calibration.
- Input Range: ADC devices have a specified input voltage or current range within which they can
accurately convert analog signals to digital. Input signals outside this range may lead to distortion or
clipping.
- Conversion Time: The time taken by an ADC to complete a conversion cycle, including sampling,
conversion, and data output. Faster conversion times are desirable for real-time applications.
- Resolution vs. Speed Tradeoff: There's often a tradeoff between resolution and speed in ADC devices.
Higher-resolution ADCs typically have slower conversion times, while faster ADCs may sacrifice
resolution.
6. Structure of General Interrupt Control Register and programming of edge-triggered and level-
triggered external interrupts:
The General Interrupt Control Register (GICR) is a register found in certain microcontrollers that
controls the behavior of external interrupts. It typically contains control bits for enabling/disabling
external interrupts and configuring their triggering modes. Here's a basic structure:
- GICR Register:
1. Set the corresponding bit in GICR to enable the external interrupt (e.g., set INT0 or INT1).
2. Set the trigger select bit to configure the interrupt as edge-triggered (e.g., set the INT0/INT1 trigger
select bit to 1 for rising edge or 0 for falling edge).
3. Implement an interrupt service routine (ISR) to handle the interrupt. The ISR will execute when the
specified edge condition occurs on the external interrupt pin.
3. Implement an ISR to handle the interrupt. The ISR will continuously execute as long as the specified
level condition (high or low) is present on the external interrupt pin.
- Analog-to-Digital Conversion (ADC): Use an ADC to convert the analog voltage signal into a digital
value that can be processed by a microcontroller or digital system.
- Voltage Divider Circuit: Employ a voltage divider circuit consisting of resistors to scale down the
voltage to a level suitable for measurement by a microcontroller's analog input pin.
- Voltage Sensor ICs: Utilize specialized voltage sensor integrated circuits (ICs) designed for measuring
specific voltage ranges accurately.
- Current Measurement:
- Current Shunt Resistors: Place a small-value resistor in series with the load to measure the voltage
drop across it, which is proportional to the current flowing through the load.
- Hall Effect Sensors: Use Hall effect sensors to measure magnetic fields generated by current-carrying
conductors, providing a non-invasive method for current measurement.
- Current Transformers (CTs): Employ CTs to measure alternating current (AC) by inducing a secondary
current proportional to the primary current passing through the conductor, which can be measured
using a current transformer.
- Data Acquisition Systems: Use dedicated data acquisition systems equipped with voltage and current
measurement channels to capture and process analog signals accurately. These systems often feature
built-in ADCs, signal conditioning circuits, and digital interfaces for communication with external
devices.