help: timer doesn't run in simulator but runs in emulator

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

help: timer doesn't run in simulator but runs in emulator

4,391件の閲覧回数
Wind
Contributor I
hi
I am using Metrowerks code warrior V3.1.
I have one very simple timer overflow interrupt routine written.
This timer TCNT does not run in simulator but it runs in emulator.
 
any setting in the simulator to make the timer run?
 
 
regards
ラベル(1)
0 件の賞賛
返信
5 返答(返信)

671件の閲覧回数
CrasyCat
Specialist III

Hello

Which MCU (derivative) are you trying to simulate?

We may not have simulation for all peripherals.

CrasyCat

0 件の賞賛
返信

671件の閲覧回数
Wind
Contributor I
hi crazyCat,
 
I am using MC9s12NE64.
 
 
0 件の賞賛
返信

671件の閲覧回数
CrasyCat
Specialist III
Hello

I assume you are trying to use the PIT to generate interrupt.
I looked in V4.5 reference manual.
Periodic Interrupt Timer (PIT) is not simulated. That is the reason your interrupt is not generated in the simulator.

Anyway when running your application in the simulator. Did you see a messaged "writing to unimplemented register at pc = ..."?
This is basically how the simulator tells you you are trying to use a non-simulated device.

CrasyCat
0 件の賞賛
返信

671件の閲覧回数
Wind
Contributor I
hi,
 
sorry that I didn't make my statement clear. actually I posted this problem in the forum few days ago with the subject: timer overflow interrupt. Since no one reply to that forum and I find out that it is the simulator issue, I post it again here as new thread.
 
I just implemented a very simple timer overflow interrupt.
 
below is the sorce code:
Code:
#include <hidef.h>      /* common defines and macros */#include <MC9S12NE64.h>     /* derivative information */#pragma LINK_INFO DERIVATIVE "1"volatile unsigned int count;void main(void) {  /* put your own code here */   TSCR1=0X80;//enable timer   TSCR2=0x85;  //select prescler bus clock/32  TFLG2=0x80;// clear timer flag   EnableInterrupts;   for(;;)   {    } /* wait forever */}#pragma CODE_SEG NON_BANKEDinterrupt void _Timerovf(void) { TFLG2 = 0x80;// clear the interrupt flag   count++; //increment counter   }   #pragma CODE_SEG DEFAULT

 
you quote:
Anyway when running your application in the simulator. Did you see a messaged "writing to unimplemented register at pc = ..."?
 
There is no message showing.
 
 
 
0 件の賞賛
返信

671件の閲覧回数
CrasyCat
Specialist III
Hello
 
I would then suggest you to upgrade to V4.5.
 
I could successfully reach the timer overflow interrupt with V4.5 using the attached project.
I am not able to test that on V3.1 as I do not have the NE64 service pack installed.
 
CrasyCat
0 件の賞賛
返信