24project

Upload: chinna-thambi

Post on 03-Apr-2018

215 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/28/2019 24Project

    1/19

    VENUGOPAL.P SATHISH .A

    JANARDHAN.P

    VENKATRAMAN.MPROJECT CO-ORDINATOR INTERNAL GUIDE

    MR. K.SENTHAMILSELVAN, ME, p.hd., MR.S.SIDDIK.BE

    REALIZATION OF I2C PROTOCOL USING

    RTC TECHNIQUE

    BATCH 24

  • 7/28/2019 24Project

    2/19

    ABSTRACT

    Our project is REALIZATION OF I2C PROTOCOL USING REAL TIME

    CLOCK TECHNIQUE in this project realizing the I2C protocol and

    implementation of I2C Protocol with Atmel 89c51 and REAL TIME

    CLOCK IC (DS1307).Using I2C protocol external peripherals can

    connect with microcontroller but in our project RTC IC interface

    with microcontroller and controlling a devices by setting year

    ,month ,day ,hours ,minutes ,and seconds in the RTC IC.We hope

    this development will lead a new role in industry in future.

  • 7/28/2019 24Project

    3/19

    AIM OF THE PROJECT:

    THE AIM OF THE PROJECT IS TO CONTROL THE

    HIGH CURRENT DEVICE BY USING I2C PROTOCOL

    USING RTC TECHNIQUE.

  • 7/28/2019 24Project

    4/19

    REAL TIME CLOCK CHIP

    The DS1307 serial real-time clock (RTC)CHIP is alowpower,full binary-coded decimal (BCD)clock/calendarplus 56 bytes of NV SRAM.

    Address and data are transferred serially throughan I2C, bidirectional bus.

    The clock/calendar provides seconds, minutes,hours,day, date, month, and year information.

  • 7/28/2019 24Project

    5/19

    The end of the month date is automatically adjusted

    for months with fewer than 31 days, includingcorrections for leap hour format with AM/PMindicator.

    The DS1307 has abuilt-in power-sense circuit thatdetects power failures and automatically switches tothe backup supply.

    Timekeeping operation continues while the partoperates from the backup supply.

  • 7/28/2019 24Project

    6/19

    FEATURES OF RTC :

    Real-Time Clock (RTC) Counts Seconds, Minutes,Hours, Date of the Month, Month, Day of theweek, and Year with Leap-Year CompensationValid Up to 2100 .

    56-Byte, Battery-Backed, General-Purpose RAMwith Unlimited Writes.

    I2C Serial Interface

    Programmable Square-Wave Output Signal

  • 7/28/2019 24Project

    7/19

    Automatic Power-Fail Detect and Switch Circuitry

    Consumes Less than 500nA in Battery-Backup

    Mode with Oscillator Running

    Optional Industrial Temperature Range: -40C to

    +85C

    Available in 8-Pin Plastic DIP or SO

    Underwriters Laboratories (UL) Recognized

  • 7/28/2019 24Project

    8/19

    What is I2C

    The name stands for Inter - Integrated Circuit Bus A Small Area Network connecting ICs and other electronic systems

    Originally intended for operation on onesingle board / PCB Synchronous Serial Signal

    Two wires carry information betweena number of devices

    One wire use for the data

    One wire used for the clock

    Today, a variety of devices are available with I2C Interfaces Microcontroller, EEPROM, Real-Timer, interface chips, LCD driver, A/D

    converter

  • 7/28/2019 24Project

    9/19

    I2C Bus Configuration Example

  • 7/28/2019 24Project

    10/19

    BLOCK DIAGRAM

  • 7/28/2019 24Project

    11/19

    BLOCK DIAGRAM EXPLANATION

    Initializing the time anddate in the RTC chip through I2C protocol . Real Time

    and date information is read by microcontroller and

    then and display in LCD ,LCD used to display time and

    date of RTC and controlling device timing also.

    Through setting the device timing either by switch or

    pre initialization the program itself we can control the

    any devices. power supply required for both RTC chip

    and microcontroller .RTC clock having separate

    battery for to run continuous clock without interrupt.by setting the time in rtc , we can control many

    device by timing .But in our project we are

    controlling DC motor.

  • 7/28/2019 24Project

    12/19

    CIRCUIT DIAGRAM

  • 7/28/2019 24Project

    13/19

    CIRCUIT DIAGRAM EXPLANATIONS

    The 8 bit microcontroller 89c51is used in this circuit to interface lcd and RTC

    and switches .RTC Real time clock ic DS 1307 is used for clock timing and date .That the

    time is initialization in the by switches s0,s1,s2,s3 .the switches connected with the

    microcontroller port 1 pin p1.0,p1.1,p1.2,p1.3 .crystal 12 MHZ connected with

    microcontroller pin 19 and 18 xtal 1 and xtal2 .

    The real time clock chip DS1307 pin number 5 & 6 SDA and SCL connected

    with the microcontroller port0 p0.0,p0.1pin number 38 & 39 shorted with the resister

    10K R1&R2and connected 5V . microcontroller port 2.0 to port2.7 is connected with

    the LCD data D0 to D7. The microcontroller port3.0 is connected with the LCD read

    pin 4 . the port 3.1 connected with LCD write pin 5. Port 3.2 is connected with LCD

    enable pin 6 . that we can take the output from the controller p3.2 to p3.7

    according to the program . but in this circuit we connected the relay drivers circuit at

    port 3.4 32KHZ crystal resonator are used for DS1307 . DS1307 ground pin

    number 4 . positive supply at pin number 8 and 3V battery positive is connected withVbat , pin number 3 and then battery connected with pin number 4. For LCD pin

    number 1 is for ground and pin number 2 is for VCC and pin number 3 is for VEE.

    For microcontroller pin number 20 is ground. Pin number 31 ,9 &40 connected with

    5V supply .

  • 7/28/2019 24Project

    14/19

    EMBEDDED SYSTEM

    An embedded system is some combination of computerhardware and software either fixed in capability or programmable

    that is specially designed for a particular function. A computer

    system designed to perform one or few dedicated function often

    with real time computing constraints.

    Embedded system are controlled by or more main

    processing cores that is typically either a microcontroller or a DSP.

    These are processors, arrays or other hardware using dedicated

    logic or programming called FIRMWARE. They are designedaround a microcomputer which integrates memory and peripherals.

  • 7/28/2019 24Project

    15/19

    MICROCONTROLLER

    ATMEL 89C51FEATURES

    COMPITABLE WITH MCS 51 PRODUCTS.

    4K BYTES OF IN-SYSTEM REPROGRAMMABLE FLASH MEMORYENDURANCE:1,000

    WRITE/ERASE CYCLES.

    FULLY STATIC OPERATION:0 HZ TO 24 MHZ.

    THREE-LEVEL PROGRAM MEMORY LOCK.

    128x8-BIT INTERNAL RAM.

    32 PROGRAMMABLE I/O LINES.

    TWO 16-BIT TIMMER/COUNTERS.

    SIX INTERRUPT SOURCES.

    PROGRAMMABLE SERIAL CHANNELS.

  • 7/28/2019 24Project

    16/19

    PROGRAM FLOW CHART

    START

    INITIAL LCD

    INITIAL I2C

    START I2C

    SEND RTC ADDRESS

    SEND INITIAL LOCATION

    SEND SECONDS

  • 7/28/2019 24Project

    17/19

    SEND MIN,HRS,DAYS,MONTHS,YEARS

    SEND STOP

    START I2C

    SEND RTC ADDRESS FOR WRITE

    SEND RTC ADDRESS FOR FIRST LOCATION

    SEND READ ADDRESS

    READ SEC,MIN,HRS,DAYS,MONTHS,YEARS

    I2C STOP

    SEND TO LCD

    DELAY FOR 1 SEC

  • 7/28/2019 24Project

    18/19

    CONCLUSION

    This our project will be new attempt at the student level being a real

    time clock project student will have wide exposure to the real time

    I2Cprotocal project .

    In our project real-time clock application is widely used

    in the irrigation field ,it is easy to implement in the irrigation field , with lowcost, most effective and easy to maintains. our project will surely prevent the

    hardships faced by a farmers when he works in irrigation field .

    This project would not have been a great success without the guidance

    and support of our department staff .we thank them whole

    heartily.

  • 7/28/2019 24Project

    19/19