cancel
Showing results for 
Search instead for 
Did you mean: 

Str912FA RTC

chandrakant
Associate II
Posted on March 26, 2009 at 09:36

Str912FA RTC

2 REPLIES 2
chandrakant
Associate II
Posted on May 17, 2011 at 09:58

I'm using STR912FA44 for our project.

i'm not able to use RTC's periodic interrupt.

when it is enabled CPU gets reset.

Pls can anybody help me?

my initialization routine is as follows:

void InitRTC (Int32U IntrPriority)

{

// Enable RTC clocks

SCU_APBPeriphClockConfig(__RTC, ENABLE);

// RTC Deinitialization

RTC_DeInit();

RTC_PeriodicIntConfig(RTC_Per_2Hz);

RTC_ITConfig(RTC_IT_Per,ENABLE);

// VIC configuration

VIC_Config(RTC_ITLine, VIC_IRQ, IntrPriority);

VIC_ITCmd(RTC_ITLine, ENABLE);

}

s_bhujbal
Associate II
Posted on May 17, 2011 at 09:58

Dear chandrakant.bhor,

I also using same MicroC., I also tried its RTC. Its

initialisations was as follows.

In following example I have used Alarm Interrupt & it was working

fine.

I think You are not initialised RTC completely.

void fnInitRTC( void )

{

RTC_DATE stRTCDate;

RTC_TIME stRTCTime;

RTC_ALARM stRTCAlarm;

//Initialize Date Structure

stRTCDate.century = 20;

stRTCDate.year = 99;

stRTCDate.month = 12;

stRTCDate.day = 31;

stRTCDate.weekday = 5;

//Initialize Time Structure

stRTCTime.hours = 23;

stRTCTime.minutes = 59;

stRTCTime.seconds = 45;

stRTCTime.milliseconds = 00;

//Initialize Alarm Structure

stRTCAlarm.day = 1;

stRTCAlarm.hours = 00;

stRTCAlarm.minutes = 00;

stRTCAlarm.seconds = 15;

RTC_SetDate( stRTCDate );

RTC_SetTime( stRTCTime );

RTC_SetAlarm( stRTCAlarm );

//Enable Alarm Interrupt

RTC_ITConfig( RTC_IT_Alarm, ENABLE );

VIC_Config( RTC_ITLine, VIC_IRQ, 10 );

VIC_ITCmd( RTC_ITLine, ENABLE);

//Enable Alarm

RTC_AlarmCmd( ENABLE );

}//fnInitRTC

All the Best

Sachin Bhujbal