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

Microcontroller_1_1707724463354

The document provides an overview of microcontrollers, comparing them with microprocessors, and discusses the architectures of Von Neumann and Harvard. It highlights the characteristics and limitations of embedded systems and microcontrollers, as well as the differences between RISC and CISC architectures. Additionally, it covers the RS232 standard for serial communication and its components.

Uploaded by

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

Microcontroller_1_1707724463354

The document provides an overview of microcontrollers, comparing them with microprocessors, and discusses the architectures of Von Neumann and Harvard. It highlights the characteristics and limitations of embedded systems and microcontrollers, as well as the differences between RISC and CISC architectures. Additionally, it covers the RS232 standard for serial communication and its components.

Uploaded by

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

JSPM’s Rajarshi Shahu College of Engineering

Department of E &TC
S.Y.BTech- A (A.Y.2023-24, Sem II)

EC2113: Microcontroller Subject Teacher: Mrs.S.P. Pattanaik

Unit 1: Introduction to Microcontroller


1.1 Comparison of microprocessor and microcontroller

Table 1: Comparison of microprocessor and microcontroller

Parameters Microprocessor Microcontroller


Microprocessor is the heart of Micro Controller is the heart of an
Computer system. embedded system.
Architecture Microprocessor is based on Von- Microcontroller is based on Harvard
Neumann architecture where architecture where program memory and
program memory and data data memory are separate
memory are common
CPU General purpose CPU runs at a Specific purpose CPU runs at a lower
higher frequency frequency
Speed Faster in various operations Slower
Components Components can be outside the All devices and peripherals are integrated
processor, it is only a processor, so inside the unit. Micro Controller has a
memory and I/O components need processor along with internal memory
to be connected externally and I/O components.
Boolean Does not support Supports
Functions
CPU Need more time to access CPU Faster in accessing the CPU registers
Registers registers
Usage In desktop, servers, laptops, and Mostly in real time applications to
other general-purpose computer control
devices
Real time Supports RTOS +kernel-based Supports RTOS
operating services
system
Hardware More complex Relatively simple
complexity
Cost More expensive Generally, more affordable
Multitasking Supports Does not always support
Power Most of the microprocessor do not Most of the microcontroller do have
have power saving features power saving features like idle mode and
power saving mode. This helps to reduce
power consumption.
Size The overall size of the system is The overall size of the system is small.
large.
Bit size It is available in 32-Bit and 64-bit. It is available in 8-bit, 16-bit, and 36-bit.
Peripheral The common peripheral interface The common peripheral interface for the
interface for the microprocessor is USB, microcontroller is I2C, SPI, and UART.
UART, and high-speed Ethernet.
Clock Speed The clock speed of the The clock speed of the microcontroller is
microprocessor is high. It is in less. It is in terms of the MHz. it ranges
terms of the GHz. It ranges between 1 MHz to 300 MHz.
between 1 GHz to 4 GHz.
RAM The volatile memory (RAM) for The volatile memory (RAM) for the
the microprocessor is in the range microcontroller is in the range of 2 KB to
of the 512 MB to 32 GB. 256 KB.
ROM The hard disk (ROM) for the The hard drive or flash memory (ROM)
microprocessor is in the range is in the range of the 32 KB to 2 MB.
of
the 128 GB to 2 TB.
It cannot be used stand alone It can be used stand alone

Advantages and applications of Harvard and Von Neumann architecture

Von Neumann architecture


The Von Neumann architecture is an architectural model, originally proposed by John Von
Neumann. the Von Neumann architecture divides a computing system into four main units: CPU,
memory, input and output units. The main differentiator of the Von Neumann architecture is that
it stores both data and instructions (programs/control) in the same memory space.

Von Neumann architecture Features

 The Von Neumann architecture is a theoretical design based on the stored-program


computer concept.
 The Von Neumann architecture has only one bus that is used for both instructions
fetches and data transfers. More importantly, the operation must be scheduled because
they cannot be performed at the same time.
 In Von Neumann architecture, the processing unit would require two clock cycles
to complete an instruction.
 Von Neumann architecture is usually used literally in all machines from desktop
computers, notebooks, high performance computers to workstations.
 In Von Neumann, instructions and data use the same bus system therefore the design and
development of control unit is simplified, hence the cost of production becomes
minimum.
Fig 1. Block diagram of Von Neumann architecture

Advantages of Von Neumann Architecture


 The control unit retrieves instruction and data in the same way from one memory
unit. This simplifies the development and design of the control unit
 The above advantage would also mean that data from memory and from devices
are accessed the same way. Therefore, increasing efficiency
 Not only data but also instructions of programs are stored within the same
memory. This makes it easier to re-program the memory. Memory organization is
within the hands of the programmer.
Harvard architecture

Harvard architecture is named after the “Harvard Mark I” relay based computer, which was an
IBM computer in the University of Harvard. In the Harvard architecture, there are two separate
memory spaces: one for programs and another for data. The CPU in a Harvard architecture
system is enabled to fetch data and instructions simultaneously, due to the architecture having
separate buses for data transfers and instruction fetches.

Harvard Architecture Features

 The Harvard architecture is a modern computer architecture based on the Harvard Mark I
relay-based computer model.
 The Harvard architecture has separate memory space for instructions and data which
physically separates signals and storage code and data memory, which in turn makes
it possible to access each of the memory system simultaneously.
 In the Harvard architecture, the processing unit can complete an instruction in one cycle
if appropriate pipelining plans have been set.

 Harvard architecture is a new concept used specifically in microcontrollers and digital


signal processing (DSP).
 Harvard architecture is complex kind of architecture because it employs two buses for
instruction and data, a factor that makes development of the control unit
comparatively more expensive.

Fig 2: Block diagram of Harvard architecture

Advantages of Harvard Architecture


 Due to instructions and data being transferred in different buses, this means there is a
smaller chances of data corruption.
 Instructions and data can be accessed the same way.
 Harvard architecture offers a high performance, as this architecture allows simultaneous
flow of data and instructions. These are kept in separate memory and travel via separate
buses.
 There is a greater memory bandwidth that is more predictable, due to the architecture
having separate memory for instructions and data.

Table 3: Difference between Von-Neumann and Harvard Architecture

Sr. Von-Neumann Architecture Harvard Architecture


No
1 Based on the stored program computer Based on the Harvard Mark I relay based
concept computer model
2 Less physical space is required More physical space is required
3 The processors require two clock cycles Processor requires only one cycle to
to execute an instruction complete an instruction
4 The von Neumann architecture consists Harvard architectures control unit consists
of a simpler control unit design, which of two buses, which results in a more
means less complex development is complicated system. This adds to the
required. This means the system will be development cost, resulting in a more
less costly expensive system
5 Instruction fetches and data transfers Instruction fetches and data transfers can
cannot be performed at the same time be performed at the same time
6 Higher speed, thus less time consuming. Slower in speed, thus more time-consuming.
7 Simple in design. Complex in design.
8 Instructions and data use the same bus Complex kind of architecture because it
system therefore the design and employs two buses for instruction and data,
development of control unit is a factor that makes development of the
simplified, hence the cost of production control unit comparatively more expensive.
becomes minimum.
9 Used in laptops, personal computers, Used in signal processing(DSP) and micro-
and workstations controllers

RISC and CISC comparison

Comparison of RISC and CISC

Sr RISC CISC
No
1 RISC stands for Reduced Instruction Set CISC stands for Complex Instruction Set
Computer. Computer.
2 RISC processors have simple instructions CSIC processor has complex instructions
taking about one clock cycle. The average that take up multiple clocks for execution.
clock cycle per instruction (CPI) is 1.5 The average clock cycle per instruction
(CPI) is in the range of 2 and 15.
3 Performance is optimized with more focus Performance is optimized with more focus
on software on hardware.
4 It has no memory unit and uses separate It has a memory unit to implement complex
hardware to implement instructions.. instructions.
5 It has a hard-wired unit of programming. It has a microprogramming unit
6 The instruction set has a variety of CISC has many different addressing modes
different instructions that can be used for and can thus be used to represent higher-
complex operations level programming language statements
more efficiently.
7 Multiple register sets are present Only has a single register set
8 fixed (32-bit) format Varying formats (16-64 bits for each
instruction).
9 Complex and variable-length instructions Simple, standardized instructions
10 Fewer addressing modes More addressing modes
11 RISC processors are highly pipelined They are normally not pipelined or less
pipelined
12 The complexity of RISC lies with the The complexity lies in the microprogram
compiler that executes the program
13 Execution time is very less Execution time is very high
14 The most common RISC microprocessors Examples of CISC processors are the
are Alpha, ARC, ARM, AVR, MIPS, PA- System/360, VAX, PDP-11, Motorola
RISC, PIC, Power Architecture, and 68000 family, AMD, and Intel x86 CPUs.
SPARC.
15 RISC architecture is used in high-end CISC architecture is used in low-end
applications such as video processing, applications such as security systems, home
telecommunications, and image processing. automation, etc.
16 Separate data and instruction cache. Unified cache for instructions and data.
Definition of embedded system and its characteristics

Definition of Embedded System

 An embedded system is a system that has software embedded into hardware, which
makes a system dedicated for an application (s) or specific part of an application or
product or part of a larger system

OR

 Microcontroller-based, software-driven, reliable, real-time control system, autonomous or


human or network-interactive, operating on diverse physical variables and in diverse
environments, and sold into competitive and cost-conscious market.

Embedded systems have several common characteristics:

 Single-functioned: An embedded system usually executes only one program, repeatedly.


o For example, a pager is always a pager
 Tightly constrained: All computing systems have constraints on design metrics, but those
on embedded systems can be especially tight. Embedded systems often must cost less,
must be sized to fit on a single chip, must perform fast enough to process data in real-
time, and must consume minimum power to extend battery life or prevent the necessity of
a cooling fan.
 Reactive and real-time: Many embedded systems must continually react to changes in the
system’s environment, and must compute certain results in real time without delay.
o For example, a car's cruise controller continually monitors and reacts to speed and
brake sensors.

 ESs do a very specific task, and cannot be programmed to do different things. They do
the same task repeatedly /continuously over their lifetime. An mp3 player will function
only as an mp3 player.

 ESs have to work against some deadlines. Embedded systems are created to perform the
task within a certain time frame. It must therefore perform fast enough. A car’s brake
system, if exceeds the time limit, may cause accidents.

 ESs have limited resources, particularly memory.

 Some embedded systems are designed to react to external stimuli and react accordingly.
A thermometer, a GPS tracking device.

 Embedded systems are built to achieve certain efficiency levels. They are small sized,
can work with less power and are not too expensive.

 Embedded systems cannot be changed or upgraded by the users. Hence, they must rank
high on reliability and stability. They are expected to function for long durations without
the user experiencing any difficulties.
Role of microcontroller in embedded System

1. A microcontroller is a independent system with a processor, memory and General


Purpose Input Output (GPIO) pins and can be used as an embedded system.
2. Most of the microcontrollers in use today are embedded in other machinery, such
as automobiles, smartphones, home appliances, and peripherals for computer
systems.
3. A microcontroller has microprocessor along with RAM, ROM, etc on a single
board. It not only helps in processing the data but also to perform operations on
the data obtained.
4. Microcontroller acts as brain in embedded system. It controls the flow of data and
execute functions accordingly.

Limitation of 8-bit microcontrollers

5. An 8-bit microcontroller has limited addressing


6. An 8-bit microcontroller would normally only allow arithmetic operations that
output numbers ranging from 0 to 255 (or from -127 to 128)
7. A typical 8-bit microcontroller usually runs at 8 Mhz while a 32-bit
microcontroller can be clocked up to hundreds of Mhz.
8. an 8-bit microcontroller would be insufficient if we require Ethernet, Universal
Serial Bus (USB Stack), multiple universal asynchronous receiver-transmitter
devices (UARTS), and a Controller Area Network (CAN) bus
9. 8 bit microcontroller reveals velocity of 12 MIPS at 48 MHz whereas 16 bit
reveals most 16 MIPS at 32 MHz.
10.It takes more cycles for an 8-bit MCU to complete a large computation. If there’s
an interrupt or failure in the middle of a transfer, the 8-bit MCU has a greater
chance of not completing the task, with several cycles required
11.using an 8 bit microcontroller may not suffice the required accuracy of the
application.
Study of RS232

RS232 port is a standard serial communication transmission of data. In RS 232, the term RS
stands for recommended slandered and the number 232 specifies the latest version. The RS232 is
a communication cable, generally used to transfer and receive the serial data between two
devices This cable supports both synchronous and asynchronous data transmissions.Interfacing
standard RS232 was set by the Electronics Industries Association (EIA) in 1960.
In RS232, a 1 is represented by -3 ~ -25 V, while a 0 bit is +3 ~ +25 V. The most of the serial
cable connectors are DB-9 (9-pin connector) and B-25 (25-pin connector). These cables may be
male or female type. Nowadays, most of the PCs use DB9 cable for the exchange of
asynchronous data.

Fig 1.7.1: RS232 connector and pin description


RS232 describes the signals connecting between a data terminal equipment (DTE) that refers to
terminal and computers that send and receive data and a data circuit terminating equipment
(DCE) that refers to communication equipment. Here, DTE is a computer terminal and DCE is a
modem.
The simplest connection between a PC and microcontroller requires a minimum of three pins,
TxD, RxD, and ground
Fig 1.7.2: Null modem connection
1. DTR (data terminal ready) - When terminal is turned on, it sends out signal DTR to
indicate that it is ready for communication
2. DSR (data set ready)-When DCE is turned on and has gone through the self-test, it asserts
DSR toindicate that it is ready to communicate
3. RTS (request to send) - When the DTE device has byte to transmit, it assert RTS to signal
the modem that it has a byte of data to transmit
4. CTS (clear to send) - When the modem has room for storing the data it is to receive, it
sends out signal CTS to DTE to indicate that it can receive the data now
5. DCD (data carrier detects)- The modem asserts signal DCD to inform the DTE that
a valid carrier has been detected and that contact between it and the other modem is
established
6. RI (ring indicator)- An output from the modem and an input to a PC indicates that the
telephone isringing. It goes on and off in synchronous with the ringing sound.

A line driver such as the MAX232 chip is required to convert RS232 voltage levels to TTL
levels, and vice versa.

RS232 Communication
: a RS232 communication b) RS232 connection
1. MAX232 also called as line driver or voltage converter, uses +5V power supply which is
same as the controller or modem.
2. The IC MAX232 comprises of a transmitter – receiver arrangement so that two serial
ports can be connected using the IC.
3. 5 Capacitors each of 1 microFarad are used to generate the necessary RS232 voltage
from the TTL/CMOS voltage.
4. The transmitter section converts the TTL level to RS232 level, and the receiver
section receives the input of the RS232 and converts them to TTL level.
5. Basically, it is a 16-pin IC where the transmitter pins are connected to the
microcontroller and the input of the transmitter pin gets TTL i/p from the microcontroller
and the o/p of the transmitter pin supply o/p to the RS232 port.
6. The receiver pins attach to the RS 232 port such that the receiver’s i/p receives RS232
input from the personal computer port and the o/p receiver pin supplies the TTL i/p to the
microcontroller.
7. So, the transmitter receives I/p from the microcontroller and gives o/p to the RS232
port while the receiver takes i/p from the RS232 port and gives o/p to the
microcontroller.
: Example of RS232 and MAX 232
1.8. RS 485
1. One of the main problems with RS232 is the lack of immunity for noise on the signal
lines.
2. Noise is easily picked up and limits both the maximum distance and
communication speed.
3. The RS485 standard is used when high speed serial data communications of 10 Mbps is
needed.
4. RS485 is able to provide a headline data rate of 10 Mbps at distances up to 50 feet,
but distances can be extended to 4000 feet with a lower speed of 100 kbps.
5. RS485 proved to be a robust standard and able to provide reliable data
communications over extended distances.
6. RS485 proved to be a robust standard and able to provide reliable data
communications over extended distances.
7. RS-485 allows multiple devices (up to 32) to communicate at half-duplex on a single
pair of wires, plus a ground wire
8. Using RS-485, it is possible to construct a multi-point data communications network.
9. The standard specifies that up to 32 drivers or transmitters along with 32 receivers can
be used on a system. This means that there can be 32 nodes capable to both transmit and
receive.
10. RS485 is the only of the interfaces capable of internetworking multiple transmitters
and receivers in the same network.
11. When using the default RS485 receivers with an input resistance of 12 kΩ it is possible to
connect 32 devices to the network.
12. RS485 repeaters are also available which make it possible to increase the number
of nodes to several thousands, spanning multiple kilometers.
13. In most higher-level protocols, one of the nodes is defined as a master which
sends queries or commands over the RS485 bus.
14. All other nodes receive these data. Depending of the information in the sent data, zero
or more nodes on the line respond to the master.
15. In this situation, bandwidth can be used for almost 100%. There are other
implementations of RS485 networks where every node can start a data session on its
own.

1.9 Inter Integrated Circuit (I2C)


Philips developed Inter-IC bus, or I2C, in the 1980s. I2C is a low-bandwidth, short distance
protocol for on board communications. All devices are connected through two wires: serial data
(SDA) and serial clock (SCL).it is used for moving data simply and quickly from one device to
another, serial Interface of only two signals serial data (SDA) and serial clock (SCL),
bidirectional i.e., Data is sent either direction on the serial data line (SDA) by the master or
slave.
I2C is a Synchronous protocol. The data is clocked along with a clock signal(SCL). The clock
signal controls when data is changed and when it should be read.
I2C is a Master-Slave protocol. The Master device controls the clock (SCL). The slave devices
may hold the clock low to prevent data transfer. No data is transferred unless a clock signal is
present. All slaves are controlled by the master clock.
It supports multiple data speeds: standard (100 kbps), fast (400 kbps), high speed (3.4 Mbps)
communications.
It is widely used for attaching lower-speed peripheral ICs to processors and microcontrollers in
short-distance, intra-board communication.
The bus has two roles for nodes: master and slave:
Master node – node that generates the clock and initiates communication with slaves.
Slave node – node that receives the clock and responds when addressed by the master.
The bus is a multi-master bus, which means that any number of master nodes can be present.
There may be four potential modes of operation for a given bus device, although most devices
only use a single role and its two modes:
• master transmit – master node is sending data to a slave,
• master receive – master node is receiving data from a slave
• slave transmit – slave node is sending data to the master
• slave receive – slave node is receiving data from the master.

Fig 1.9.1: I2C Block diagram


I2C Protocol
1. The master is initially in master transmit mode by sending a START followed by the 7-bit
address of the slave it wishes to communicate with
2. This is finally followed by a single bit representing whether it wishes to write (0) to or read (1)
from the slave.
3. If the slave exists on the bus then it will respond with an ACK bit (active low for
acknowledged) for that address.
4. The master then continues in either transmit or receive mode (according to the read/write bit it
sent), and the slave continues in the complementary mode (receive or transmit, respectively).
5. The address and the data bytes are sent most significant bit first.
6. The master terminates a message with a STOP condition if this is the end of the transaction or
it may send another START condition to retain control of the bus for another message.
If the master wishes to write to the slave, then it repeatedly sends a byte with the slave sending
an ACK bit. (In this situation, the master is in master transmit mode, and the slave is in slave
receive mode.)
If the master wishes to readfrom the slave, then it repeatedly receives a byte from the slave, the
master sending an ACK bit after every byte except the last one. (In this situation, the master is in
master receive mode, and the slave is in slave transmit mode.)

Timing diagram
1. Data transfer is initiated with a start bit (S) signaled by SDA being pulled low while SCL
stays high.
2. SCL is pulled low, and SDA sets the first data bit level while keeping SCL low
3. The data are sampled (received) when SCL rises for the first bit (B1). For a bit to be
valid, SDA must not change between a rising edge of SCL and the subsequent falling
edge
4. This process repeats, SDA transitioning while SCL is low, and the data being read while
SCL is high (B2, ...Bn).
5. The final bit is followed by a clock pulse, during which SDA is pulled low in preparation
for the stop bit.
6. A stop bit (P) is signaled when SCL rises, followed by SDA rising.
Fig 1.9.2 a) Timing diagram b) Frame format

Serial Peripheral Interface(SPI) Protocol


1. The Serial Peripheral Interface bus (SPI) is synchronous serial communication interface
specification used for short distance communication
2. SPI devices communicate in full duplex mode using a master-slave architecture with a
single master and with one or more slave devices.
3. The master device originates the frame for reading and writing. Multiple slave devices
are supported through selection with individual slave select (SS) lines.
4. One unique feature of SPI is that data can be transferred without interruption.
5. Any number of bits can be sent or received in a continuous stream.
6. In SPI, only one side generates the clock signal. The side that generates the clock is
called the “master”, and the other side is called the “slave”.
7. The master is the controlling device (usually a microcontroller), while the slave (usually a
sensor, display, or memory chip) takes instruction from the master.
8. The SPI bus specifies four logic signals:
9. SCLK: Serial Clock (output from master).
 The clock signal synchronizes the output of data bits from the master
 One bit of data is transferred in each clock cycle, so the speed of data transfer is
determined by the frequency of the clock signal.
10. MOSI: Master Output Slave Input (data output from master).
11. MISO: Master Input Slave Output, or Master InSlaveOut (data output from slave).
12. SS: Slave Select (often active low, output from master).
 The master can choose which slave it wants to communicate to by setting the
slave’s CS/SS line to a low voltage level.
13. To begin communication, the bus master configures the clock, using a frequency
supported by the slave device, typically up to a few MHz.
14. The master then selects the slave device with a logic level 0 on the select line.
15. If a waiting period is required, such as for an analog to- digital conversion, the master
must wait for at least that period of time before issuing clock cycles.
16. During each SPI clock cycle, a full duplex data transmission occurs.
17. The master sends a bit on the MOSI line and the slave reads it, while the slave sends a bit
on the MISO line and the master reads it.

Data transmission in SPI Fig 1.10.1: SPI protocol pins


1. Transmissions normally involve two shift registers of some given word size ( may be 8
bits), one in the master and one in the slave
2. They are connected in a virtual ring topology.
3. Data is usually shifted out with the most-significant bit first. On the clock edge, both
master and slave shift out a bit and output it on the transmission line to the counterpart.
4. On the next clock edge, at each receiver the bit is sampled from the transmission line and
set as a new least-significant bit of the shift register.
5. After the register bits have been shifted out and in, the master and slave have exchanged
register values.
6. If more data needs to be exchanged, the shift registers are reloaded and the process
repeats.
7. Transmission may continue for any number of clock cycles.
8. When complete, the master stops toggling the clock signal, and typically deselects the
slave.

Fig 1.10.2: Example of SPI with master and slave

Digital Storage Oscillator (DSO)


Definition: The digital storage oscilloscope is an instrument which gives the storage of a digital
waveform or the digital copy of the waveform. It allows us to store the signal or the waveform in
the digital format, and in the digital memory also it allows us to do the digital signal processing
techniques over that signal. The maximum frequency measured on the digital signal oscilloscope
depends upon two things they are: sampling rate of the scope and the nature of the converter. The
traces in DSO are bright, highly defined, and displayed within seconds.

Block Diagram of Digital Storage Oscilloscope

The block diagram of the digital storage oscilloscope consists of an amplifier, digitizer, memory,
analyzer circuitry. Waveform reconstruction, vertical plates, horizontal plates, cathode ray tube
(CRT), horizontal amplifier, time base circuitry, trigger, and clock. The block diagram of the
digital storage oscilloscope is shown in the below figure.
Fig 1.11.1: Block diagram of DSO
As seen in the above figure, at first digital storage oscilloscope digitizes the analog input signal,
then the analog input signal is amplified by amplifier if it has any weak signal. After
amplification, the signal is digitized by the digitizer and that digitized signal stores in memory.
The analyzer circuit process the digital signal after that the waveform is reconstructed (again the
digital signal is converted into an analog form) and then that signal is applied to vertical plates of
the cathode ray tube (CRT).
The cathode ray tube has two inputs they are vertical input and horizontal input. The vertical
input signal is the ‘Y’ axis and the horizontal input signal is the ‘X’ axis. The time base circuit is
triggered by the trigger and clock input signal, so it is going to generate the time base signal
which is a ramp signal. Then the ramp signal is amplified by the horizontal amplifier, and this
horizontal amplifier will provide input to the horizontal plate. On the CRT screen, we will get the
waveform of the input signal versus time.
The digitizing occurs by taking a sample of the input waveform at periodic intervals. At the
periodic time interval means, when half of the time cycle is completed then we are taking the
samples of the signal. The process of digitizing or sampling should follow the sampling theorem.
The sampling theorem says that the rate at which the samples are taken should be greater than
twice the highest frequency present in the input signal. When the analog signal is not properly
converted into digital then there occurs an aliasing effect.
When the analog signal is properly converted into digital then the resolution of the A/D
converter will be decreased. When the input signals stored in analog store registers can be read
out at a much slower rate by the A/D converter, then the digital output of the A/D converter
stored in the digital store, and it allows operation up to 100 mega samples per second. This is the
working principle of a digital storage oscilloscope.

DSO Operation Modes

The digital storage oscilloscope works in three modes of operations they are roll mode, store
mode, and hold or save mode.
Roll Mode: In roll mode, very fast varying signals are displayed on the display screen.
Store Mode: In the store mode the signals stores in memory.
Hold or Save Mode: In hold or save mode, some part of the signal will hold for some time and
then they will be stored in memory.

Applications

The applications of the DSO are


1. It checks faulty components in circuits
2. Used in the medical field
3. Used to measure capacitor, inductance, time interval between signals, frequency
and time period
4. Used to observe transistors and diodes V-I characteristics
5. Used to analyze TV waveforms
6. Used in video and audio recording equipment’s
7. Used in designing
8. Used in the research field
9. For comparison purpose, it displays 3D figure or multiple waveforms
10. It is widely used an oscilloscope
Logic Analyzer
2. Logic analyzers are test instruments that are widely used for testing complex digital or
logic circuits.
3. These include digital hardware debugging, design verification, and embedded software
debugging.
4. A logic analyzer solely measures digital, not analog signals! It can capture many digital
signals simultaneously and display their often complex timing relationship to one
another.
5. Provide a time display of logic states: Logic analysers possess a horizontal time axis and
a vertical axis to indicate a logic high or low states. In this way a picture of the digital
lines can be easily displayed.
6. Displays logic states: The vertical display on the analyser displays the logic state as a
high of low state. The signals enter the various channels and are converted into a high or
low state for further processing within the analyser. It provides a logic timing diagram of
the various lines being monitored.

Operation
There are four steps to using a logic analyzer:

 Probe (connect to the SUT)


 Setup (clock mode and triggering)
 Acquire
 Analyze and display
Fig 1.12: Block Diagram of Logic Analyzer

The block numbers correspond to the four steps just listed. The acquisition probes connect to the
SUT. The probe’s internal comparator is where input voltage comparison occurs against the
threshold voltage and the signal’s logic state (l or 0) is determined. You set the threshold value,
ranging from TTL levels to CMOS, ECL, or your own user-definable ones.

Probe impedance (capacitance, resistance, and inductance) becomes part of the overall load
on the SUT. All probes exhibit loading characteristics. The logic analyzer probe should
introduce minimal loading on the SUT, and provide an accurate signal to the logic analyzer.

This roll-off slows down the edge transition by an amount of time represented as “t” in the
figure. Remember, slower edges cross the logic threshold of the circuit later, introducing timing
errors in the SUT. This problem becomes more severe as clock rates increase.

In high speed systems, excessive probe capacitance can potentially prevent the SUT from
working. It is always critical to choose a probe with the lowest possible total capacitance. It’s
also important to note that probe clips and lead sets increase capacitive loading on the SUT. Use
a properly compensated adapter whenever possible. The impedance of the logic analyzer’s probe
affects signal rise times and timing relationships.

Logic analyzers capture data from multi-pin devices and buses. The term “capture rate” refers to
how often the logic analyzer samples the inputs. It is the same function as the time base in an
oscilloscope. Logic analyzer literature interchangeably uses the terms “sample,” “acquire,” and
“capture.”

Timing acquisition captures signal timing information. In this mode, an internal clock samples
data. The faster it samples data, the higher the resolution of the resulting measurement. There is
no fixed timing relationship between the target device and the data the logic analyzer acquires.
Use this acquisition mode when you are concerned with the timing relationship between SUT
signals.
The acquisition mode acquires the “state” of the SUT. A signal from the SUT defines the sample
point (when and how often data is required). The clock signal you use in the acquisition mode
may be:

 The system clock


 A control signal on the bus
 A signal that causes the SUT to change states

Software and hardware tools for development of microcontroller-based


system such as assembler, compiler, IDE, Emulators, debugger, programmer

Software development tools are basically computer programs, and they usually run
on personal computers, helping the programmer (or system developer) to create
and/or modify or test applications programs. Some of the commonly used software
development tools are the following:

Text editors
Assemblers/compilers
Simulators

Assemblers:

The function of an assembler is to convert a code written in assembly language into machine
language.

An assembler is a program that takes basic computer instructions (called as assembly language)
and converts them into a pattern of bits that the computer's processor can use to perform its
basic operations.
Assemblers generate executable code from assembly language programs. The generated code is
usually loaded into the flash program memory of the target microcontroller.
Debugging tools in embedded system
Debugging is a methodical process to find and reduce the number of bugs in a computer
program or a piece of electronic hardware, so that it works as expected. Debugging is difficult
when subsystems are tightly coupled, because a small change in one subsystem can create bugs
in another. The debugging tools used in embedded systems differ greatly in terms of their
development time and debugging features.
Simulators
Code is tested for the MCU / system by simulating it on the host computer used for code
development. Simulators try to model the behavior of the complete microcontroller in software.
Functions of Simulators
A simulator performs the following functions −
 Defines the processor or processing device family as well as its various versions for the
target system.
 Monitors the detailed information of a source code part with labels and symbolic
arguments as the execution goes on for each single step.
 Provides the status of RAM and simulated ports of the target system for each single step
execution.
 Monitors system response and determines throughput.
 Provides trace of the output of contents of program counter versus the processor
registers.
 Provides the detailed meaning of the present command.
 Monitors the detailed information of the simulator commands as these are entered from
the keyboard or selected from the menu.
 Supports the conditions (up to 8 or 16 or 32 conditions) and unconditional breakpoints.
 Provides breakpoints and the trace which are together the important testing and
debugging tool.
 Facilitates synchronizing the internal peripherals and delays.
Emulators
An emulator is a hardware kit or a software program or can be both which emulates the
functions of one computer system (the guest) in another computer system (the host), different
from the first one, so that the emulated behavior closely resembles the behavior of the real
system (the guest).
Emulation refers to the ability of a computer program in an electronic device to emulate
(imitate) another program or device.
Emulation focuses on recreating an original computer environment. Emulators have the ability
to maintain a closer connection to the authenticity of the digital object.
An emulator helps the user to work on any kind of application or operating system on a
platform in a similar way as the software runs as in its original environment.

Compilers
A compiler is a computer program (or a set of programs) that transforms the source code written
in a programming language (the source language) into another computer language (normally
binary format). The most common reason for conversion is to create an executable program.
The name "compiler" is primarily used for programs that translate the source code from a high-
level programming language to a low-level language (e.g., assembly language or machine
code).

Debugger

 A debugger is a tool used to debug your code.It is important to test whether the code you have

written is free from errors or not. So, a debugger is used for this testing.

 Debugger goes through the whole code and tests it for errors and bugs.

 It tests your code for different types of errors for example a run time error or a syntax error and

notifies you wherever it occurs.

 The line number or location of error is shown by debugger so you can go ahead and rectify it.
Integrated development Environment

 An Integrated Development Environment is software that contains all the necessary tools
required for embedded software development.

 So it is very helpful to have software that can provide all of the necessary tools from writing to
testing of your code, in one package.

 An IDE normally consists of a code editor, compiler and a debugger. An Integrated


Development Environment also provides a user interface.

 An example of integrated development environment is Microsoft visual studio. It is used for


developing computer programs and supports different programming languages.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy