The code specifies PORTB.0 and PORTB.1 as SDA and SCL.
But the 16F690 doesn't have either RB0 or RB1, it only has RB4-RB7.
What pins are the DS1307 connected to in your simulation?
The code specifies PORTB.0 and PORTB.1 as SDA and SCL.
But the 16F690 doesn't have either RB0 or RB1, it only has RB4-RB7.
What pins are the DS1307 connected to in your simulation?
DT
SDA to PORTA.0 & SCL to PORTA.1 sorry forgot to post that also.
Using a 16F690 with the changes you posted ... It still works.
I can't comment on the simulator you are using.
But I think you can assume the problem is not in Bruce's code.
![]()
DT
Thanks Darrel really thought it was my simulator, now I know that. Thanks again, will look more into how this works with my simulator or if I'm just SOL.
Some simulators wont set the time automatically to system time, Ive run into this in the past, but just have your PIC chip check the time on startup and if it's all 0s, have it set the time through the code to a certain time or date. They do that for more realistic hardware, just like as if you were to hook up a blank ds1307 chip up and just started using it.
Bookmarks