Hello all,
I'm trying to get the RTC (clock & alarm) to work with my PIC18F46J11.
I want the microcontroller to execute some code when an RTC interrupt occurs. Eventually I am going to set the alarm time via a serial interface but for now I've hard coded the begin time and alarm time.
Note: I've attached a second external crystal oscillator for the RTC of the PIC microcontroller. I'm using the following code. (compiler is version 4.099)
Via breakpoints and some extra debugging code I noticed that the RTC was indeed incrementing. But I'm not sure that I'm using the correct procedure to set the ALARM functionality. Also, I didn't find anything in the help file regarding the #INT_RTC interrupt routine.
At the moment it looks like the RTC interrupt never occurs when the RTC reaches the alarm time.
Did I set up the microcontroller correctly to generate an interrupt when the alarm time occurs?
I'm not sure since I couldn't find a good example or good documentation regarding this functionality.
Thanks in advance for all the help!
Ttelmah Guest
Posted: Tue Nov 24, 2009 9:54 am
enable_interrupts(INT_GLOBAL);
There are _two_ bits that must be set before an interrupt is responded to. It's own interrupt enable,and the _global_ interrupt enable....
Best Wishes
noxus
Joined: 16 Nov 2009 Posts: 6
Posted: Tue Nov 24, 2009 10:02 am
Thanks Ttelmah!
I cannot believe I forgot the enable the global interrupts.
Thanks a million!
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum