CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

18F87K90 RTC Module Misbehaving

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
SkeeterHawk



Joined: 16 Oct 2010
Posts: 31
Location: Florissant, CO

View user's profile Send private message

18F87K90 RTC Module Misbehaving
PostPosted: Sun May 06, 2012 9:39 pm     Reply with quote

Hello again all.

As always, I am sure it is my code, but this is an unusual problem. I am trying to simply use the RTCC module on the PIC18F87K90 to act as an interrupt source every 10 seconds. I have a 32.768KHz crystal on SOSC. What is happening is that I am able to enter into the interrupt at 2Hz and at 1Hz, but if I try to set it up for an interrupt every 10 seconds (or higher), it never hits the ISR. I will try to simplify my code below to see if anyone has some hints as to what is happening. I can live with every one second, but I would like to know what is broken. Thanks for your intervention.

Code:

#include <18F87K90.h>

#FUSES RTCOSC_T1
#FUSES SOSC_LOW


//  Setup the Real Time Clock / Calendar so that we can start telling time
   setup_rtc (RTC_ENABLE);             //  We'll see if this proves to be useful soon
   setup_timer_1(T1_ENABLE_SOSC);
   setup_rtc_alarm (RTC_ALARM_ENABLE, RTC_ALARM_SECOND, 255);


   enable_Interrupts (INT_RTC);       //  Enable the interrupt for the Real Time Clock
   enable_interrupts (GLOBAL);
   
#int_RTC
void  RTC_isr (void)
{
   output_toggle (HeatLED_Pin);        //  In the interest of seeing what the heck is going on, we are toggling the Heat pin every time this interrupt gets entered
   
}


As always, I appreciate the insight.

Thanks!
_________________
Life is too short to only write code in assembly...
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Mon May 07, 2012 6:19 pm     Reply with quote

Here is another person who says he can't get the 10 second alarm to
work. This is on a different PIC:
http://www.ccsinfo.com/forum/viewtopic.php?t=47901

Also they complain about the 10-second alarm on the Microchip forum:
http://www.microchip.com/forums/m622511.aspx
http://www.microchip.com/forums/m318464.aspx
This person makes some comments about a possible fix (at the end):
http://www.microchip.com/forums/m619152.aspx


What is your compiler version ?
SkeeterHawk



Joined: 16 Oct 2010
Posts: 31
Location: Florissant, CO

View user's profile Send private message

PostPosted: Mon May 07, 2012 10:48 pm     Reply with quote

Thank you for your detailed reply PCM.

I am using version 4.132, which appears to be the most current.

I will look into the alarm settings as they mention and initialize it at least. I disregarded this as I only wanted an interrupt every 10 seconds regardless of what the actual time was.

Otherwise, I will delve deeper into the other possibilities a little without spending too much time on it as I can easily live with an interrupt every second and just count to ten. I was hoping to save some software overhead because I don't really need that much resolution.

Thanks very much again for your insight. It is sincerely appreciated. This forum is definitely something that helps the CCS product rise to the top.
_________________
Life is too short to only write code in assembly...
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2005 phpBB Group