The Time of MC9S12XS128 in debugging and normal area

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

The Time of MC9S12XS128 in debugging and normal area

Jump to solution
2,145 Views
myonlystar
Contributor I
我使用了微控制器(MC9S12XS128)捕捉脉冲宽度。它曾在调试模式,但同时,结果变得不同,我相信,这是去食堂。因此,它怎么能走呢?
我打开的TIM(TSCR1_TEN = 1)和明确的时间(TCNT = 0)的编号。之后,它才得到的IO(PT0)的TIM的人数(1 = TCNT)为0。
当然,当PT0下降,该TCNT正在清洗(TCNT = 0)。
这就是所有。
但是,当我们在正常模式下,输出是不对的。

 

我使用了微控制器(MC9S12XS128)捕捉脉冲宽度。它曾在调试模式,但同时,结果变得不同,我相信,这是去食堂。因此,它怎么能走呢?


我打开的TIM(TSCR1_TEN = 1)和明确的时间(TCNT = 0)的编号。之后,它才得到的IO(PT0)的TIM的人数(1 = TCNT)是0.Of当然,当PT0下降,该TCNT正在清洗(TCNT = 0)。

这就是所有。


但是,当我们在正常模式下,输出是不对的。

Labels (1)
0 Kudos
1 Solution
528 Views
kef
Specialist I

Please translate your first post, it's not readable.

 

TCNT is not writeable in normal modes.

 

 

           But how to get the TIME number?

 

I don't understand this question. Do you mean how to measure something?

 

unsigned short t0, t1, tdif;

 

    t0 = TCNT;  // get TCNT before something

    something();

    t1 = TCNT; // get TCNT after something

 

   tdif = t1 - t0  // difference is TCNT ticks spent in something

 

View solution in original post

0 Kudos
3 Replies
528 Views
myonlystar
Contributor I

ADD:

 

 

          TCNT=0xf0;  

          PORTB=~TCNTL;  

 

The two sentence goes wrong in normal single module, however they are right in debugging.  I think the TCNT could not be read in normal single module. 

 

But how to get the TIME number?

0 Kudos
529 Views
kef
Specialist I

Please translate your first post, it's not readable.

 

TCNT is not writeable in normal modes.

 

 

           But how to get the TIME number?

 

I don't understand this question. Do you mean how to measure something?

 

unsigned short t0, t1, tdif;

 

    t0 = TCNT;  // get TCNT before something

    something();

    t1 = TCNT; // get TCNT after something

 

   tdif = t1 - t0  // difference is TCNT ticks spent in something

 

0 Kudos
528 Views
myonlystar
Contributor I

I am a freshman here. 

 

Thank you very much. I have solved the problem.

 

 

 

0 Kudos