Interrupts
A signal which has highest priority from
hardware or software which processor
should process its signal immediately.
Interrupts
Polling method
• In early years of computing processor has to wait
for processing, so processor has to check each
and every hardware and software program in the
system if it has any signal to process. In this
method the problem processor has to waste
number of clock cycles just for checking the
signal in the system, by this processor will
become busy unnecessarily. If any signal came
for the process, processor will take some time to
process the signal due to the polling process in
action. So system performance also will be
degraded and response time of the system will
also decrease.
Interrupts
Interrupt-driven method
• It will not check for any signal from
hardware or software but instead
hardware/software will only send the
signal to the processor for processing. The
signal from hardware or software should
leave the current process and process the
signal of hardware or software.
Types of Interrupts
1. Hardware Interrupts: if the signal for
the processor is from external device or
hardware is a called hardware interrupts.
Example: from keyboard we will press
the key to do some action this pressing
of key in keyboard will generate a signal
which is given to the processor to do
action, such interrupts are called
hardware interrupts.
• Hardware interrupts can be classified into
two types:
Markable Interrupt
Markable Interrupt
The hardware interrupts which can be
delayed when a much highest priority
interrupt has occurred to the processor.
Non Markable Interrupt
The hardware interrupts which cannot be
delayed and should process by the
processor immediately.
Types of Interrupts
2. Software Interrupts:
• Software interrupts can be classified into
two types:
Normal Interrupts: the interrupt
which are caused by the software
instructions are called software
instructions.
Exception: unplanned interrupts while
executing a program is called
Exception. For example: while
executing a program if we got a value
which should be divided by zero is
Classification of Interrupts According
to Periodicity of Occurrence
1. Periodic Interrupt: If the interrupts
occurred at fixed interval in timeline,
then that interrupts are called periodic
interrupts.
• Useful for real-time clocks, data acquisition
systems, and control systems.
2. Aperiodic Interrupt: If the occurrence
of interrupt cannot e predicted then that
interrupt is called aperiodic interrupt.
Classification of Interrupts According to the
Temporal Relationship with System Clock
1. Synchronous Interrupt: The source of
interrupt is in phase to the system clock
is called synchronous interrupt. In other
words, interrupts which are dependent
on the system clock. Example: timer
service that uses the system clock.
2. Asynchronous Interrupts: If the
interrupts are independent or not in
phase to the system clock is clock is
called asynchronous interrupt.
Waveform / Signal Generation
Signal Generator
• Generator of signal used as stimulus for
electronic measurements.
• Most circuits require some type of input
signal whose amplitude varies over time.
• Provide “idea” waveforms or it may add
known, repeatable amounts and types of
distortion (or errors) to the signal it
delivers.
• Act as testing and measurement device
for quality improvement and
Analog or Digital?
• Arbitrary waveform generators (AWG) and
function generators are aimed primarily at
analog and mixed-signal application
• Digital waveform generators (logic sources)
encompass two classes of instruments.
Pulse generators drive a stream of square waves or
pulses from a small number of outputs, usually at very
high frequencies. These tools are most commonly used
to exercise high-speed digital equipment.
Pattern generators/data generators/data timing
generators, typically prove 8, 16, or even more
synchronized digital pulse streams as a stimulus signal
for computer buses, digital telecom elements, and
more.
Signal Generation Techniques
Modern high-performance signal generators
offer at least three ways to develop
waveforms:
• Create: Brand new signals for circuit
stimulus and testing
• Replicate: Synthesize an unavailable
real-world signal (captured from an
oscilloscope or logic analyzer).
• Generate: Ideal or stressed reference
signals for industry standards with specific
tolerances.
Waveform Properties
Amplitude: A measure of the voltage
“strength” of the waveform. Amplitude is
constantly changing in an AC signal. Signal
generators allow you to set a voltage
range, for example, -3 to +3 volts. This will
produce a signal that fluctuates between
the two voltage values, with the rate of
change dependent upon both the wave
shape and the frequency.
Waveform Properties
Frequency: The rate at which full
waveform cycles occur. Frequency is
measured in Hertz (HZ), formerly known as
cycles per second. Frequency is inversely
related to the period (or wavelength) of the
waveform, which is a measure of the
distance between two similar peaks on
adjacent waves. Higher frequencies have
shorter periods.
Waveform Properties
Phase: In theory, the placement of a
waveform cycle relative to a ) degree point.
In practice, phase is the time placement of
a cycle relative to a reference waveform or
point in time.
Terminology
• Phase shift: describes the difference in
timing between two otherwise similar
signals
• Edge transition times (rise and fall
times) are characteristics usually ascribed
to pulses and square waves.
• Pulse width is the time that elapses
between the leading and trailing edge of a
pulse.
• Duty cycle is used to describe a pulse’s
high and low (on/off) time intervals.
Basic Waves
• Sine Waves
• Square and rectangular waves
• Sawtooth and triangle waves
• Step and pulse shapes
• Complex waves
Types of Analog and Mixed
signal Generators
Arbitrary generators can be classified into
1. Arbitrary/Function Generator (AFG)
• Serves a wide range of stimulus need;
• Offers fewer waveform variations than its
AWG equivalent, but with excellent stability
and fast response to frequency changes.
• Low cost, which make it very attractive for
applications that do not require an AWG’s
versatility.
• It produces stable waveforms in standard
shapes (all-important sine and square waves)
– that are both accurate and agile.
Types of Analog and Mixed
signal Generators
2. Arbitrary Waveform Generator
(AWG)
• Sophisticated playback system that delivers
waveforms based on stored digital data that
describes the constantly changing voltage levels
of an AC signal.
• It is much like a CD player that reads out stored
data (in the AWG, its own waveform memory; in
the CD player, the disc itself) in real time. Both
put out an analog signal, or waveform.
• Offers a degree of versatility that few
instruments can match
• Embraces applications ranging from automotive
Time Measurement in Analog
• A quasi-digital signal is defined as a
binary signal carrying analog information
in its variations in time.
• Analog information is in the “horizontal”
direction (time) rather than in the vertical
direction (voltage).
• Analog information is either in the
distance between two positive (or
negative) edge (= the period or
frequency), the distance between a
positive (negative) and negative (positive)
edge (= the pulse width) or it is in the
Time Measurement in Digital
• A digital time-measuring system is
commonly referred to as a Time-to-Digital
Converter (TDC).
• A TDC quantize the time between a start
and a stop signal and they are either
analog or counter based.
Time Measurement in Digital
• However, increasing the clock frequency raises
two other issues; first of all, the power
consumption increases and secondly, there is a
limit to the maximum oscillator frequency that
can be implemented in CMOS technology
(Henzler, 2010).
• Vernier time measurements – improve the
resolution by interpolating in between the clock
cycle pulses (without increasing the clock
frequency).
Pierre Vernier (1580-1637), inventor of the metric
caliper, perform a mechanical interpolation between
the millimeter markers of a ruler.
Time Measurement in
embedded controllers
• The second-generation time measurement
units in microcontrollers included an Input
capture feature, where the content of a
running timer is automatically latched into
a “capture” register at the occurrence of a
external “event”. This is a great help in
time measurements since external events
are automatically time stamped by
hardware.
Time Measurement in
embedded controllers
• Change Time Measurement Unit
(CTMU) – Microchip’s next generation of
embedded time measurement units
Consists first of all a very accurate source and
it is used with an internal ADC to measure
either capacitance or time.
Uncertainties in basic counting
Time-to-Digital Converter (TDC)
1. Quantization error
2. Trigger error
3. Time-base error
4. Systematic error
Uncertainties in microcontroller-base
Time-to-Digital Converter (TDC)
• In microcontroller-based TDCs, the
quantization is not necessarily limited to
the ±1 count inherently found in counter-
based TDCs; it depends on the firmware
algorithm and also on the hardware
resources used.
• For microcontrollers, internally generated
threshold noise is rarely specified in the
data sheet.
Microcontroller-
implementation of vernier TDC
• The microcontroller’s interrupt reaction
time can be minimized if the
microcontroller is waiting for interrupt in
idle mode (Reverted and Pallas-
Areny,2006)
• A typical microcontroller cannot compare
two running timer registers in hardware
and hence the moment of coincidence has
to be detected in firmware.
By: Allan Jay L. Morillo, CCpE