UPDATE -----
The above code is for illistration purposes. I have code that works on the hardware now. The intterrupt function is never entered, but I can tell the RTC is doing something because all of the LEDs flash for a very very short time every second.
Here is the complete code that I am using. Again, any help with this is greatly appreciated!!!
CODE:
------------------------------------------------------
#include <hidef.h>/* for EnableInterrupts macro */
#include "Crt0.h"
#include "FunctionLib.h"
#include "PLM_config.h"
#include "SMAC_Interface.h"
#include "LED_Interface.h"
#include "CommonHeader.h"
#include "UART_Interface.h"
#include "icg.h"
#include "IrqControlLib.h"
void RTC_ISR(void); //Is this the right prototype? I am guessing not.. the datasheet says Vrtc is the vector name
void WaitNms(int n);
void Wait1ms(void);
bool_t Tick = FALSE;
void main(void)
{
IrqControlLib_DisableAllIrqs();
mSETUP_PORT_A // Setup port A
mSETUP_PORT_B // Setup Port B
mSETUP_PORT_C // Setup port C
mSETUP_PORT_D // Setup port D
mSETUP_PORT_E // Setup port E
IrqControlLib_EnableAllIrqs();
RTCMOD = 0x00; //setting the counter value
RTCSC = 0x1F; //enabling the interrupt and configuring the clock source
Led_OffAll();
for( ; ; )
{
if(Tick == TRUE)
{
Led_TurnOnLed(15); WaitNms(750); //Turn on all LEDs and wait
Led_TurnOffLed(15); WaitNms(250); //Turn off all LEDs
Tick = FALSE;
}
else
{
Led_TurnOnLed(1); WaitNms(250); //Turn on 1 LEDs
Led_TurnOffLed(1); WaitNms(250); //Turn off 1 LEDs
}
}
}
#pragma TRAP_PROC //Any idea what this is and/or what it is used for?
void RTC_ISR(void) //Again.. is this the right syntax?
{
RTCSC=0x80; //Reset the interrupt flag
Tick = TRUE; //future - wake up MCU//future - check something//future - put mcu back to sleep
}
void Wait1ms(void)
{
unsigned char i;
for(i=0;i<255;i++) {}
}
voidWaitNms(intn)
{
int i;
for(i=1;i<=n;i++)
{
Wait1ms();
}
}
------------------------------------------------------------
Thanks in advance!!!