AnsweredAssumed Answered

RTC interrupts on MC12311 IC (with embedded MC9S08QE32 MCU))

Question asked by Kevin Oehler on Feb 10, 2012
Latest reply on Feb 21, 2012 by bigmac

Hello!

 

I am experimenting with RTC interrupts and I am having trouble setting them set up. 

 

I have the following: 

     Hardware: X-1231X-MRB (with MC12311 IC (with embedded MC9S08QE32 MCU)) attached to a X-RF-TWR

     Compiler: CodeWarrior for MCU Version: 10.1 Build Id:110726

 

I am trying to get an RTC to trigger and enter an ISR to wake up a sleeping MCU (Stop2) mode.

However, I need to get the RTC working before I experiment with sleeping & waking.

I am following the code example presented in the MC9s08qe32 data sheet with no luck.

I do not know the syntax and/or necessary initializations to for interrupt vectors.

This is my first project on freescale products....

 

My code and understanding is as follows:

---------------------------------------------------------

void RTC_ISR(void)     //Is this the right prototype? I am guessing not.. the datasheet says Vrtc is the vector name

 

//Anything else I need to do here first?? Any MCU ports that muct be defined? Global interrupt enable??

 

void main(void)

{

     RTCMOD= 0x00;   //setting the counter value

     RTCSC=0x1F;       //enabling the interrupt and configuring the clock source

      for( ; ; )

      {

          //wait for RTC interrupt

      }

}

 

#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

     //future - wake up MCU

     //future - check something

     //future - put mcu back to sleep

}

Outcomes