Simple RTC Interrupt Question

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Simple RTC Interrupt Question

Jump to solution
726 Views
koehler916
Contributor II

This is probably very simple but I am new to this. I have a MC12311 IC and I am trying to add an RTC interrupt to my code by manipulating the Linker_QE32 file. My interrupt is written directly before the main loop as follows:

 

void RTC_ISR(void)

{

    RTCSC = RTCSC | 0x80; //clear flag

}

 

My understanding is that I need to add information to the linker file to specifiy that it is vector number is 24 and its address is 0xFFCE & FFCF. The bottom of the Linker_QE32 file specifies the startup vector, so I added the RTC vector as well

 

VECTOR   0 _Startup /* reset vector: default entry point for a C/C++ application. */

VECTOR 24 RTC_ISR /* I added this line!!. */

 

However, upon compiling, I get an error:

"Vector allocated at absolute address 0xFFCE overlaps with sections placed in segment RES_IRQ_VECTOR_TABLE_FLASH"

 

Does anyone know what I am doing wrong? Can anyone suggest what I should try next?

 

Thanks!

Labels (1)
0 Kudos
1 Solution
405 Views
koehler916
Contributor II

After working on this issue over the weekend, I figured out the problem. There was a file called isrvectors.c is the PLM>SOURCE>COMMON>SYS folder that had a vector table.  The linker file did not have to be modified, but the interrupt function had to look like this:

 

#ifdef MEMORY_MODEL_BANKED //Place it in NON_BANKED memory

#pragma CODE_SEG __NEAR_SEG NON_BANKED

#else

#pragma CODE_SEG DEFAULT

#endif

// end MEMORY_MODEL_BANKED

INTERRUPT_KEYWORD

void RTC_ISR(void)

{

    RTCSC = RTCSC | 0x80;

}

#pragma CODE_SEG DEFAULT

View solution in original post

0 Kudos
2 Replies
405 Views
stonejing
Contributor I

Hi,i am student from china.In china,there are no one do some project with MC12311.MC12311 is the latest chip in china,freesacale do not  sell the chip until 2013 . so it is so difficult for us to develop projects about MC12311. We just have MC12311 twr. We do not know how  to create a new project with codewarrior 10.1 ,because there are no MC12311 option. Can you tell us how to create the first project about MC12311 with CW 10.2 and can you give us a complete project (UART,RF etc),thank you!

My e-mail is  iamstone@qq.com . 

0 Kudos
406 Views
koehler916
Contributor II

After working on this issue over the weekend, I figured out the problem. There was a file called isrvectors.c is the PLM>SOURCE>COMMON>SYS folder that had a vector table.  The linker file did not have to be modified, but the interrupt function had to look like this:

 

#ifdef MEMORY_MODEL_BANKED //Place it in NON_BANKED memory

#pragma CODE_SEG __NEAR_SEG NON_BANKED

#else

#pragma CODE_SEG DEFAULT

#endif

// end MEMORY_MODEL_BANKED

INTERRUPT_KEYWORD

void RTC_ISR(void)

{

    RTCSC = RTCSC | 0x80;

}

#pragma CODE_SEG DEFAULT

0 Kudos