Hi Rob, Indeed, works great, thanks ! I've finally seen the light too ! The "repear" feature is somewhat tricky, because its behavior is somewhat different from usual alarm clocks... Figure 17-5 page 253 from PIC18F47J53 datasheet is the important one: - when period is 10 seconds, you can set an alarm with seconds (in your sample, 5 seconds after RTC is on - when period is 1 second, you can't specify any alarm time, it'll just raise interrupts every second.
This is what Kiste explained and I couldn't understand while checking my sample. Running an alarm only once is also tricky, and can be done by setting a period high enough to include the full alarm time parameters (hours, minutes & seconds), otherwise ISR will be raised each half second (default). Then: - no repeat setting (0), in ISR, check if ALRMEN is off (it's cleared when reaching last repeat, that is, none in this case - setup 1 repeat, in ISR check if ALRMEN is on. When it's off the second time it runs ISR (that is, the actual repeat), it's get ignored. Tricky again: in your setup, when repeat = 5, ISR is actually called six times, the last ALRMEN bit is cleared. Attached is your sample slightly modified to run alarm only once, at specified time. Cheers, Seb -- You received this message because you are subscribed to the Google Groups "jallib" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/jallib?hl=en.
jaluino_bee_rtc_alarm_no_repeat.jal
Description: Binary data
