On Sat, Feb 19, 2011 at 2:54 AM, Oli Glaser wrote= : > On 18/02/2011 20:54, Manu Abraham wrote: >> On Sat, Feb 19, 2011 at 12:23 AM, Manu Abraham = =A0wrote: >>> Hi, >>> >>> >>> On Fri, Feb 18, 2011 at 7:29 PM, Oli Glaser = =A0wrote: >>>> On 18/02/2011 13:30, Manu Abraham wrote: >>>>> Any other thoughts ? >>>>> >>>>> >>>> Just one right now - in the read routine, have you tried a *repeated* >>>> start after you write the address instead of a normal start? >>>> I do have some DS1307 code here (not based on MCHP library, though I c= an >>>> send you for reference if you want it) >>> I have been looking through it, but the communication sequences seemed >>> looked much the same. >>> So, I have been looking at the assembly level instructions in detail. >>> >>> This is where I landed up: in Microchip's i2c.h, I do not find any >>> place where SSPCON2bits.RCEN is enabled ? >>> >>> A bit confused. Any idea why RCEN is not used ? >> >> After digging here and hunting there, eventually a delay did the trick. >> >> Phew .. >> >> Best Regards, >> Manu > > Good stuff, so its working okay now? > Out of interest (mainly wondering if it's a problem with the MC code) > where did you put the delay? (had a quick look, but I can't see one in > the code I sent, just waitforidle) Actually, I would have lost motivation and been searching all places as to what could be wrong. The code what you sent me (since it looked more the same with regards to the communication sequence), gave me a boost as to still look more deeper as to what probably could be wrong. I have factored out and put the now working one here: http://202.88.242.108:8000/test/ds1307.c http://202.88.242.108:8000/test/ds1307.h Thanks again, for the help. Best Regards, Manu --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .