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.

MSP430AFE221: False interrupt on the controller

Part Number: MSP430AFE221

Hello everyone,

Greetings of the day, i have been working with embedded systems for quite a while now, currently i am working on a project that dispenses water depending upon the balance from rfid card, however the system has start stop and recharge buttons connected to interrupts of microcontroller with internal pull-ups driven from falling edge. The system works fine mostly however in some cases false interrupts are detected that causes functions to be activated for respective buttons i.e. start stop or recharge. I tried adding a coupling capacitor and a schmitt trigger circuit to stabilize the input but it still detects the false signals of noise.

 

Moreover a small touch on the interrupt terminals(buttons not connected ) also causes the interrupt to be triggered, any suggestions are appreciated.

 The interrupt service  function just hosts a flag which is then checked in the main loop.

 

Thank you in advance.

 

EDIT:-

As suggested I tried:-

1. Adding an external pullup of values ranging from 1.5k-10k but the issue persists

2. Adding the decoupling capacitor

3. Power supply is fixed and using a bench supply of 24volt stepped down by a MORNSUN buck converter.

4. Not tried the debouncing test since the problem is not related to button press. Even if the button is not pressed, if I touch the open end of wire connecting the interrupt terminal then also it triggers the interrupt.

5. the pin is not routed near a power rail or a high frequency coil/trace.

  • Hi,

    could you share your pin configuration?
    Did you already check the Device Family User's Guide to see if your configuration maps the description?
    Is the issue reproducible, i.e. is the interrupt always triggered in a certain scenario? If so, please share under which conditions as it might help to pin down the root cause of the issue.

    Please answer the questions for me to further evaluate your observation.
    Thanks and best regards,
    Britta
  • I am using the similar interrupt example for my system,

    void main(void)
    {
    WDTCTL = WDTPW + WDTHOLD; // Stop WDT 
    CCTL0 = CCIE; // CCR0 interrupt enabled
    TACTL = TASSEL_2 + MC_1 + ID_3; // SMCLK/8, upmode
    CCR0 = 10000; // 12.5 Hz 
    P1OUT &= 0x00; // Shut down everything
    P1DIR &= 0x00; 
    P1DIR |= BIT0 + BIT6; // P1.0 and P1.6 pins output the rest are input 
    P1REN |= BIT3; // Enable internal pull-up/down resistors
    P1OUT |= BIT3; //Select pull-up mode for P1.3
    P1IE |= BIT3; // P1.3 interrupt enabled
    P1IES |= BIT3; // P1.3 Hi/lo edge
    P1IFG &= ~BIT3; // P1.3 IFG cleared
    _BIS_SR(CPUOFF + GIE); // Enter LPM0 w/ interrupt 
    while(1) //Loop forever, we work with interrupts!
    {}
    } 
    
    // Timer A0 interrupt service routine 
    #pragma vector=TIMERA0_VECTOR 
    __interrupt void Timer_A (void) 
    { 
    P1OUT ^= BIT0; // Toggle P1.0 
    } 
    // Port 1 interrupt service routine
    #pragma vector=PORT1_VECTOR
    __interrupt void Port_1(void)
    { 
    P1OUT ^= BIT6; // Toggle P1.6
    P1IFG &= ~BIT3; // P1.3 IFG cleared 
    }




  • Hi,

    thank you for sharing your configuration.
    Could you explain in detail when a false interrupt is triggered? I.e. does it only happen when you touch the open wire? Could you possibly ground the pin when touching it so that the falling edge is detected? Please clearly describes what is done before the interrupt is triggered and if this is reproducible.

    Thanks and best regards,
    Britta
  • So the overall system consist of a lot of peripherals communicating through the SPI bus, I2C bus and UART. I have connected 3 interrupt pins for subroutine operations, we have to connect a push button via a wire that grounds the pin with pressed. The interrupt pin is pulled up and connected to a screw terminal for connections with the button. Cases when false interrupt are triggered:-

    1. When the wire is not connected, interrupt is pulled up, we touch the pin terminal with a metal.

    2. The wire is connected and button not attached to the end, When we touch the other end of wire the interrupt gets triggered.

    3. When both the wire and button are connected, It sometimes works just fine, following the normal routine and the subroutine when button is pressed. However in some cases there is an interrupt detected and the subroutine called. We have tested 10 systems in this configuration and around 4 of them show this behavior.

    Also note that there are no power rails in the vicinity of the interrupt trace that may cause any problem.

    The whole is PCB has ground plane for noise immunity in order to ground any noise element.

    Thank you

  • Hello Shwetank,

    Since the issue seems to be triggered by just touching the terminal, it seems like a hardware problem. As you suggested, it seems there is a lot of noise in the system and on the input line.

    Can you monitor the signal with an o-scope? I think we should monitor the input pin triggering the interupt, the Voltage rail used for pull-up, and the VCC rail to the MSP430. Hopefully you should be able to see a clear pull down from pressing the button and an increase in noise causing the false triggers when touching the wire.

    Please share any meaningful captures here.

    Finally, how long are these wires?

    Do you see any dominating freqencies in the noise?

    Do you have anything in your system switching at a harmonic of that freq?

    Thanks,
    JD
  • Hey Shwetank,

    We're you able to fix your interupt issue?

    Thanks,
    JD
  • Hi everybody,

    Sorry for the delayed response from my side, I tested the interrupt terminal using a digilent USB scope and found the attached result when it is touched with a metal stick.

    Note that this only happens when we give an external touch. Is it due to hardware design?

    Are there any steps that I can do to minimize this so that no false interrupts are processed by the core.

    Thanks

  • Hey Shwetank,

    Thanks for the captures!   This does seem to be a problem from the hardware design/debounce circuitry. 

    Have you tried also adding a few different sizes of capacitors?  It looks like these are extremely quick pulses, so I think they should be able to be smoothed out with a larger capacitor.   

    If that doesn't work, can you provide a schematic for the circuit connected to the GPIO for the community to review?    

    Thanks,

    JD

  • hi,

    Yes the spikes are of approx. 20micro seconds. Earlier we added parallel bypass capacitors 0.1micro value but during the initialization, the system used to hand and no functionalities were working so once we removed them it used to come back to life. That was the reason for not connecting any caps in the circuit.

    The further wires goes to interrupt pins of the controller. However as described above, in the actual board we have depopulated these capacitors to avoid charging discharging that perhaps caused the system hangs.

    Also I have tried using RC circuits with 0.1micro cap and 1-10K resistor but the response were more or less similar.

    Thanks

    Thanks

  • Hey Shwetank,

    Thanks for the feedback. I think this issue can be fixed with standard debounce technicques.

    Hardware: It sounds like the 1uF capictors are to large with 10k resistions and are interfering with the communication. because these pulses are so small, we don't need a large RC time constant. There are some debounce calculators online to help suggest the right size cap for debouncing. I would probably try something in the 20-50pF range with a 10k resistor and see if that works.

    Software: Another solution is to implement a software debounce. You can search the E2E forums for many discussions on this but I found a good discussion: e2e.ti.com/.../1730534

    Thanks,
    JD

  • hello  

    Thanks for the suggestions on finding the right hardware filter and choosing a smaller capacitor for the same. However I faced some problems earlier while using a software debounce routine.

    I used the timer approach for waiting for 5ms and then rechecking the signal for available interrupt and hosting the flag accordingly. However this solved the issue in three of four terminals but one terminal which is connected to a pulse output of another device that gives 1s LOW pulse output at indefinite intervals used to get stuck in the subroutine since the input from that device triggered the interrupts using the same spikes that I discussed with you guys.

    Note that in case of the pulse output device I am using a long wire about 10meter to get the 24volt pulse and then drop it down to microcontroller level using a regulator. When the terminal is not at all connected, it works fine but while I connect it to the device, I see these spikes all again, that triggers the interrupt and due to timer delays it gets stuck at that point only.

    The other interrupts however works fine when I use the delay.

    Thank again

    Regards

  • Hey Shwetank,

    Glad that a software debounce fixed most of the issues. I don't quite understand what the signal/noise looks like on the last pin that is giving you trouble. If you share a capture or diagram of what you are seeing, someone in the community may be able to make a recommendation. You might need to have a seperate custom software debounce for this case, etc.

    Also, I don't think your software should ever get stuck, unless there is constant noice triggering interrupts. Is that the case?

    Finally, due to the holidays, our responses will be delayed for the next 2 weeks. Thank you for your patience.

    Thanks,
    JD
  • Hi,
    What happens exactly is that the interrupt terminal is connected to this pulse output device via a long wire i.e. dual core shielded. Now when the wire is connected between the two devices we get noises continuously that calls the interrupt routine frequently enough to get stuck in the same subroutine where the delay is present as a software debounce.
    It would be really helpful if you can suggest the custom software for the same or maybe any noise filter at the interrupt side to smooth out the noises.
    I hope to hear soon.
    Happy holidays....
    Thanks
    Regards
  • Hello Shwetank,

    We cannot help further on this issue. From the information discussed in this thread, a solution can be devised between both software and hardware applications . You'll need to customize your solution in order to meet the needs of your specific application. A timeout for this particular interrupt, or only enabling the interrupt when you want to listen for it are some examples of workarounds to your issue.

    Thank you, and happy holidays!

**Attention** This is a public forum