Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

I2C simualtion DS1307 with PIC16F877A

Status
Not open for further replies.

metal312

Newbie level 6
Joined
Jul 8, 2008
Messages
11
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,347
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();

}
I2Cproteus-1.jpg
[/code]
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top