why COP_ISR(void) can not work

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

why COP_ISR(void) can not work

1,304 次查看
明超戴
Contributor II

I use MC9S12XEP100 to test the function cop.

I have found a cop process function ,when the watchdog timer overflow ,the system can reset ,but it can not step into the

COP_ISR(LED can not turn on),Can you help me,thank you !

 

//******************************************************************************

// COP reset

//******************************************************************************

 

#pragma CODE_SEG NON_BANKED

interrupt 2 void COP_ISR(void)

{

    DDRA = 0xff;

    PORTA = 0x00;          //LEDs on - show we entered the COP_ISR    

    for(i=0; i<60000; i++)  //delay

    {

        asm nop;

    }

    PORTA = 0xff;

    asm jmp _Startup;      //jump to power-on reset vector

    // !!! RTI instruction cannot be executed because this is not interrupt !!!

}

标签 (1)
3 回复数

1,159 次查看
RadekS
NXP Employee
NXP Employee

Hi &#26126;&#36229; &#25140;,

Please check capacitor at RESET pin.

The Too big time constant of RC circuit at RESET pin could interfere with COP/CM reset source detection ability.

In short: In the case of a reset, RESET pin will be hold down for 128 OSCCLK cycles. The voltage level at RESET pin will be detected after next 64 OSCCLK cycles. When the low-level voltage is detected, the External Reset source is assumed and POR reset vector is selected.

So, we have to ensure that voltage at RESET pin will achieve high voltage level prior these 64 OSCCLK cycles.

For example, if we take the case when we use 16MHz oscillator, 64 SYSCLK cycles presents 4us.

Therefore, if we have 2.2kOhm pull-up resistor at RESET pin, the capacitance at RESET pin should be below approximately 1.8nF. Otherwise, we detect POR / LVR / Illegal Address Reset / External Reset.

Note: Simply RC cell, RC constant=Tau=R*C represents the time when voltage achieves approximately 2/3 value. Detection level for high value at the pin is also approximately 2/3 value of VCC. So we can use simple calculation: C<64/(R*fOSC). In the calculation, we omitted capacitance and internal pull-up of RESET pin.

For more details please check:

https://community.freescale.com/docs/DOC-103737

Note: There is one additional option. We could connect Schottky diode between MCU reset pin and external RC circuit (capacitor and pull-up). In the case of system reset (caused by MCU), the external capacitor isn’t discharged and COP/CM detection works correctly even with 100nF capacitor. See attached circuit:

RESET_BDM.PNG


I hope it helps you.

Have a great day,
RadekS

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

1,159 次查看
明超戴
Contributor II

Hi Radek Sestak

    

Thank you for your help , I will tryand check  it 。

 

Have a great day

    

                                                       Dai Mingchao

0 项奖励
回复

1,159 次查看
明超戴
Contributor II

Hi Radek Sestak thank you for your help,I have tested it ,use appropriate capacitance the system can step into COP_ISR.

Best Regards

                                                                                                                                       Daimingchao

0 项奖励
回复