Self-executing interrupt problem

49 views
Skip to first unread message

William B

unread,
Jul 21, 2017, 4:52:06 PM7/21/17
to BeagleBoard
Hello! I'm using an interrupt with Beaglebone Black as indicated below, however I'm having problem. 
PROBLEM: The interrupt that goes through the callback function "toggleState" is triggering itself, without any external reason or action.

Has anyone seen this happen and knows how to solve it?


EXAMPLE:

myInput = 'P9_11';

b.pinMode(myInput, b.INPUT); 
b.attachInterrupt(myInput, true, b.CHANGE, toggleState);

function toggleState(x) {              <<==== Running for no reason
    console.log('Interruption triggered');  
}

John Syne

unread,
Jul 21, 2017, 5:10:55 PM7/21/17
to beagl...@googlegroups.com
In toggleState, use console.log(JSON.stringify(x)); to see why the interrupt triggered.

Regards,
John




--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to the Google Groups "BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/51f710e8-8055-4f1f-aa80-c6eb22289d13%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

William B

unread,
Jul 21, 2017, 5:34:55 PM7/21/17
to BeagleBoard
John, in the correct execution of the interrupt, that is, when I press a button so that the interrupt is actually executed, the answer is this below. I'm still waiting to know if self-interrupt will run again and then see what new response from "console.log (JSON.stringify (x))".

Response to the correct interrupt:
{
    "pin": {
        "name":"UART4_RXD",
        "gpio":30,
        "mux":"gpmc_wait0",
        "eeprom":18,
        "key":"P9_11",
        "muxRegOffset":"0x070",
        "options":[
                        "gpmc_wait0",
                        "mii2_crs",
                        "NA",
                        "rmii2_crs_dv",
                        "mmc1_sdcd",
                        "NA",
                        "NA",
                        "gpio0_30"
                    ]
    },
    "value":0,
    "output": {"handler":true}
}

What should I observe in this response when the error occurs again?

William B

unread,
Jul 21, 2017, 6:01:06 PM7/21/17
to BeagleBoard
Hello again John. I was able to observe the error occurring and the interruption being executed without reason. But the response from "console.log (JSON.stringify (x));" was still the same when the interrupt was executed correctly, ie when I pressed the button.

So, if you have any suggestions, I appreciate any help.

John Syne

unread,
Jul 21, 2017, 6:42:39 PM7/21/17
to beagl...@googlegroups.com
Do you have a resistor pull up or pull down on this pin? If your button pulls the GPIO pin low, then you need a resistor pull up of at least 10K. It seems like you don’t have this resistor connected and hence noise is triggering the interrupt.

Regards,
John




On Jul 21, 2017, at 3:01 PM, William B <wbbe...@gmail.com> wrote:

Hello again John. I was able to observe the error occurring and the interruption being executed without reason. But the response from "console.log (JSON.stringify (x));" was still the same when the interrupt was executed correctly, ie when I pressed the button.

So, if you have any suggestions, I appreciate any help.

--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to the Google Groups "BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard...@googlegroups.com.

William B

unread,
Jul 21, 2017, 9:25:27 PM7/21/17
to BeagleBoard
I think you're right John. I don't have a pulldown resistor. I forgot it... I'll try again now and let you know the answer when I'm done. Thanks!!

William B

unread,
Jul 22, 2017, 8:00:23 PM7/22/17
to BeagleBoard
I'm still testing, but I think the problem was even the lack of resistors.
Thank you again!





Reply all
Reply to author
Forward
0 new messages