embedded systems and robotics by scmandota

56
Embedded Systems & Robotics Basics Submitted to : Mr. Ritesh Saraswat (guide) Ms. Seema Sharma (co- guide) Submitted by: Sachin kr. Jain Subhash choudhary Vivek kr. gupta

Upload: scmandota

Post on 19-Jan-2015

842 views

Category:

Education


1 download

DESCRIPTION

for my dear friends who do not want to work hard for ppt. this is for embedded system

TRANSCRIPT

Page 1: Embedded systems and robotics by scmandota

Embedded Systems & Robotics Basics

Submitted to :

Mr. Ritesh Saraswat (guide)

Ms. Seema Sharma (co-guide)

Submitted by:

Sachin kr. Jain

Subhash choudhary

Vivek kr. gupta

Page 2: Embedded systems and robotics by scmandota

Embedded Systems

A embedded system is a microprocessor or microcontroller based electronic device used for specific task.

It is designed to perform operations which minimize (or even completely avoid) need of human control.

Page 3: Embedded systems and robotics by scmandota
Page 4: Embedded systems and robotics by scmandota

Types of embedded systems

1. Real time embedded system (a) Soft real time embedded system

(b) Hard real time embedded system

2. Non real time embedded system

Page 5: Embedded systems and robotics by scmandota

Applications of embedded system• Pen drives • Hard disk• Mouse • Calculators, electronics welding machine• Cell phones • Security system• Alarm system• Digital camera• Environment monitoring systems

Page 6: Embedded systems and robotics by scmandota

Microcontroller A Microcontroller is a programmable digital processor with

necessary peripherals. Both microcontrollers and microprocessors are complex sequential digital circuits meant to carry out job according to the program / instructions. Sometimes analog input/output interface makes a part of microcontroller circuit of mixed mode (both analog and digital nature).

Types: (a) RISC microcontroller

(b) CISC microcontroller

we have used ATmega16 in training

Page 7: Embedded systems and robotics by scmandota

Features of Modern Microcontrollers

• Built‐in Monitor Program • Built‐in Program Memory • Interrupts • Analog I/O • Serial I/O • Facility to Interface External Memory • Timers

Page 8: Embedded systems and robotics by scmandota

Pin diagram of ATmega16

Page 9: Embedded systems and robotics by scmandota

Features of ATMEGA16

• It is a 40 pin Ic• Advanced RISC Architecture • 16K Bytes of In‐System Self‐Programmable Flash • 512 Bytes EEPROM • 1K Byte Internal SRAM • 32 Programmable I/O Lines • In‐System Programming by On‐chip Boot Program

Page 10: Embedded systems and robotics by scmandota

Programming

Programmer basically consists of two parts:

• Software (to open .hex file on your computer)

• Hardware (to connect microcontroller

Hardware depends on the communication port you are using on the computer (Serial, Parallel or USB).

There are 2 good software which support this hardware and can communicate with micro controller using this circuit. They are,

• Pony Prog

• At‐Prog

Page 11: Embedded systems and robotics by scmandota

Serial Programmer's Circuit (Hardware)

Page 12: Embedded systems and robotics by scmandota

At-Prog(software)

Page 13: Embedded systems and robotics by scmandota

USB Programmer

Page 14: Embedded systems and robotics by scmandota

Code Vision AVR (CVAVR)

Atmel Microcontrollers are very famous as they are very easy to use. First of all we need an easy IDE (Integrated Development Environment) for developing code. We used CVAVR (Code Vision AVR)

It has limitation of code size. It works on computers with Windows platform that is

Windows XP & Vista.

Page 15: Embedded systems and robotics by scmandota
Page 16: Embedded systems and robotics by scmandota

Code Vision AVR (CVAVR)

Page 17: Embedded systems and robotics by scmandota

Code Vision AVR (CVAVR)

Page 18: Embedded systems and robotics by scmandota

Code Vision AVR (CVAVR)

Page 19: Embedded systems and robotics by scmandota
Page 20: Embedded systems and robotics by scmandota
Page 21: Embedded systems and robotics by scmandota

Code Vision AVR (CVAVR)

Page 22: Embedded systems and robotics by scmandota

Code Vision AVR (CVAVR)

Page 23: Embedded systems and robotics by scmandota

Code Vision AVR (CVAVR)

Page 24: Embedded systems and robotics by scmandota
Page 25: Embedded systems and robotics by scmandota

I/O functions Register

Input Output functions are set by Three Registers for each PORT.

DDRX ‐‐‐‐> Sets whether a pin is Input or Output of Port X.

PORTX ‐‐‐> Sets the Output Value of Port X.

PINX ‐‐‐‐‐> Reads the Value of Port X.

Page 26: Embedded systems and robotics by scmandota

LCD & LED

Page 27: Embedded systems and robotics by scmandota

LCD vs. LED

Page 28: Embedded systems and robotics by scmandota

• Since Timer works independently of CPU it can be used to measure time accurately.

• As we know a timer is an 8 bit register that keeps on increasing its value, so one of the basic conditions is the situation when timer register OVERFLOWS i.e. it has counted up to its maximum value (255 for 8 BIT timers) and rolled back to 0. In this situation timer can issue an interrupt and we must write an Interrupt Service Routine (ISR) to handle the event.

Timer

Page 29: Embedded systems and robotics by scmandota

Atmega 16 has following timers:-

Timer 0 - It is an 8-bit timer and for this pin no. 4 (PB3) is used.

Timer 1 - It is 16 –bit timer, It has two types OC1A(8-bit) at pin no 19 and OC1B(8-bit) at pin no 18.

Timer 2 - It is also an 8-bit timer and pin no 21 (OC2) is used for this.

Timers in Atmega16

Page 30: Embedded systems and robotics by scmandota

There are four modes of timers, are as: Normal mode CTC mode Fast PWM mode Phase correct PWM mode

Modes of Timers

Page 31: Embedded systems and robotics by scmandota

Normal Mode

Page 32: Embedded systems and robotics by scmandota

CTC Mode

Page 33: Embedded systems and robotics by scmandota

Fast PWM Mode

Page 34: Embedded systems and robotics by scmandota

Phase Correct PWM Mode

Page 35: Embedded systems and robotics by scmandota

SETTING UP TIMERS IN CVAVR

Page 36: Embedded systems and robotics by scmandota

SETTING UP TIMERS IN CVAVR

Page 37: Embedded systems and robotics by scmandota

SETTING UP TIMERS IN CVAVR

Page 38: Embedded systems and robotics by scmandota

SETTING UP TIMERS IN CVAVR

Page 39: Embedded systems and robotics by scmandota

• Serial Peripheral Interface Bus or SPI bus is a synchronous serial data link used to communicate between two or more microcontroller and devices supporting SPI mode data transfer.

• In this mode, devices communicate in master/slave mode where the master device initiates the dataframe. Multiple slave devices are allowed with individual slave select (chip select) lines.

SPI: Serial Peripheral Interface

Page 40: Embedded systems and robotics by scmandota

• SPI communication protocol consists of following pins:-–MOSI : Master Out Slave In (Tx for Master and

Rx for Slave)–MISO : Master In Slave Out (Rx for Master Tx for

Slave)– SCK : Serial Clock (Clock line)– SS : Slave Select (To select Slave chip) (if

given 0 device acts as slave)

SPI: Serial Peripheral Interface

Page 41: Embedded systems and robotics by scmandota

MOSI:-Channel where the master sends the data to the slave and the slave receives it.

MISO:-Channel where the slave sends the data and the master receives it.

SPI: Serial Peripheral Interface

Page 42: Embedded systems and robotics by scmandota

SCK:-Clock is send by the master.

SS:-Slave select when the master wants to send data to a particular slave it makes its SS pin low, sends the data and then again makes it high.

SPI: Serial Peripheral Interface

Page 43: Embedded systems and robotics by scmandota

In the UART protocol, the transmitter and the receiver do not share a clock signal. That is, a clock signal does not emanate from one UART transmitter to the other UART receiver. Due to this reason the protocol is said to be asynchronous

UART

Page 44: Embedded systems and robotics by scmandota

• Serial Port is used for communication between the uC and the computer.

• A serial port has 9 pins.• For laptop, most probably there wont be a serial port.

In such case, we use a USB to serial Converter.• For transmitting one byte of data, the serial port will

transmit 8 bits as one bit at a time.

Serial Port of Computer

Page 45: Embedded systems and robotics by scmandota

Serial Port of Computer

Page 46: Embedded systems and robotics by scmandota

• Pin 3 is the Transmit (TX) pin, pin 2 is the Receive (RX) pin and pin 5 is Ground pin.

• Other pins are used for controlling data communication in case of a modem.

• For the purpose of data transmission, only the pins 3 and 5 are required.

Serial Port of Computer

Page 47: Embedded systems and robotics by scmandota

MotorsDevice used to convert electrical energy into mechanical energy is called a motor.Some Motors used in embedded systems and robotics are described as below:

i. Stepper motors

ii. Servo motors

iii. Geared DC Motors

Page 48: Embedded systems and robotics by scmandota

Motors

We used Gear motors during Training.

• Gear motors are motors with an integrated gearbox.

• Geared motors have a variety of applications. Some of its uses are as in wheelchairs, stair wheels etc.

Page 49: Embedded systems and robotics by scmandota

H- Bridge

Page 50: Embedded systems and robotics by scmandota

Motor Driver ICs: Pin Diagram

Page 51: Embedded systems and robotics by scmandota

Sensors

A sensor is a device that measures a physical quantity and converts it into a signal which can be read by an observer or by an instrument.

We can use different types of sensor like,

1. Temperature sensor: We use LM35 IC as temperature sensor.

Page 52: Embedded systems and robotics by scmandota

Sensors 2. Light Dependent Resistor (LDR): LDR is basically a resistor whose resistance varies

with intensity of light. More intensity less its resistance (i.e, in black it offers high resistance and in white it offers less resistance).

Page 53: Embedded systems and robotics by scmandota

Sensors

TSOP:TSOP 1738 Sensor is a digital IR Sensor; It is logic 1 (+5V) when IR below a threshold is falling on it and logic 0 (0V) when it receives IR above threshold.

It does not respond to any stray IR, it only responds to IR falling on it at a pulse rate of 38 KHz.

Page 54: Embedded systems and robotics by scmandota

Sensors IR- Sensor:

Page 55: Embedded systems and robotics by scmandota

Sensors

IR-Sensor:

In this we use three main components IR-LED, Photo diode & LM358 IC.

From any “non black body” obstacle IR reflects and falls on photo diode.

Hence Photo diode become forward bias, and it turn on the IC LM358 that gives the output.

Page 56: Embedded systems and robotics by scmandota