Olimexino/MapleRET6 setInterval problem

Posted on
  • When running the toggle LED from the Quickstart page the LED does not blink steadily.
    It appears that there may be multiple calls to the setInterval callback function, toggle().
    The shorter the interval the more noticeable the erratic blinking.

    The boards are running off a battery with the console on serial1.

    This happens with v1.72 .
    with v1.71 I get no response from the boards
    however with v1.70 this works as expected (steady blink).

    function toggle() {
     on = !on;
     digitalWrite(LED1, on);
    }
    
    var interval = setInterval(toggle, 200);
    
  • You're not building it yourself using the code sorcery compiler, are you? That one produces builds where time keeping is busted - you want to use the one Gordon uses, listed in the change log on github

  • I'm building it myself using:
    gcc-arm-none-eabi-4_8-2014q3/
    This seems to work fine for the Espruino_1V3 board.

  • Okay, yeah, then it's not the same problem I had (with the old compiler, time is busted on v72, but not v70)

    Is getTime() returning correct values, or bogus ones?

  • getTime() is returning monotonically increasing values at what appears to be a steady rate.
    Although I just timed it for 5 minutes and getTime() indicated that 8 minutes had elapsed.

  • Sounds like the Espruino firmware thinks the chip is clocked at 5/8ths the speed it actually is.

    That doesn't explain why the intervals don't run at a constant speed, though.

  • There's sometimes a bit of wobbling at first with the Espruino boards as the RTC and SysTick timers struggle to get in sync. I guess it's possible that it is another issue to do with the 12 byte variables though.

  • ret6 should have 16bit var refs

  • Yes, @user51876 is correct. This occurs on both the Olimexino (12 bit vars) and the MapleRET6 (16 bit vars). Also, as @DrAzzy suggests; I will check my build environment.
    I will play around with the clocks. I have noticed it sometimes takes a few pokes to get the LSE clock going.

  • @jlawson actually for anything non-espruino-board, the Low Speed Oscillator shouldn't be needed - it works entirely using the SysTick timer.

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

Olimexino/MapleRET6 setInterval problem

Posted by Avatar for jlawson @jlawson

Actions