Sie sind auf Seite 1von 65

Submitted To :Prof. R .K. Aggarwal H.O.

D ECE

Submitted By :Virender kumar ECE 90490413957

Ludhiana College of Engineering and Technology, Katani Kalan

Special-purpose computer system designed to perform a dedicated function. Performs one or a few pre-defined tasks, usually with very specific requirements, and often includes task-specific hardware and mechanical parts not usually found in a general-purpose computer.

COMPONENTS OF EMBEDDED SYSTEM


Analog Components Sensors (LDR,LM35 etc.) Digital Components Processor, Coprocessors Memories Controllers, Buses Application Specific Integrated Circuits Converters A2D, D2A, Software Application Programs Exception Handlers

EMBEDDED DESIGNING
1. Core hardware 2.Firmware tools 3.Programming tools 4.Hardware tools

Core hardware
8051 Microcontroller

PIC (Peripheral Interface Control ) Microcontroller AVR Microcontroller ARM (Advance risk machine ) Microcontroller FPGA(Field Programmable Gate Array) CPLD(Complex Programmable Logic Device)

DESIGNING
1. Core hardware 2. Firmware tools 3. Programming tools 4. Hardware tools

Firmware tools
8051- KEIL Compiler & Assembler PIC - Source Boost , micro c AVR Code Vision Avr ARM - KEIL advanced versions

Programming tools
8051 Flash Magic , ECE Flash PIC - Matrix pppv3 , pickit AVR Pony Prog ARM Flash Utility

Hardware tools
Hardware programmers Application debuggers

Hardware programmer and application debugger

Advance Technology

IN OUR COURSE
1. Core hardware PIC16F877A

2. Firmware tools
micro c

3. Programming tools

PPPv3

4. Hardware tools

PIC Application Board

AUTOMOBILES: Fuel Injection control (for fuel efficiency), Air bags and Automatic braking (for safety), and car entertainment systems. MEDICAL ELECTRONICS: Many sophisticated medical instruments (Body Scanners, Heart rate monitors, Pacemaker etc) Industrial Control: such as CNC machines are example embedded systems. BUSINESS APPLICATIONS: Vending machines, scanners, printers. CONSUMER ELECTRONICS: Cameras, Toys, Cellular Phones, Washing Machines AVIONICS: Airplanes, Satellite Stations Defense: RADARs, SONARs (for surveillance), Guided Missile Systems

Introduction to PIC Microcontrollers

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 These devices have been very successful in 8-bit microcontrollers. The main reason is that Microchip Technology has continuously upgraded the device architecture and added needed peripherals to the microcontroller to suit customers' requirements.

Power - on reset Brown out reset Simplified instruction set High speed execution Up to 25 mA output pin drive Programming of microcontroller by synchronous serial pins Watchdog timer Parallel slave port (PSP) SPI (Serial Peripheral Interface) called MSSP (Master Slave Serial Port) USART Analog input ports

8051

PIC

8051 is CISC (Complex Instruction


Set Computer)

PIC is a RISC (Reduced Instruction


Set Computer) that means that it has a reduced set of instructions, more precisely 35 instructions

No internal I2C No Internal ADC

internal I2C, Internal ADC,

No Internal USART/SCI, SPI


No Internal PSP

No Internal SPI, USART/SCI


No Internal PSP

C versions having EPROM (Erasable and programmable Read Only memory) F versions having flash memory

12/14 bit internal operations 33/35 instructions 0.4 s time instruction cycle time (minimum time for instruction execution)

High performance Flash memory 1k of code space (program memory) 64 bytes of RAM 128 bytes of EEPROM Runs up to 20 MHz clock speed

12 bit internal operations 33 instructions 0.2 s (200 ns) instruction cycle time

14 bit internal operations 35 instructions 0.2 s (200 ns) instruction cycle time

High performance Flash memory 8 k 14 code space 368 bytes RAM 256 bytes of EEPROM Single - cycle (0.2s) instructions for all except branch instruction [20 MHz clock] Branch takes two cycles

16 bit internal operations 58 instructions 0.12 s time for instruction cycle time

New and advanced features Twice the program memory space and greater four times RAM, two times the speed

Addressable USART module: - Supports RS-485 and RS-232 Parallel Slave Port (PSP) module Compatible 10-bit Analog-to-Digital Converter module (A/D) with: - Fast sampling rate - Conversion available during SLEEP - Linearity 1 LSb Programmable Low Voltage Detection (PLVD) - Supports interrupt on-Low Voltage Detection Programmable Brown-out Reset (BOR)

Power-on Reset (POR), Power-up Timer (PWRT) and Oscillator Start-up Timer (OST) Watchdog Timer (WDT) with its own On-Chip RC Oscillator for reliable operation Programmable code protection Power saving SLEEP mode Selectable oscillator options including: - 4X Phase Lock Loop (of primary oscillator) - Secondary Oscillator (32 kHz) clock input Single supply 5V In-Circuit Serial Programming (ICSP) via two pins In-Circuit Debug (ICD) via two pins

MEMORY
The PIC18F452 has three types of memory ROM, RAM and EEPROM. ROM MEMORY The PIC18F452 has 32Kb of ROM. EEPROM MEMORY The PIC18F452 has 256 locations for EEPROM RAM MEMORY

The PIC18F452 has 1536 bytes of RAM


RAM consists of two parts: General-purpose registers Special-function registers (SFR).

PIN DESCRIPTION OF PIC18F452

* RB3 is the alternate pin for the CCP2 pin multiplexing.

PIN diagram of PIC18F452


Pin Name MCLR/VPP MCLR VPP OSC1/CLKI OSC1 CLKI OSC2/CLKO/RA6 OSC2 CLKO RA6 RA0/AN0 RA0 AN0 2 Digital I/O. Analog input 0. 14 13 Pin No. 1 Description Master Clear (input) or programming voltage (output). Master Clear (Reset) input. This pin is an active low Reset to the device. Programming voltage input. Oscillator crystal or external clock input Oscillator crystal input or external clock source input. ST buffer when configured in RC mode; otherwise CMOS External clock source input. Always associated with pin function. Oscillator crystal or clock output. Oscillator crystal output. Connects to crystal or resonator in Crystal Oscillator mode. In RC mode, OSC2 pin outputs CLKO, which has 1/4 the frequency of OSC1 and denotes the instruction cycle rate. General Purpose I/O pin. PORTA is a bidirectional I/O port

PIN diagram of PIC18F452


Pin Name RA1/AN1 RA1 AN1 RA2/AN2/VREFRA2 4 Digital I/O. Pin No. 3 Digital I/O. Analog input 1. Description

AN2
VREF RA3/AN3/VREF+ RA3 AN3 VREF+ RA4/T0CKI RA4 6 5

Analog input 2.
A/D reference voltage (Low) input.

Digital I/O. Analog input 3. A/D reference voltage (High) input. Digital I/O Open-drain when configured as output.

T0CKI

Timer0 external clock input.

PIN diagram of PIC18F452


Pin Name RA5/AN4/SS//LVDIN RA5 AN4 SS LVDIN RA6 14 Pin No. 7 Digital I/O. Analog input 4. SPI slave select input. Low Voltage Detect Input See the OSC2/CLKO/RA6 pin PORTB is a bidirectional I/O port. PORTB can be software programmed for internal weak pull-up on all inputs. RB0/INT0 RB0 INT0 RB1/INT1 RB1 INT1 RB2/INT2 RB2 INT2 35 Digital I/O. External interrupt 2 34 Digital I/O. External interrupt 1 33 Digital I/O. External interrupt 0 Description

PIN diagram of PIC18F452


Pin Name RB3/CCP2 RB3 CCP2 RB4 RB5/PGM RB5 PGM RB6/PGC RB6 39 Digital I/O. Interrupt-on-change pin 37 38 Digital I/O. Interrupt-on-change pin Low-voltage ICSP programming enable pin. Pin No. 36 Digital I/O. Capture2 input, Compare2 output, PWM2 output Digital I/O. Interrupt-on-change pin Description

PGC
RB7/PGD RB7 PGD 40

In-circuit debugger and ICSP programming clock.

Digital I/O. Interrupt-on-change pin In-circuit debugger and ICSP programming data.

PIN diagram of PIC18F452


Pin Name RC0/T1OSO/T1CKI RC0 T1OSO T1CKI RC1/T1OSI/CCP2 RC1 T1OSI CCP2 RC2/CCP1 RC2 CCP1 RC3/SCK/SCL RC3 SCK SCL 18 Digital I/O. Synchronous serial clock input/output for SPI mode. Synchronous serial clock input/output for I2C mode. 17 Digital I/O. Capture1 input, Compare1 output, PWM1 output. 16 Digital I/O. Timer1 oscillator input. Capture2 input, Compare2 output, PWM2 output. Pin No. 15 Digital I/O. Timer1 oscillator output. Timer1 /Timer3 external clock input. Description PORTC is a bidirectional I/O port.

PIN diagram of PIC18F452


Pin Name RC4/SDI/SDA RC4 SDI SDA RC5/SDO RC5 SDO 24 Digital I/O. SPI data out. Pin No. 23 Digital I/O. SPI data in. I2C data I/O. Description

RC6/TX/CK
RC6 TX CK RC7/RX/DT RC7 RX DT

25
Digital I/O. USART asynchronous transmit. USART1 synchronous clock. 26 Digital I/O. USART asynchronous receive. USART synchronous data.

PIN diagram of PIC18F452


Pin Name1 Pin No. Description PORTD is a bidirectional I/O port or Parallel Slave Port when interfacing to a microprocessor bus. RD0/PSP0 RD0 PSP0 RD1/PSP1 RD1 PSP1 RD2/PSP2 RD2 PSP2 21 Digital I/O. Parallel Slave Port data. 22 Digital I/O. Parallel Slave Port data. 27 Digital I/O. Parallel Slave Port data. 20 Digital I/O. Parallel Slave Port data. 19 Digital I/O. Parallel Slave Port data.

RD3/PSP3
RD3 PSP3 RD4/PSP4 RD4 PSP4

PIN diagram of PIC18F452


Pin Name RD5/PSP5 RD5 PSP5 RD6/PSP6 RD6 29 Digital I/O. Pin No. 28 Digital I/O. Parallel Slave Port data. Description

PSP6
RD7/PSP7 RD7 PSP7 30

Parallel Slave Port data.

Digital I/O. Parallel Slave Port data. PORTE is a bidirectional I/O port.

RE0/RD/AN5 RE0 RD AN5

8 Digital I/O. Read control for Parallel Slave Port. Analog input 5.

PIN diagram of PIC18F452


Pin Name RE1/WR/AN6 RE1 WR AN6 RE2/CS/AN7 RE2 10 Digital I/O. Pin No. 9 Digital I/O. Write control for Parallel Slave Port. Analog input 6. Description

CS
AN7 VSS VDD 12, 31 11, 32

Chip select control for Parallel Slave Port.


Analog input 7. Ground reference for logic and I/O pins. Positive supply for logic and I/O pins.

INPUT/OUTPUT PORTS

PORTA is a 7-bit wide, bidirectional port. The corresponding data direction register is TRISA. Setting a TRISA bit (= 1) will make the corresponding PORTA pin an input (i.e. put the corresponding output driver in a High-Impedance mode). Clearing a TRISA bit (= 0) will make the corresponding PORTA pin an output (i.e., put the contents of the output latch on the selected pin). Pin RA4 is multiplexed with the Timer0 module clock input to become the RA4/T0CKI pin. Other PORTA pins are multiplexed with analog inputs and the analog VREF input for both the A/D converters and the comparators.

PORTB is an 8-bit wide, bidirectional port. The corresponding data direction register is TRISB. Setting a TRISB bit (=1) will make the corresponding PORTB pin an input (i.e. put the corresponding output driver in a High-Impedance mode). Clearing a TRISB bit (= 0) will make the corresponding PORTB pin an output (i.e. put the contents of the output latch on the selected pin).

PORTC is an 8-bit wide, bidirectional port. The corresponding data direction register is TRISC. Setting a TRISC bit (=1) will make the corresponding PORTC pin an input (i.e., put the corresponding output driver in a HighImpedance mode). Clearing a TRISC bit (= 0) will make the corresponding PORTC pin an output (i.e., put the contents of the output latch on the selected pin).

PORTD is an 8-bit wide, bi-directional port. The corresponding Data Direction register is TRISD. Setting a TRISD bit (= 1) will make the corresponding PORTD pin an input (i.e., put the corresponding output driver in a Hi-Impedance mode). Clearing a TRISD bit (= 0) will make the corresponding PORTD pin an output (i.e., put the contents of the output latch on the selected pin). PORTD is an 8-bit port with Schmitt Trigger input buffers. Each pin is individually configurable as an input or output.

PORTD is an 8-bit wide, bi-directional port. The corresponding Data Direction register is TRISD. Setting a TRISD bit (= 1) will make the corresponding PORTD pin an input (i.e., put the corresponding output driver in a Hi-Impedance mode). Clearing a TRISD bit (= 0) will make the corresponding PORTD pin an output (i.e., put the contents of the output latch on the selected pin). PORTD is an 8-bit port with Schmitt Trigger input buffers. Each pin is individually configurable as an input or output.

PORTE is a 3-bit wide, bi-directional port. The corresponding Data Direction register is TRISE. Setting a TRISE bit (= 1) will make the corresponding PORTE pin an input (i.e., put the corresponding output driver in a Hi-Impedance mode). Clearing a TRISE bit (= 0) will make the corresponding PORTE pin an output PORTE has three pins (RE0/RD/AN5, RE1/WR/AN6 and RE2/CS/AN7) which are individually configurable as inputs or outputs. These pins have Schmitt Trigger input buffers.

PORTE pins are multiplexed with analog inputs. When selected as an analog input, these pins will read as '0's. TRISE controls the direction of the RE pins, even when they are being used as analog inputs. The user must make sure to keep the pins configured as inputs when using them as analog inputs.

Serial Communication

Contents
Types of communication. USART in PIC.

Registers regarding serial communication.


Programming steps.

Serial Communication
Type of Communication
1.Parallel 2.Serial

The USART module is one of the two serial I/O modules.

USART is also known as a Serial Communications Interface or SCI.

The USART can be configured as a full-duplex


asynchronous system that can communicate with peripheral devices, such as CRT terminals and personal computers

It can also be configured as a half-duplex synchronous

system that can communicate with peripheral devices,

The USART can be configured in the following modes: Asynchronous (full-duplex) Synchronous Master (half-duplex) Synchronous Slave (half-duplex)

The USART Asynchronous module consists of the


following important elements:

Baud Rate Generator Asynchronous Transmitter Asynchronous Receiver

The heart of the transmitter is the Transmit (Serial) Shift Register (TSR). The shift register obtains its data from the Read/Write Transmit Buffer, TXREG. The TXREG register is loaded with data in software. The TSR register is not loaded until the Stop bit has been transmitted from the previous load. As soon as the STOP bit is transmitted, the TSR is loaded with new data from the TXREG register (if available). Once the TXREG register transfers the data to the TSR register,

void serial_init() { INTCON.GIE=1; TXSTA=0x26; SPBRG=25; RCSTA.SPEN=1; PIE1.TXIE=1; } void serial_trans(char tx) { TXREG = tx;

while(PIR1.TXIF==0); PIR1.TXIF=0; } void main() { int i; char arr [10] = {"ADVANCE"}; serial_init(); for(i=0;i<=6;i++) { serial_trans(arr[i]); } }

The heart of the receiver is the Receive (Serial) Shift Register (RSR). After sampling the Stop bit, the received data in the RSR is transferred to the RCREG register (if it is empty). If the transfer is complete, flag bit, RCIF of PIR1 register, is set. The actual interrupt can be enabled/disabled by setting/clearing enable bit, RCIE of PIE1 register. Flag bit RCIF is a read-only bit which is cleared by the hardware. It is cleared when the RCREG register has been read and is empty.

void serial_init() { INTCON.GIE=1; TXSTA=0x26; RCSTA=0x90; TXSTA.BRGH=1; TXSTA.SYNC=0; SPBRG=25; PIE1.TXIE=1; PIE1.RCIE=1; } char serial_rec() { while(PIR1.RCIF==0); PIR1.RCIF=0; return(RCREG); }

void serial_trans(char tx) { TXREG = tx; while(PIR1.TXIF==0); PIR1.TXIF=0; void main() { char a; serial_init(); while(1)

{ }
}

a = serial_rec(); serial_trans(a);

What is GSM ?
Global System for Mobile (GSM) is a second generation cellular standard developed to cater voice services and data delivery using digital modulation

Advance Technology

GSM Architecture

Advance Technology

SIM 300 Modem Features


RS232 interface for direct communication with computer. Push type SIM Card holder. GSM Antenna. On board power supply regulator for external Supply voltage range 7V to 32V

Advance Technology

Das könnte Ihnen auch gefallen