Hi Rob
I got your rtcc_hw lib running on a PIC18F67K22. Thanks for the work.
Some remarks:
Most device files don't have the RTC register pointer spelled out in
bits:
var volatile bit*2 RTCCFG_RTCPTR at RTCCFG : 0
I had to add these:
var volatile bit RTCCFG_RTCPTR1 at RTCCFG : 1
var volatile bit RTCCFG_RTCPTR0 at RTCCFG : 0
Since you are both the author of the rtcc_hw lib and the Honorable
Master of the Device Files, you should pick a solution.
My two cents: tweak the rtcc_lib with bits like:
var bit RTCCFG_RTCPTR1 at RTCCFG_RTCPTR : 1
Furthermore, not all PICs have a T1CON_T1OSCEN, in mine that is
called T1CON_SOSCEN.
I powered my rtcc from the internal clock, since I need the C0 and C1
pins. No, that doesn't make it very accurate (+ 10 min/day!), but it
doesn't need to be.
Having access to hours, minutes and seconds is worth it.
Your clock setting routine is massive, which might overwhelm a
newbie. You have a 12-key keyboard, and you have six numbers to
change. May I suggest using 6 pairs of keys to increase or decrease
these six values (hh:mm:ss dd-mm-yy)? With a repeat freq of 5 per
second, you only need to hold a key for 6 seconds max.
procedure keyboard() is
if getkey() == 1 then hours = hours + 1 end if
if getkey() == 4 then hours = hours - 1 end if
if getkey() == 2 then minutes= minutes + 1 end if
if getkey() == 5 then minutes= minutes - 1 end if
if getkey() == 3 then date = date + 1 end if
if getkey() == 6 then date = date - 1 end if
etc.
I snatched your beautiful bcd2bin() from rtcc_hw and copied it to
math.jal as bcd2bin8(), and added a slow bin2bcd8() as well. I did
find a 9-word (!) assembler one online: http://www.microchip.com/
forums/fb.ashx?m=69632 but it is too obscure and uses mulwf which the
14 bit cores don't have.
I'd love to pull hours, minutes and seconds as binary bytes directly
from the rtcc, but there is no function for that yet.
---
ir EE van Andel [email protected] http://www.fiwihex.nl
Fiwihex B.V. Wierdensestraat 74, NL7604BK Almelo, Netherlands
tel+31-546-491106 fax+31-546-491107
--
You received this message because you are subscribed to the Google Groups
"jallib" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/jallib.
For more options, visit https://groups.google.com/groups/opt_out.