Interrupt on udoo

Discussion in 'Arduino IDE' started by sebastien28, Jul 20, 2015.

  1. waltervl

    waltervl Well-Known Member

    Joined:
    Dec 12, 2015
    Messages:
    1,269
    Likes Received:
    369
    Hello guys, any update on this? There has been some updates released during the last months. Are your issues solved?
     
  2. matib12

    matib12 New Member

    Joined:
    Feb 9, 2016
    Messages:
    17
    Likes Received:
    7
    I've tried few weeks ago the sketch I posted before. It counted approx. 65000 pulses than hang-up again... If I have time I'll retry this week.
     
    waltervl likes this.
  3. Tony varghese

    Tony varghese New Member

    Joined:
    Apr 7, 2017
    Messages:
    2
    Likes Received:
    0
    @Andrea Rovai The attachinterrupt() function still doesn't work on the latest build. i am trying to read an RC through interrupt (on pin 7) but NEO hangs. I am not using Interrupts() / NoInterrupts() as suggested in docs but still having this issue.
    Anyone had luck with attachinterrupt() function on NEO .
     
  4. Andrea Rovai

    Andrea Rovai Well-Known Member

    Joined:
    Oct 27, 2014
    Messages:
    1,703
    Likes Received:
    237
    Hi @Tony varghese,
    could you give us some more clue about your setup?
    arduino board manager?
    Have you done sudo apt-get update sudo apt-get upgrade? Are you programming from the internal processor or from an external device?
     
  5. Tony varghese

    Tony varghese New Member

    Joined:
    Apr 7, 2017
    Messages:
    2
    Likes Received:
    0
    Hi @Andrea Rovai
    Thank a lot for the fast reply!

    1) Arduino board manager is 1.6.5
    2) I have done sudo apt-get update sudo apt-get upgrade.
    3) i am running from internal processor. A snippet of code which works on arduino due ( verified) which i was expecting to work similarly on udoo neo is put below

    #define ENABLE_PIN 7

    void setup()
    {
    Serial.begin(19200); // setup serial
    attachInterrupt(ENABLE_PIN, EnableRC, CHANGE); //attaching interrupt to pin 7 of NEO
    }

    void EnableRC()
    {
    //record the interrupt time so that we can tell if the receiver has a signal from the transmitter
    last_interrupt_time3 = micros();
    //if the pin has gone HIGH, record the microseconds since the Arduino started up
    if(digitalRead(ENABLE_PIN) == HIGH)
    {
    timer_start3 = micros();

    }
    //otherwise, the pin has gone LOW
    else
    {
    //only worry about this if the timer has actually started
    if(timer_start3 > 0)
    {
    //record the pulse time
    pulse_time3 = ((volatile int)micros() - timer_start3);
    //restart the timer
    timer_start3 = 0;
    }
    }

    }

    Any suggestions?
     
    Last edited: Apr 10, 2017
  6. waltervl

    waltervl Well-Known Member

    Joined:
    Dec 12, 2015
    Messages:
    1,269
    Likes Received:
    369
    Are you sure the interrupt is the source of hanging the Neo?
    Especially println or write commands to serial (ttyMCC) are known for troubles.
    Please try to debug with for example blink the LED on pin 13 instead of using writing to serial. Or use serial0 and connect that serial with an usb-ttl device to the USB of the Neo or another computer. Unfortunately UART6 is not working correctly on the linux side of the Neo so you cannot use that for debugging.
     

Share This Page