This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

上升沿中断误触发

Other Parts Discussed in Thread: MSP430FR6972, LMS33460

芯片:MSP430FR6972

IDE:IAR6.30

问题描述:

将电路中的一个电容放完电后,插上电源(电池供电),程序出现误动,误动原因是P4.4中断上升沿误触发了,导致逻辑判断出问题了。通过示波器测并没有捕获到这个上升沿(可能方法有问题),而且如果我再插拔电池(相当于电容没放掉电)又没有出现这个问题。

相关代码:

#pragma vector=PORT4_VECTOR
__interrupt void Port_4(void)
{
   switch(P4IV)
 {
#if BAT_VOLTAGE_MONITOR
   case P4IV_P4IFG2:
  Task_Handle_Status.Task_Count++;
  Task_Handle_Status.Bat_Monitor_Task = 1;
#if LOW_POWER
  LPM3_EXIT;      //IRQ0中断 退出低功耗读取数据
#endif    
    break;
#endif
   case P4IV_P4IFG4:
  if(Indicator_Status.WorkStatus == LowPower)
  {
   if(P4IN & BIT4)
   {
#if TEST_CODE
    P7OUT &= ~BIT3//触发指示灯
#endif
     Start_ADC();
    CT_DET_Down();      //设为下降沿触发
    TimerB0_Init();      //开启采样定时器
    Indicator_Status.WorkStatus=Test; //上电检测态
    Indicator_Status.WorkStatus_Detect=Up_Detect_Flag;
   }
  }
  else
  {
   CT_DET_Up();      //设为上升沿触发
   Indicator_Status.WorkStatus_Detect=Down_Detect_Flag;
  }
    break;
   default :
    break;
 }
 P4IV = 0;
}

相关硬件:VCC后面接了一个3300uf电容。这个放完电,接电池出现误动情况。这个图关注的是LMS33460,前面的电路(MCP1702)用电池情况下是没有工作的,接上电池使得VCC升高到3.3V。这也正是我困惑的地方,我接个电池,有D3的存在不应该会动作呀。

  • 7.4.1 Start Up
    As the input voltage (VIN) ramps up, the output (VOUT) remains logic low until VIN reaches 3.15 V due to the builtin
    hysteresis (nominally 150 mV). After VIN crosses that threshold, VOUT remains logic high until VIN drops below
    the 3-V threshold. The hysteresis only applies to the VIN rising threshold.
  • 你好,之前可能没有描述清楚,我那个电路用电池情况是不应该工作的,我把D3后面那个3300UF电容放完电后,再接上电池,就会发现指示灯亮了,而再插拔(电容电还在)不会触发。
  • lms33460从手册上看,在上电过程是有一个上升沿,这是正常的。
    你说的移开电池,只保留电容有电的情况,因为1n5817有反向漏电流,lms33460仍保持在正常的工作状态,所以不会输出上升沿。