I have not studied your code but....
>>Time var byte[3] ' Holds months,days,hours,mins read from RTC
and then
>>Time[3] = Month
You are overwriting the LoopCounter LowByte here (see your LST file) - change the [3] to [4] in the VAR define.
I have not studied your code but....
>>Time var byte[3] ' Holds months,days,hours,mins read from RTC
and then
>>Time[3] = Month
You are overwriting the LoopCounter LowByte here (see your LST file) - change the [3] to [4] in the VAR define.
Paul Borgmeier
Salt Lake City, UT
USA
__________________
Thanks for your replies:
Skimask:
1. DEFINE OSC 20 was in caps in my code, I messed it up whilst trying to tidy up the post.
2. Colon after TimeSet. As above, another 'posting mistake on my part. Code was OK.
3. Don't use " or '. Point taken - I'll change the comments and try again.
4. Thanks for the code - I'll give it a go. What is HCM?
Joe S:
1. HighByte/LowByte split - agreed I could 'work around' the problem but it seems
important to me that I find out why a WORD won't increment around an I2C read.
Paul B:
1. I think the array size is OK; Time[3] has 4 elements: 0,1,2,3. I'll check with a bit of test code.
Thanks to you all
Regards Bill Legge
>>Paul B:
>>1. I think the array size is OK; Time[3] has 4 elements: 0,1,2,3. I'll check with a bit of test >>code.
Hi Bill,
Not OK- see your manual or your lst file
Paul Borgmeier
Salt Lake City, UT
USA
__________________
Paul B,
Thanks - I agree. Time[3] would give me 3 elements 0,1,2.
I'll make the changes.
I've returned to electronics after a gap of 25 years and find my
main difficulty is with the easier bits that I think I already know
and don't bother to look them up - hence this sort of mistake.
Regards
Bill Legge
Not just Time, but Dtime also needs to be dimensioned correctly.
Time var byte[4] ' Holds months,days,hours,mins read from RTC
Dtime var byte[4] ' Holds months,days,hours,mins in HEX format
SteveB
Thanks, I've changed the arrays to the correct size and -IT WORKS.
Sorry to bang on about WORD/BYTE/I2C when I just got a variable format wrong.
regards
Bill Legge
Somebody coined the phrase for me awhile back... the 'High Colonic Master'. I like to use colons in my coding to keep as much of it on the screen at one time, prevent as much vertical scrolling as I can. Most people hate it, but I'm not writing code for most people, I'm writing code for me, and the majority of what I post here (or modify), gets the same treatment 'cause I like it that way...
that's all, nothing much...
I totally missed the array variable dimensioning thing...oh well...
Bookmarks