Hi Wayne , Thanks for your promt reply !!.
Hardware Used -
Pic Used = PIC16F876A - 4MHZ External Xtal - SDA Port RC.4 - SCL Port RC.3 - Output ( Currently LCD ) but want to use a 4x7segment display. Using PBP 2.60.
I have uploaded what code I have so far, If you could pick out any errors for me that would be great. I'm fairly new to PBP and
this is the first time I have tried i2c. when i run this code the time and date is set but if i set ClkSec = %10000000 to start
the oscilator My seconds display 80 and start to count up . I read on Microchips Application note AN1491
(http://ww1.microchip.com/downloads/e...tes/01491A.pdf)
" The recommended practice is to load the Time and Date registers from 0x01 through 0x06 and then load the Seconds register 0x00 with the ST (oscillator Start bit set, enabling the oscillator)."
When I try this though I get the wrong setting returned on the LCD. Is my method for converting the BCD to DEC correct ?
One more question sorry ! When the i2cread is read, do the variables need manually updating ie
RtcSec = (ClkBuffer[0])
RtcMin = (ClkBuffer[1])
Rtchour = (ClkBuffer[2])
etc
etc
Thankyou for taking the time to answer my questions , any help or code examples would be great. Can't find much code on
the net , other than for C.
Thanks Tim
MyRTC4Forum.bas
( I'm hoping my code has appeared above if not ill try again )




Bookmarks