OK...
Will keep a look out for feedback :-)
I'm guessing that you don't have scope or logic analyzer to actually see whats going on, I think thats the only way you're going to fix this. In this case I suspect a scope would be more helpful (USB from eBay £50 ish - for this you don't need lots of bandwidth) and as they are so cheap, Salea knock off (eBay £6). And before the winers start, a) Salea don't sell them any more and b) if you base your software on a reference design you shouldn't be surprised if people use alternate hardware.
George
it works for me pbp3 pic16f1825 // ds1307 // pcf8574a either your code is wrong or your not connecting things properly
tested at 8mz an 32mhz the pcf8574a has no problem
Code:#CONFIG __config _CONFIG1, _WDTE_ON & _FOSC_INTOSC &_MCLRE_ON &_PWRTE_ON __config _CONFIG2, _LVP_OFF & _PLLEN_ON #ENDCONFIG DEFINE OSC 32 pkt var byte[11] MONTH VAR pkt[5] DATE VAR pkt[4] HOUR VAR pkt[2] MINS VAR pkt[1] DOW VAR pkt[3] YEAR VAR pkt[6] SEC VAR pkt[0] cnt var byte osccon=$70 '8 MHz or 32mhz anselA=0 'dig i/o ANSELC=0 TRISC= 111111 TRISA= 111110 SDA VAR PORTc.4 ; I2C Data pin SCL VAR PORTc.3 ; I2C Clock Pin pcf_Addr CON $78 rtc_Addr CON $d0 i2cwrite sda,scl,rtc_Addr,0,[$80,$14,$11,3,$14,1,$14] 'SANE TIME AND DATE i2cwrite sda,scl,rtc_Addr,0,[$80] 'FORCE START IF REQ i2cwrite sda,scl,rtc_Addr,0,[0] main: pause 2000 i2cREAD sda,scl,rtc_Addr,0,[str pkt \7 ] serout2 porta.0,84 ,[HEX HOUR,":", HEX2 MINS, ":",HEX2 sec, " - ", HEX DATE,"/", HEX MONTH ,13,10] i2cwrite sda,scl,pcf_Addr,0,[cnt] cnt=cnt+1 goto main
In preparation for providing a drawing, I stripped off the board the battery holder, socket, and crystal from the standalone 1307 I tried earlier (they were not wired, but were cluttering the board), then began commenting out the unneeded code to post the minimal circuitry and programming that demonstrated the problem. Somewhere along the way... it works as intended now.
You may recall that the last thread on this issue ended with my determination that it was some undiagnosed power issue related to backup battery voltage; I was not able to isolate the issue. Once again this is the case.
I am tempted to write it off as a bad soldier joint or poor connection; it hurts my pride to admit such - I was a hearing aid technician for 20 years and close tolerance work was my bread and butter; yet, I cannot think of any other cause or issue that might manifest itself in so frustrating a way.
I am looking now for a new DSO and I am convinced to get one with a logic analyzer. Issues like this are so demotivating...
Thank you all for your suggestions and your effort and advice, I appreciate it very much.
Bookmarks