35
SUMMER TRAINING PRESENTATION ON EMBEDDED SYSTEM SUBMITTED TO: MR.RAJESH MALIK H.O.D.(ECE) SUBMITTED BY: MANDEEP KUMAR ROLL NO. 3410919 B.TECH 7 TH SEM(ECE)

Home Automation Using Gsm

Embed Size (px)

DESCRIPTION

scourging net for ideas on project, or for a sample ppt? You're at right place.This ppt is all about "home automation using gsm". Implemented on PIC microcontroller.

Citation preview

SUMMER TRAINING PRESENTATION ON EMBEDDED SYSTEM

SUBMITTED TO:MR.RAJESH MALIK

H.O.D.(ECE)

SUBMITTED BY:MANDEEP KUMARROLL NO. 3410919

B.TECH 7TH SEM(ECE)

ABOUT EMTECH FOUNDATION EMTECH Foundation is an ISO 9001:2008 certified training and Consultancy

Company offering various courses for budding electronics engineers working professionals to upgrade their technical skills to find a best working place in current competitive market scenario.

They are now authorized training partner with Microchip Technology Inc., USA in India.

Microchip Technology Inc., USA is world’s #1 company in 8-bit microcontrollers’ category and leading provider of microcontroller, Analog and FLASH-IP solutions.

They are authorized training partner with Robhatah Robotic Solution Pte. Ltd., Singapore.

It offers Training on Embedded Systems & Robotics Design, Electronics Projects Design & Linux Device Driver Programming, Programming of ARM & pic Microcontrollers.

INTRODUCTION TO EMBEDDED SYSTEMEmbedded system means the processor is embedded into that application.

An embedded system is a computer system designed to perform one or a few dedicated often with real-time computing constraint.

The embedded system is a combination of computer hardware, software, additional electrical & mechanical parts.

Hardware SoftwareInterface

AN EMBEDDED SYSTEM

Input

Source Code ---------------------------

OUTPUT

Software Hardware

INPUT SOURCES

SensorsRF signal Analog/Digital signals Mouse Keyboard Keypads Optocoupler

OUTPUT DEVICES LEDSeven segment display Buzzer LCDPrinterRelayMotor

EMBEDDED SYSTEM HARDWARE& COMPONENTS

Embedded system hardware is used for processing of input to produce output in task specific fashion.

Processer

Interrupt Controller

Data Memory

Serial PortsParallel Ports

Program Memory

Timers/Counters

I/P Device/Interfacing Devices/ Driver Circuits

O/P Device/Interfacing Devices/ Driver Circuits

Power Supply

Reset Circuit

Oscillator

Application Specific Circuits

EMBEDDED SYSTEM SOFTWARE Embedded system software is used for editing, compiling codes as well as simulating them using an inbuilt simulator.

SoftwareJava

Assembly language

Embedded C,C++

Machine language

CHARECTERISTICS OF EMBEDDED SYSTEM

ReliableMaintainableAvailableSafetySecurity

MUST BE DEPENDABLE Energy efficient. Code-size efficient. Run-time efficient. Weight efficient. Cost efficient.

MUST BE EFFICIENT

DEDICATED TOWARDS A CERTAIN APPLICATION

MANY EMBEDDED SYSTEM MUST MEET REAL-TIME CONSTRAINTS It means embedded system must react to stimuli within the time

interval

APPLICATIONS OF EMBEDDED SYSTEMMP3 PlayersMobile PhonesGPS ReceiversPrintersMedical EquipmentsATMsRocket and Satellite controlEnergy production control

Rocket and Satellite controlEnergy production controlAir traffic controlAvionics and missilesAutomobilesTelevisionHouse hold appliancesAir traffic control

CommunicationLighting

EMBEDDED PRESENCE IN INDUSTRY

HealthcareTechnology

MICROCONTROLLERSA microcontroller is a functional computer system-on-a-chip. It contains a processor, memory and programmable input/output peripherals.

Microcontrollers include an integrated CPU, memory (a small amount of RAM, program memory, or both) and peripherals capable of input and output.

In 1971, the first microcontroller was invented by two engineers at Texas Instruments, according to the Smithsonian Institution. The microcontroller was used internally in calculator.

Types of microcontroller:- 8-bit, 16-bit, 32-bit, 64-bit.

MICROPROCESSORS

A microprocessor is a single chip semi conductor device also which is a computer on chip, but not a complete computer.

Its CPU contains an ALU, a program counter, a stack pointer, some working register, a clock timing circuit and interrupt circuit on a single chip.

To make complete micro computer, one must add memory usually ROM and RAM, memory decoder, an oscillator and a number of serial and parallel ports.

CPU RAM ROM

I/O TIMER SERIAL COM PORT

CPU

General purpose

uP

RAM ROM I/O TIMERSERIALCOMPORT

Address Bus

Data Bus

Microprocessor Microcontroller

1. Contains no on chip RAM, ROM, I/O,

TIMER, Serial port .

1. Contains on chip RAM, ROM, I/O,

TIMER, Serial port .

2. Used in General Purpose applications 2. Used in Specific Purpose applications3. Don’t provide data storage facility. 3. Provides data storage facility.

5. The structure of uP is as given below 5. The structure of uC is as given below

4. Rapid movements of code and data between external memory & MP.

4. Rapid movements of code and data within MC

DIFFERENCE B/W MICROPROCESSOR & MICROCONTROLLER

PIC MICROCONTROLLER

PIC is a family of modified Harvard architecture microcontrollers made by Microchip Technology, derived from the PIC1650 originally developed by General Instrument's Microelectronics Division. The name PIC initially referred to "Peripheral Interface Controller".

Why we use PIC microcontroller?PICs are popular with both industrial developers and hobbyists alike due to their low cost, wide availability, large user base, extensive collection of application notes, availability of low cost or free development tools, and serial programming (and re-programming with flash memory) capability. They are also commonly used in educational programming.

HARVARD ARCHITECTURE

Uses two separate memory space for program and instructions and data.`

I worked on PIC 16F877A 8-bit microcontroller.

The basic building block of PIC 16F877A is based on Harvard architecture. This microcontroller also has many advanced features as mentioned in the previous post. Here you can see the basic internal architecture and memory organisation of PIC16F877A.

REGISTER FILE CONCEPT

All of data memory is part of the register file, so any location in data memory may be operated o`n directly.

All peripherals are mapped into data memory as a series of registers

PIC BLOCK DIAGRAMPROGRAM MEMORY DATA MEMORYOscillator

Non-Volatile(Flash)

Volatile(SRAM)

Holds programinstructionsthat tell CPUwhat to do

Holds dataunder the control of instructions

The BrainsPerforms all instruction, logic, and mathematical processing

CPU

Working

STATUS

OPTION

ALU

PIC16 Core

FLASH PROGRAM MEMORY

Stores the instructions (your code)Tells the CPU what to do

The amount of Program Memory is device specific

All Instructions are 14-bits wide1 instruction = 1 Program Memory Address

Divided into pages

PROGRAM MEMORY

Page 1

Page 0

Page 2

Page 3

FLASH PROGRAM MEMORY

With a 14 bit instruction, only 11 bits can be used to specify a program memory address in a single cycle

PROGRAM MEMORY

Page 1

Page 0

Page 2

Page 3

211 = 2048 addresses

01234567891011

Opcode

GOTO Instruction in Program Memory1213

0000h

07FFh

0800h

0FFFh

1000h

17FFh

1800h

1FFFh

RAM DATA MEMORY

Divided into BANKs # of banks is device dependent (4 banks max)

2 groups of Registers:Special Function Registers (SFR)

Control CPU and Peripheral functions

General Purpose Registers (GPR)Store user defined variables

Data Memory

SFR

GPR

DATA MEMORY BANKS

Accesses70h – 7FhAccesses70h – 7Fh

Accesses70h – 7FhAccesses70h – 7Fh

Accesses70h – 7FhAccesses70h – 7Fh

Bank 1 Bank 2 Bank 3

080h

0FFh

100h

17Fh

180h

1FFh

128 Bytes

SpecialFunction Registers

Special Function Registers

Special Function Registers

Bank 0

000h

07Fh

SpecialFunction Registers

General Purpose Registers

General Purpose Registers

General Purpose Registers

General Purpose Registers

Note Data Memory Addresses

DATA MEMORY SFR'S

INDFINDF

TMR0TMR0

PCLPCL

STATUSSTATUS

FSRFSR

PORTAPORTA

PORTBPORTB

PORTCPORTC

PORTDPORTD

PORTEPORTE

PCLATHPCLATH

INTCONINTCON

INDFINDF

OPTION_REGOPTION_REG

PCLPCL

STATUSSTATUS

FSRFSR

TRISATRISA

TRISBTRISB

TRISCTRISC

TRISDTRISD

TRISETRISE

PCLATHPCLATH

INTCONINTCON

INDFINDF

TMR0TMR0

PCLPCL

STATUSSTATUS

FSRFSR

PORTBPORTB

PCLATHPCLATH

INTCONINTCON

INDFINDF

OPTION_REGOPTION_REG

PCLPCL

STATUSSTATUS

FSRFSR

TRISBTRISB

PCLATHPCLATH

INTCONINTCON

PIR1PIR1 PIE1PIE1 EEDATAEEDATA EECON1EECON1

PIR2PIR2 PIE2PIE2 EEADREEADR EECON2EECON2

Bank 0 Bank 1 Bank 2 Bank 3

000

001

002

003

004

005

006

007

008

009

00A

00B

00C

00D

080

081

082

083

084

085

086

087

088

089

08A

08B

08C

08D

100

101

102

103

104

105

106

107

108

109

10A

10B

10C

10D

180

181

182

183

184

185

186

187

188

189

18A

18B

18C

18D

STATUS REGISTER

RP0C

DC

Z

Carry(Byte Overflow?)

Digit Carry(Nibble (4 bit) Overflow?)

Zero(Is the ALU Result “0’s”?)

RP0PD

TO

Power Down(SLEEP instr executed?)

Time Out(WDT Timeout?)

IRP RP1 RP0 TO PD Z DC C

Reset Status Bits ALU Status Bits

bit 0

STATUS REGISTER

IRP RP1 RP0 TO PD Z DC C

RP1 RP0RP1 RP00 00 11 01 1

BANK0BANK1BANK2BANK3

IRPRP001

BANKS 0 & 1BANKS 1 & 2

Data Memory bank select bits(Direct Addressing)

Data Memorybank select bit(Indirect Addressing)

bit 0bit 7

PIC 16 INSTRUCTION SET

Byte Oriented OperationsByte Oriented Operations Bit Oriented OperationsBit Oriented Operationsaddwf f,daddwf f,dandwf f,dandwf f,dclrf fclrf fclrw -clrw -comf f,dcomf f,ddecf f,ddecf f,ddecfsz f,ddecfsz f,dincf f,dincf f,dincfsz f,dincfsz f,diorwf f,diorwf f,dmovf f,dmovf f,dmovwf fmovwf fnop -nop -rlf f,drlf f,drrf f,drrf f,dsubwf f,dsubwf f,dswapf f,dswapf f,dxorwf f,dxorwf f,d

Add W and fAdd W and fAND W with fAND W with fClear fClear fClear WClear WComplement fComplement fDecrement fDecrement fDecrement f, Skip if 0Decrement f, Skip if 0Increment fIncrement fIncrement f, Skip if 0Increment f, Skip if 0Inclusive OR W with fInclusive OR W with fMove fMove fMove W to fMove W to fNo OperationNo OperationRotate Left f through CarryRotate Left f through CarryRotate Right f through CarryRotate Right f through CarrySubtract W from fSubtract W from fSwap nibbles in fSwap nibbles in fExclusive OR W with fExclusive OR W with f

bcf f,bbcf f,bbsf f,bbsf f,bbtfsc f,bbtfsc f,bbtfss f,bbtfss f,b

Bit Clear fBit Clear fBit Set fBit Set fBit Test f, Skip if ClearBit Test f, Skip if ClearBit Test f, Skip if SetBit Test f, Skip if Set

Literal and Control OperationsLiteral and Control Operationsaddlw kaddlw kandlw kandlw kcall kcall kclrwdt -clrwdt -goto kgoto kiorlw kiorlw kmovlw kmovlw kretfie -retfie -retlw kretlw kreturn -return -sleep -sleep -sublw ksublw kxorlw kxorlw k

Add literal and WAdd literal and WAND literal with WAND literal with WCall subroutineCall subroutineClear Watchdog TimerClear Watchdog TimerGo to addressGo to addressInclusive OR literal with WInclusive OR literal with WMove literal to WMove literal to WReturn from interruptReturn from interruptReturn with literal in WReturn with literal in WReturn from SubroutineReturn from SubroutineGo into standby modeGo into standby modeSubtract W from literalSubtract W from literalExclusive OR literal with WExclusive OR literal with W

35 single word instructions

PIC FAMILY PERIF`ERALS

I/O Ports Timers (0, 1, 2) Counters Interrupts Analog-to-Digital

Converter USART I2C and SPI Serial

Interface

Program Interrupt Service Routine

Interrupt

Program

PORTX AND TRISX REGISTORS

Every PORT (A, B, C, D, E) will have a corresponding direction register TRISx

RB7RB7 RB6RB6 RB5RB5 RB4RB4 RB3RB3 RB2RB2 RB1RB1 RB0RB0

PORTB Register

TRISB7TRISB7 TRISB6TRISB6 TRISB5TRISB5 TRISB4TRISB4 TRISB3TRISB3 TRISB2TRISB2 TRISB1TRISB1 TRISB0TRISB0

PORTB Tri-State Register (TRISB)

1 = corresponding PORTB pin is an INPUT0 = corresponding PORTB pin is an OUTPUT

DataConfigures Data Direction

PIC ARCHITECTURE

ARCHITECTURE EXPLANATION

PIC 16F877A having 40 pins.

Oscillator ckt. Is connected to the OSC1 & OSC2 i.e. 13th & 14th pin.

Reset ckt. is connected to the MCLR i.e. 1st pin of PIC.

PIC contains 4 PORTS.PORT A, PORT B, PORT C, PORT D.PORT A is analog Port.PORT B, PORT C, PORT D are digital ports and these ports can be treated as input port or output port.

SOFTWARES USED

MPLAB IDE (v8.10) MPLAB IDE (Integrated Development Environment) is used for editing, compiling codes as well as simulating them using an inbuilt simulator.

SOFTWARE

HI-TECH C compilersInformation gathered from a global view of the program, can be used to provide better detection of potential errors in the user’s code, and to better optimize the output.HI-TECH C compilers can deliver denser code, improve RAM utilization and reduce interrupt latency.

COMPILER

PROTEUS 7.7

What is Proteus 7.7?

Proteus is a software that is used to develop PCB with a feature of simulation also.

It contains all the desired tools that are required for the development of PCB from concept to complete design.

PROTEUS contains a debugger that makes our design error free.

SIMULATOR

HOME AUTOMATION USING GSM SYSTEM

INTRODUCTIONHome automation is the residential extension of "building automation". It is automation of the home, housework or household activity. Home automation may include centralized control of lighting, HVAC (heating, ventilation and air conditioning), appliances, and other systems, to provide improved convenience, comfort, energy efficiency and security.

OBJECTIVEHome Automation saves money by lowering your monthly utilities bills with the remote & scheduled control of light, appliances, sprinklers and your air conditioning.

BLOCK DIAGRAM

APPLICATIONS

Check up on the babysitter while at work, or your home while on vacation, through an Internet-connected video camera.

Adjust the thermostat while you lie in bed, or from a cell phone on your way home from work.

Heat the hot tub or turn on the oven on the way home from work through the cell phone.

Eliminate the need to walk around the house turning off lights before exiting the home or going to sleep, turn off all house lights

with the touch of a single button. Set a series of events for your morning routine, designate the thermostat to warm the room, have lights gradually increase

intensity, ensure the coffee begins brewing and the television turns on.

ADVANTAGESConvenience.Very easy installation.Savings.

DISADVANTAGES

Equipment and installation costsSystem crashes due to any damage in the interconnectionHuman errorsReliability

•Reliability