14-05-2012, 12:38 PM
I2C PROTOCOL IMPLEMENTATION WITH RTC AND EEPROM
I2C PROTOCOL IMPLEMENTATION.docx (Size: 32.88 KB / Downloads: 55)
INTRODUCTION:
Inter integrate circuit, or “I2C” is a serial bus /protocol that’s widely used to interface hosts with device such as EEPROM memory, Additionally, I2C is widely used in embedded devices to communicate with real time clocks and with transmitters to link LCD monitor to a host and soon the systems management bus (SMS bus) is a subset of I2C.
The DS1307 Serial Real Time Clock, which incorporates a 2-wire serial interface (I2C protocol), can be controlled using a Pic microcontroller. The DS1307 Serial Real Time Clock is a low-power, full BCD clock/calendar plus 56 bytes of nonvolatile SRAM. Address and data are transferred serially via the 2-wire bidirectional bus. The DS1307 has a built-in power sense circuit which detects power failures and automatically switches to the battery supply.
An I2C bus master may communicate with several slave devices using only two wires. The master initiates all communication on the I2C bus and supplies the clock for all Slave devices. The I2C User Module supports speeds up to 100 Kbits/s. By using single master we can connect up 256 devices (which support I2C protocol) using same two wires.
In this project the ATmega8535 is a low-power CMOS 8-bit microcontroller based on the AVR enhanced RISC architecture. By executing instructions in a single clock cycle, the ATmega8535 achieves throughputs approaching 1 MIPS per MHz allowing the system designer to optimize power consumption versus processing speed.
The ATmega8535 provides the following features: 8K bytes of In-System Programmable Flash with Read-While-Write capabilities, 512 bytes EEPROM, 512 bytes SRAM, 32 General purpose I/O lines, 32 general purpose working registers, three flexible Timer/Counters with compare modes, internal and external interrupts, a serial programmable USART, a byte oriented Two-wire Serial Interface, an 8-channel, 10-bit ADC with optional differential input stage with programmable gain in TQFP package, a programmable Watchdog Timer with Internal Oscillator, an SPI serial port, and six software selectable power saving modes. The Idle mode stops the CPU while allowing the SRAM, Timer/Counters, SPI port, and interrupt system to continue functioning.
The application of RTC is it is a portable system such as a data collection terminal, Smart card reader and data logger to keep track of the day and time. The application code will be developed in C programming language. AVR studio 4 simulator and AVR ISP programmer is used to convert the hex file of this C program.
. An EEPROM is kinds of nonvolatile memory that means it is used for storing digital data permanently without any power supply. EEPROM stands for Electrically Erasable Programmable Read Only Memory. The advantage of these kinds of ROMs is that they can be erased electrically to make them ready for storing new data. Compare this with a CD R disks they can be recorded only once. A small amount of EEPROM is also available internally on the AVR chips. So if the volume of data you want to store is small (say few user names and password) then you can use it. The internal eeprom makes design small and simple.
APPLICATIONS:
• Controlling the real time clock and changing the time in the DS1307ic
.
TOOLS USED:
SOFTWARE:
• Embedded C.
.
HARDWARE
• ATmega 8535 microcontroller
• DS1307 Real time clock IC
• 20X4 LCD MODULE
• EEPROM
OBJECTIVES
• To prepare a general purpose ATmega 8535 board.
• To Interface the DS1307 hardware Module.
• Writing the C code