Simple RTC Interrupt Question

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Simple RTC Interrupt Question

ソリューションへジャンプ
1,378件の閲覧回数
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!

ラベル(1)
0 件の賞賛
返信
1 解決策
1,057件の閲覧回数
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 件の賞賛
返信
2 返答(返信)
1,057件の閲覧回数
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 件の賞賛
返信
1,058件の閲覧回数
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 件の賞賛
返信