Tim
Let's be brutal...
1. You got a Pause 40 fetish? A Pause 10 following a I2CWrite is all that is needed.
2. You're obviously writing correctly to the RTC because you've initialised it and it's ticking...
3. If you're using DPIN, CPIN and RTC (good!), then why change to using PORTA.0, PORTA.1 and %11010000 later? Stick with what you've started - it saves on the possible introduction of typo's and errors.
4. You don't need Pause 10 (or indeed any Pauses) following an I2CRead.
5. Don't use a Constant in the I2C Address... do this instead...
RTC var BYTE
RTC=%11010000
something is nudging the back of my mind that not using a variable causes problems sometimes... but I can't recall the exact details of 'why?' right now, other than the fact that bit 0 is used as a flag, and it's kinda difficult nailing flags into a constant.
6. Why don't you try displaying on your Serial LCD variable (as #m1) immediately following the I2CRead... what is the result?
7. Hmmmm.... this BCD conversion of yours... have a look at what it's doing...
B1=m1
if m1>9 then B1=0
uses less code and basically does what your routine does.
Make the changes, come back and tell us what happened.




Bookmarks