Avatar for AndreyVS

AndreyVS

Member since Feb 2021 • Last active May 2021
  • 4 conversations
  • 13 comments

Most recent activity

  • in General
    Avatar for AndreyVS

    Ha! Cool, thanks!

  • in General
    Avatar for AndreyVS

    Gordon, many thanks for the feedback and a useful link to NRF errata!
    Installed v2.09, now the code above does not crash and gives 5 rises - perhaps, that's binary 31 as you assume.

    Yes, that's right - you can probably change it by manually calling pinMode, but by default setWatch would change the pin state to an input.

    On v2.08 pinMode change did not work. But on v2.09 LED lits normally after setWatch :) Watch is not raised.

  • in General
    Avatar for AndreyVS

    Hi! I've got a problem & solution (took me several days to find it.. phew!..).
    I set watch to rising (or falling) D31 and try to lit a neopixel on D2. And Puck (v2.08) hangs..

    setWatch(()=>{console.log('D31 rises!');}, D31, {edge: 'rising', repeat:true}); //D30 here will cure the issue
    require("neopixel").write(D2, [100,100,100,100,100,100]);
    

    If I set e.g. D30 instead of D31, all's ok. The issue is same on a new Puck without any connection to neopixel, one can try the code out of the box. Would be grateful for a comment:

    1. Is there any constraints on pins when using neopixels?
    2. Just to confirm - if I e.g. set watch to LED and then try to lit it, it does not lit. That's probably because a watch blocks output pinMode, right?
  • in General
    Avatar for AndreyVS

    Hi! Cool, Gordon, thanks for the comment. In my case the selftest is run when I set watch with reset() to BTN:

    setWatch(function() {
      LED1.write(1); reset();
    }, BTN, {edge:"rising", debounce:50, repeat:true}); 
    

    When I press BTN for the first time after powering Puck on, the selftest is run (I see all leds lit up and then this message from the topic, then red led blinking). If I further upload and press without powering off, the selftest is not run.

  • in General
    Avatar for AndreyVS

    Many thanks, Robin! Appreciated your explanation of way to search! Your GitHub link shows that at initial selftest it sets pins to 1 & pullup and checks whether state persists afterwards. In my case the pin returns 0, what causes the error.

    Thanks for other questions, ground is common for all elements, Puck is connected through a level shifter (just for a case, a M74VHC1GT125DT1G with grounded control input) and I power a strip with 40 leds via a booster module on MHCD42. All are powered from a Li-Ion, through a 3v regulator (XC6206P302MR) to Puck.

    BTW, at initial state the MHCD42 is turned off, so the level shifter is not powered. But I get the error even when I reset on working MHCD42, when the selftest is performed on working level shifter.. And the story is that I see the error only once per 5-10 resets..

    Anyway, thanks to @Robin the error logic is clear now, if I find its reason, will revert.

  • in General
    Avatar for AndreyVS

    Hi All,
    Sometimes I get a message on Puck v1 (firmware v2.08) after performing reset(): "Pin D2 forced low. Pin D2 shorted low. Error code 12". Pin D2 controls a neopixel led strip (WS2813, works fine), not grounded. Could not find any reference, neither error codes list. What does that message mean, please?

  • in General
    Avatar for AndreyVS

    Cool, many thanks! +1 to Espruino karma: recall Arduino, where one needs to reset pinMode to output after reading a pin..

Actions