DS1307 and PIC16f877a interface

Status
Not open for further replies.

rajbabu

Junior Member level 3
Joined
Apr 2, 2010
Messages
29
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,283
Location
indo
Activity points
1,459
Hello friends,

My hardware for DS1307 is working on 8051uc but when i am connecting Pic16f877a to it i got disturbed means at SCL pin 100khz frequency is not coming and at pin no. 2 of DS1307 33.768kHz frequencyis not coming.

i am using 100khz clock rate.
Confi for PIC i2c is
TRISC3 = 1; /* SDA and SCL as input pin */
TRISC4 = 1; /* these pins can be configured either i/p or o/p */
SSPSTAT |= 0x80; /* Slew rate disabled */
SSPCON = 0x28; /* SSPEN = 1, I2C Master mode, clock = FOSC/(4 * (SSPADD + 1)) */
SSPADD = 0x09; ; /* 100Khz @ 4Mhz Fosc */

I searched on net some of friends using
SSPADD = 0x0a; ; /* 100Khz @ 4Mhz Fosc */
SSPADD = 0x28; ; /* 100Khz @ 4Mhz Fosc */

for clock rate but according to formula
SSPADD = 0x09; ; /* 100Khz @ 4Mhz Fosc */
is right.


Regards
rajbabu:-?
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…