I2C simualtion DS1307 with PIC16F877A

Status
Not open for further replies.

metal312

New Member
Hi all,

I create a simple project to change the start time of DS1307 using I2C interface and PIC16F877A is the master!

But when i start the simulation. The time in DS1307 always starts at 00:00:00 , it doesn't change anything.

Any suggestion?

Thank you!

The source code was written by mikroC

Code:
void main()
{
  Delay_ms(100);
  I2C_Init(100000);         // initialize I2C communication
  I2C_Start();              // issue I2C start signal
  I2C_Wr(0xD0);             // send byte via I2C  (device address + W)
  I2C_Wr(0x00);             // send byte (address of DS1307 location)
  I2C_Wr(0x02);             // send data (data to be written)
  I2C_Wr(0x02);             // send data (data to be written)
  I2C_Wr(0x02);             // send data (data to be written)
  I2C_Wr(0x02);             // send data (data to be written)
  I2C_Wr(0x02);             // send data (data to be written)
  I2C_Wr(0x02);             // send data (data to be written)
  I2C_Stop();               // issue I2C stop signal

  Delay_100ms();

}
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…