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

Embedded System Unit 3

The document compares microprocessors and microcontrollers, highlighting that microprocessors are used in computers while microcontrollers are used in embedded systems with integrated memory and I/O components. It also introduces the ATmega328P microcontroller, its applications, and the Arduino IDE for programming, emphasizing the use of functions to improve code organization and readability. Additionally, it classifies embedded systems based on generation, complexity, and performance, and explains the L293D motor driver IC's pin functions and applications.

Uploaded by

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

Embedded System Unit 3

The document compares microprocessors and microcontrollers, highlighting that microprocessors are used in computers while microcontrollers are used in embedded systems with integrated memory and I/O components. It also introduces the ATmega328P microcontroller, its applications, and the Arduino IDE for programming, emphasizing the use of functions to improve code organization and readability. Additionally, it classifies embedded systems based on generation, complexity, and performance, and explains the L293D motor driver IC's pin functions and applications.

Uploaded by

vikram singh
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

Unit 3

Q1.What is different between Microprocessor and Microcontroller


Ans
S.No Microprocessor Microcontroller
1 Microprocessor is the heart of Computer Microcontroller is the heart of an
system. embedded system.
2 It is only a processor, so memory and I/O Micro Controller has a processor along with
components need to be connected externally internal memory and I/O components.
3 Memory and I/O has to be connected Memory and I/O are already present, and the
externally, so the ciruit becomes large. internal circuit is small
4 You can’t use it in compact systems You can use it in compact systems
5 It is mainly used in personal computers It is used mainly in a washing machine, MP3
players, and embedded systems
6 Cost of the entire system is high Cost of the entire system is low
7 Due to external components, the total power As external components are low, total power
consumption is high. Therefore, it is not ideal consumption is less. So it can be used with
for the devices running on stored power like devices running on stored power like
batteries. batteries.
8 Most of the microprocessors do not have Most of the microcontrollers offer power-
power saving features. saving mode.
9 Microprocessor has a smaller number of Microcontroller has more register. Hence the
registers, so more operations are memory- programs are easier to write
based
10 It’s complex and expensive, with a large It’s simple and inexpensive with less number
number of instructions to process. of instructions to process.

Q2. What do you understand by the ATmega328 (psychomotor)?


Ans
Introduction to ATMEGEA 328P:
ATMEGA328P is high performance, low power controller from Microchip. ATMEGA328P is an 8- bit
microcontroller based on AVR RISC architecture. It is the most popular of all AVR controllers as it is
used in ARDUINO boards.

Applications
There are hundreds of applications for ATMEGA328P:

 Used in ARDUINO UNO, ARDUINO NANO and ARDUINO MICRO boards.


 Industrial control systems.
 SMPS and Power Regulation systems.
 Digital data processing.
 Analog signal measuring and manipulations.
 Embedded systems like coffee machine, vending machine.
 Motor control systems.
 Display units.
 Peripheral Interface system.

Introduction to Arduino Programming:


Arduino IDE
The Arduino IDE is open-source software, which is used to write and upload code to the Arduino
boards. The IDE application is suitable for different operating systems such as Windows, Mac OS X,
and Linux. It supports the programming languages C and C++. Here, IDE stands for Integrated
Development Environment.

The Arduino IDE will appear as:

The program or code written in the Arduino IDE is often called as sketching. We need to connect the
Genuino and Arduino board with the IDE to upload the sketch written in the Arduino IDE software. The
sketch is saved with the extension '.ino.

Toolbar Button
The icons displayed on the toolbar are New, Open, Save, Upload, and Verify

It is shown below:

Upload

The Upload button compiles and runs our code written on the screen. It further uploads the code to the
connected board. Before uploading the sketch, we need to make sure that the correct board and ports are
selected.
We also need a USB connection to connect the board and the computer. Once all the above measures
are done, click on the Upload button present on the toolbar.
Open

The Open button is used to open the already created file. The selected file will be opened in the current
window.

Save
The save button is used to save the current sketch or code.
New
It is used to create a new sketch or opens a new window

Verify
The Verify button is used to check the compilation error of the sketch or the written code.

Serial Monitor
The serial monitor button is present on the right corner of the toolbar. It opens the serial monitor.

Q3. Explian the basic function of Arduino?

Arduino Functions
The functions allow a programmer to divide a specific code into various sections, and each section
performs a particular task. The functions are created to perform a task multiple times in a program.
The function is a type of procedure that returns the area of code from which it is called.
For example, to repeat a task multiple times in code, we can use the same set of statements every time
the task is performed.
Advantages of using Functions
Let's discuss some advantages of using functions in programming, which are listed below:
 It increases the readability of the code.
 It conceives and organizes the program.
 It reduces the chances of errors.
 It makes the program compact and small.
 It avoids the repetition of the set of statements or codes.
 It allows us to divide a complex code or program into a simpler one.
 The modification becomes easier with the help of functions in a program.

BUILT IN FUNCTIONS
The Arduino programming language comes with a huge array of built in functions that are useful for all
of our projects. These built in functions allow us to save time on the programming side of our builds.
We don't have to spend time developing our own functions, we can just use the ones that are
provided.The Arduino has two common functions setup() and loop(), which are called automatically in
the background. The code to be executed is written inside the curly braces within these functions. The
Arduino void setup and void loop functions are mandatory.

Void setup ()
void setup() - It includes the initial part of the code, which is executed only once. It is called as
the preparation block.
As the void setup function is called only once at the very beginning of the program, this will be the
place to:

 Initialize variables’ values.


 Setup communications (ex: Serial).
 Setup modes for digital pins (input/output).
 Initialize any hardware component (sensor/actuator) plugged to the Arduino. Etc.
The void setup, as its name suggest, is made for you to do any setup required at the beginning of the
program. Don’t write the core functionalities here, just the initialization code.
Depending on the complexity of your program, you may have a lot of instructions to write in that void
function. You can create new functions that you call from the void setup, no problem with that.

Q4. Explain the Classification of Embedded System?


CLASSIFICATION OF EMBEDDED SYSTEMS:
 Based on Generation
 Based on Complexity & Performance
 Based on deterministic behavior
 Based on Triggering
Embedded Systems - Classification based on Generation:
First Generation: The early embedded systems built around 8-bit microprocessors like 8085 and Z80
and 4-bit microcontrollers with simple hardware and firmware.
EX. stepper motor control units, Digital Telephone Keypads etc.
Second Generation: Embedded Systems built around 16-bit microprocessors and 8 or 16-bit
microcontrollers, following the first generation embedded system
EX. SCADA, Data Acquisition Systems etc
Third Generation: Embedded Systems built around high performance 16/32 bit
Microprocessors/controllers, Application Specific Instruction set processors like Digital Signal
Processors (DSPs), and Application Specific Integrated Circuits (ASICs).The instruction set is
complex and powerful.
Ex: Robotics, industrial process control, networking etc.
Fourth Generation: Embedded Systems built around System on Chips (SoC’s), Re- configurable
processors and multicore processors. It brings high performance, tight integration and
miniaturization into the embedded device marketEx: Smart phone devices, MIDs etc.
Embedded Systems - Classification based on Complexity & Performance
Small Scale:
The embedded systems built around low performance and low cost 8 or 16 bit microprocessors/
microcontrollers. It is suitable for simple applications and where performance is not time critical.
It may or may not contain OS.
 washing machine.
 Oven.
 Automatic Door Lock.
 Motion Controlled Home Security System.
 Keyboard controller.
 CD Drive.
 fax machine.
Medium Scale:
Embedded Systems built around medium performance, low cost 16- or 32-bit microprocessors /
microcontrollers or DSPs. These are slightly complex in hardware and firmware. It may contain
GPOS/RTOS.Various examples of medium scale embedded
systems are routers for networking, ATM (is. Automated Teller Machine for bank transactional
machines etc.
Large Scale/Complex:
 Embedded Systems built around high performance 32- or 64-bit RISC
processors/controllers, RSoC or multi-core processors and PLD.
 It requires complex hardware and software.
 This system may contain multiple processors/controllers and co-units/hardware
accelerators for offloading the processing requirements from the main processor.
 It contains RTOS for scheduling, prioritization and management.

Q5 Draw the pin Diagram of L293D motor Drive IC and explain function of each
pin?
Ans
Introduction: L293D Dual H-Bridge Motor Driver IC
L293D motor Driver IC is an integrated circuit that can drive two motors simultaneously and is usually
used to control the motors in an autonomous system. This motor driver IC enables us to drive a DC motor
in either direction and also control the speed of the motor.
L293D is a dual H-bridge motor driver IC. H-bridge is the simplest circuit for controlling a low current-
rated motor. One H-bridge is capable to drive a DC motor bidirectional. L293D is a current enhancing IC.
It can also act as a switching device.
The L293D is a 16-pin Integrated circuit, with eight pins, on each side, dedicated to the controlling of a
motor. There are 2 input pins, 2 output pins and 1 enable pin for each motor. The L293D IC is designed
to provide bidirectional drive currents of up to 600-mA at voltages from 4.5 V to 36 V. It is designed to
drive inductive loads such as relays, solenoids, DC & bipolar stepping motors, as well as other high-
current/high-voltage loads in positive-supply applications.
L293D motor Driver IC is one of the most popular drivers in the market. Because of several reasons such
as cheap price (compared to other drivers), easy control, proper shape and size, no need for protective
circuit and diodes, no need for heat sinks, and good resistance to temperature and high-speed variations,
L293D motor driver is mostly preferred driver to the user.
Features and Characteristics of L293D IC
The followings are the main features and specifications of the L293D Motor Driver IC.
 Wide supply voltage range: 4.5V to 36V
 Output current 600mA per channel
 Peak Output Current 1.2A per channel
 High-Noise-Immunity Inputs
 Separate Input-Logic Supply
 Internal Electrostatic Discharge (ESD) Protection

 Pin 1 ( Enable1,2): When this pin is given High or Logic 1, the left part of the IC will work and
when it is low, the left part doesn’t work. So, this pin is the Master Control pin for the left part of
the IC
 Pin 2 (Input 1): When this pin is High or Logic 1, output 1 becomes High. i.e. the current will
flow through output 1
 Pin 3 (Output 1): This pin is connected to one of the terminal of motor 1
 Pin 4, Pin 5 ( GND): These pins should be connected to the circuit’s ground
 Pin 6 (Output 2): This pin is connected to one of the terminal of motor 1
 Pin 7 (Input 2): When this pin is given High or Logic 1, output 2 becomes high i.e. the current
will flow through output 2
 Pin 8 (VCC2): This is the voltage required to run the motor. It can be greater than IC voltage Vcc
1. If we are driving 12 V DC motors then make sure that this pin is supplied with 12 V
 Pin 9 (Enable 3,4): When this pin is given High or logic 1, the right part of the IC will work, and
when it is low the right part doesn’t work. So, this pin is the Master Control pin for the right part
of the IC
 Pin 10 (Input 3): When this pin is given High or Logic 1, output 3 becomes high i.e the current
will flow through output 3
 Pin 11 (Output 3): This pin is connected to one of the terminal of motor 2
 Pin 12,13 (GND): These pins should be connected to the circuit’s ground
 Pin 14 (Output 4): This pin is connected to one of the terminals of motor 2
 Pin 15 (Input 4): When this pin is given High or Logical 1, output 4 becomes High i.e. the
current will flow through output 4
 Pin 16 (VCC1): This pin provides power to the IC. So, this pin should be supplied with a 5V

Logical Diagram
The logic diagram of L293D IC which presents an internal logic followed by an IC is shown in the figure
below.

Applications of L293D Motor Driver IC


L293D Driver Motor IC is widely used in a lot of applications. Some of them are as follows:
 DC motor drivers
 Two-phase motor drivers
 Relay drivers
 Stepper motor drivers

You might also like