MGITER,NAVSARI. AVR MICROCONTROLLER AND INTERFACING

Slides:



Advertisements
Similar presentations
The 8051 Microcontroller and Embedded Systems
Advertisements

Dr. Rabie A. Ramadan Al-Azhar University Lecture 3
555 Timer ©Paul Godin Updated February Oscillators ◊We have looked at simple oscillator designs using an inverter, and had a brief look at crystal.
Microprocessor and Microcontroller
Lecture 27: LM3S9B96 Microcontroller – Inter- Integrated Circuit (I 2 C) Interface.
The 8051 Microcontroller architecture
Renesas Electronics Europe GmbH A © 2010 Renesas Electronics Corporation. All rights reserved. RL78 Clock Generator.
A Simple Tour of the MSP430. Light LEDs in C LEDs can be connected in two standard ways. Active high circuit, the LED illuminates if the pin is driven.
System Clocks.
The 8051 Microcontroller and Embedded Systems
MOBILE OPERATING ROBOT ON EMBEDDED SYSTEM
MICROCONTROLLER SYSTEMS Part 1. Figure 1.1Elements of a digital controller CPU Central Processing Unit Input Peripherals Output Peripherals ROM Read Only.
Automatic accident avoiding system PROJECT MEMBERS MUTHUKUMAR.K (05ME33) SAKTHIDHASAN.S (05ME39) SAKTHIVEL.N (05ME40) VINOTH.S (05ME56) PROJECT GUIDE:
8254 Timer.
Presented by Sadhish Prabhu
HJD Institute of Technical Education & Research- Kera(Kutch) The 8051 Microcontroller architecture PREPARED BY: RAYMA SOHIL( )
BIRLA VISHVAKARMA MAHAVIDYALAY SUBJECT: SPI PROTOCOL & MAX7221 DISPLAY INTERFACING SUBMITTED BY: KISHAN AVASTHI( ) MANSI CHANDEGARA( )
TITLE: 555 Timer OM INSTITUTE OF TECHNOLOGY Subject: Analog Electronics ( ) Semester: 03 Prepared By:
MICROCONTROLLER AND INTERFACING Presented by: Shefali Jethva ( ) Shivali Panchal ( ) Komal Soni ( ) Roll no. :- 14EC308.
As a part of ALA in the subject of MCI ( ) subject faculty:Hiren Patel Sir Presentation on rtc interfacing with atmega32 using ds1307 By:selva kumar.r.
Arduino based Automatic Temperature Controlled Fan Speed Regulator.
USING TV REMOTE AS A CORDLESS MOUSE FOR THE COMPUTER
CORDLESS MOUSE FEATURES BY TV REMOTE USING PIC MICROCONTROLLER
Application Case Study Christmas Lights Controller
SUBMITTED BY EDGEFX TEAM
16F877A.
SUBMITTED BY EDGEFX TEAM
WEL COME.
The 8051 Microcontroller architecture
Serial mode of data transfer
I2C Protocol and RTC Interfacing
ARDUINO BASED AUTOMATIC TEMPERATURE BASED FAN SPEED CONTROLLER
ABSTRACT The controller continuously polls the temperature with certain regular time intervals and displays over the 7_segment display The temperature.
REMOTE JAMMING DEVICE.
555 Timer EEE DEPARTMENT KUMPAVAT HARPAL( )
SCADA for Remote Industrial Plant
SUBMITTED BY EDGEFX TEAM
GANDHINAGAR INSTITUTE OF TECHNOLOGY
Chapter 11: Inter-Integrated Circuit (I2C) Interface
USING TV REMOTE AS A CORDLESS MOUSE FOR THE COMPUTER
DIGITAL CALCULATOR USING 8051
Programmable Interval Timer
Programmable Interval Timer
Dr. Michael Nasief Lecture 2
SUBMITTED BY UNDER SUPERVISION OF VIJAY SINGH AJEET DHAKAR
I2C Protocol and RTC Interfacing
I2C PROTOCOL SPECIFICATION
Communication Lines Fundamentals.
AVR Hardware Connections and Flash Loading
BJ Furman ME 106 Fundamentals of Mechatronics 15NOV2012
EMT 348: Microcontroller Timer/counter
Interfacing Memory Interfacing.
8254 Timer and Counter (8254 IC).
Serial EEPROM (Atmel 24C-512)
Interrupts Interrupt is a process where an external device can get the attention of the microprocessor. The process starts from the I/O device The process.
AT28C17 EEPROM By: Ethan Peterson.
I2C and RTC Chapter 18 Sepehr Naimi
Programmable Interval timer 8253 / 8254
I2C Protocol and RTC Interfacing
ELEC207 Linear Integrated Circuits
LCD and Keyboard Sepehr Naimi
X1 & X2 These are also called Crystal Input Pins.
Programmable Interval timer 8253 / 8254
Important 8051 Features On chip oscillator 4K bytes ROM 128 bytes RAM
I2C Protocol and RTC Interfacing
Paul MacDougal Triembed.org Dec 11, 2017
8051 Micro Controller.
8253 – PROGRAMMABLE INTERVAL TIMER (PIT). What is a Timer? Timer is a specialized type of device that is used to measure timing intervals. Timers can.
UNIT 13 THE I2C BUS.
Programmable Interval Timer
Presentation transcript:

MGITER,NAVSARI. AVR MICROCONTROLLER AND INTERFACING RTC INTERFACING Prepared by, Guided by, Group 05,EC(SEM-05) Prof. Hitesh Patel Ajmal Mulla-130330111011 Bharat Jangid-130330111013 Mazdad Anklesaria-130330111019 Neelamber Beshra-130330111023

Table of contents Sr. No. Topic 01 RTC interfacing 02 DS1307 pin out 03 Address map of DS1307 04 DS1307 control register 05 Register Pointer 06 Writing to DS1307 07 Reading From DS1307

RTC INTERFACING The (RTC) Real Time clock is a widely used device that provides accurate time and data information for many applications. Many applications such as x86 PC comes with such a chip on board. The RTC chip on x86 PC provides the time components of hour, minute and second in addition to date/calendar components of year, month and day.

According to DS1307 data sheet from Maxim, clock calendar provides seconds, minutes, hours, day, date, month and year information. The clock operates in either 24 or 12 hour format with AM/PM indicator. The DS1307 has an inbuilt power sense circuit that detects power failures and automatically switches to the battery supply.

The DS1307 is a low-power clock/calendar with 56 bytes of battery-backed SRAM. The clock/calendar provides seconds, minutes, hours, day, date, month, and year information. The date at the end of the month is automatically adjusted for months with fewer than 31 days, including corrections for leap year. The DS1307 operates as a slave device on the I2C bus.

DS1307 PINOUT

-X1 and X2: These are the input pins that allows DS1307 connection to an external clock crystal oscillator to provide clock source to the chip. Standard 32.768 KHz quartz crystal must be used. Accuracy of clock depends on quality of crystal oscillator.

Vbat: Pin 3 can be connected to an external +3V lithium battery, thereby providing power source to chip when external supply voltage is not available. We must connect this pin to ground if it is not used. A 48mAhr lithium battery can provide the power needed for more than 10 years to back up the chip.

-GND: Pin 04 is the Ground. -SDA(Serial Data): Pin 05 is the SDA pin and must be connected to SDA line of 12C bus. -SCL(Serial Clock):Pin 06 is the scl pin and must be connected to scl line of 12C bus. -SWQ/OUT : Pin 07 is an output pin providing 1,4,8, or 32KHz frequency if enabled. It needs an ext. pull up resistor to generate the frequency as it open drain.

-Vcc: Pin 08 is used as primary voltage supply to the chip which is generally set to +5V. When Vcc falls below Vbat level,DS1307 switches to Vbat and external Lithium battery provides power to the RTC. According to DS1307 datasheet, upon power up, the device switches from Vbat to Vcc1 when Vcc1 is greater than Vbat+0.2 volts. Vcc voltage level must remain above 3.2V In order for the Vcc to remain as primary voltage source to the chip, and it must be more than 3.75V if we want to access the chip.

Address map of the DS1307 From software point of view the DS1307 is just a collection of some 8 bit registers. You can read these register to obtain the current time and date. We can also modify them to hold the correct time. After that the DS1307 keeps then updated with current date and time.

DS1307 Internal Registers ADDRESS Bit7 BIT6 BIT5 BIT4 BIT3 BIT2 BIT1 FUNCTION RANGE 00H CH 10 seconds seconds Seconds 00-59 01H 10 minutes minutes 02H 12 10 hr 10 hour Hours hours 1-12 AM/PM 00-23 24 PM/AM 03H day 01-07 04H 10 date date 01-31

05H 10 month Month month 01-12 06H 10 year year 00-99 07H out SQWE RS1 RS0 Control - 08H-3FH RAM56x8 00H-FFH

DS1307 Control register OUT SQWE RS1 RS0

-OUT:(OUTPUT CONTROL) If square wave output is disabled, setting OUT bit to 1 will make SQW/OUT pin low, and clearing OUT bit to 0 will make this bit high. -SQWE:(Square Wave Enable) If this bit is set, oscillator output is enabled else it is disabled.

-RS1-RS0(rate select): This bits selects the output frequency of oscillator output according to following table: RS1 RS0 o/p frequency 1Hz 1 4.096KHz 8.192KHz 32.768KHz

Time and data address locations and modes The byte addresses 06 are set aside for time and date. The DS1307 provides data in BCD form only. Notice the data range for hour mode. We can select 12/24 hour mode with bit06 of hour location 02. When D6=1,12 hour mode is selected and vice-versa. In 12hour mode we decide AM and PM with bit05.If D5=0, AM is selected and vice-versa.

Register Pointer In DS1307 there is a register pointer that specifies the byte that will be accessed in next write or read command. After each read or write operation, content of register pointer is automatically incremented. It is useful in multi-byte read or write.

Writing to DS1307 To set value of register pointer(R.P.) and write one or more bytes of data we can use following steps: (i)To access Ds1307 for a write operation, after sending a start condition we should transmit the address of DS1307(1001101) followed by 0 to indicate a write operation. (ii)The 1st byte of data in write operation will set RP. Example: if we want to access control register we should send 0x07.

If we only want to set RP then we should skip this step If we only want to set RP then we should skip this step. If we want to write 1 or more bytes of data we should transmit them 1 byte at a time. Transmit a Stop bit condition.

Reading From DS1307 To read 1 or more bytes of data from DS1307 we must take following steps: (i)To access DS1307 for a read operation, after sending a start condition, we should transmit the address of DS1307(1001101) followed by 1 to indicate a write operation. (ii)Now we can read 1 or more bytes of data. Notice that RP indicates which register is to be read.

(iii)Also notice that RP is automatically incremented and we can simply receive consecutive bytes of data in a multi-byte burst read. (iv)Transmit a stop bit condition.

Conclusion From this Active Learning Assignment, we can study about RTC interfacing and its working.

Reference The AVR Microcontroller and Embedded Systems using Assembly and C. Muhammad Ali Mazidi Sarmad Naimi Sepehr Naimi

THANKYOU