Using ETC as input capture to measure pulse period between rising edges of measurement pulse.

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

Using ETC as input capture to measure pulse period between rising edges of measurement pulse.

1,582件の閲覧回数
KY
Contributor I
how can I do it?I have made some process,but  it  can't go to the interrupt process.Such as:

#pragma LINK_INFO DERIVATIVE "SampleS12"
#pragma CODE_SEG DEFAULT
 
void TIM_Init(void)
{
   TIOS_IOS0 = 0;
 TFLG1 = 1;
 TIE_C0I =1;
 TCTL4_EDG0A = 1;
 TCTL4_EDG0B = 0;
 ICOVW_NOVW0 = 1;
 ICSYS_BUFEN = 1;
 ICSYS_LATQ  = 0;
 ICSYS_TFMOD = 1;
 TSCR1_TEN = 1;
}
#pragma CODE_SEG __NEAR_SEG NON_BANKED
/* Interrupt section for this module. Placement will be in NON_BANKED area.*/
interrupt 8 void TI0_Interrupt(void)
{
 
 TFLG1 = 1;          // Reset interrupt request flag

}
#pragma CODE_SEG DEFAULT
ラベル(1)
0 件の賞賛
返信
1 返信

708件の閲覧回数
DanielM
Contributor III
Hi,

have a look at

http://www.freescale.com/files/microcontrollers/doc/app_note/AN3292.pdf

and the associated code

http://www.freescale.com/webapp/sps/download/license.jsp?colCode=AN3292SW&prodCode=MC9S12XDP512&node...

This appnote uses the ECT to capture edges of the input signal and then uses the time between the edges to determine how many bits were "received" on an emulated SCI channel. You should be able to use almost identical ECT set-up for what you waht to do.

Daniel
0 件の賞賛
返信