setWatch issue

Posted on
Page
of 2
Prev
/ 2
  • I tried the 'cutting edge build' and have verified that it is working with my 8uS pulse using

    {repeat:true,edge:"falling",hispeed:true}
    

    Thanks @Gordon and @allObjects

  • @Gordon, this new option is absolutely great news. I was looking for something about detectable minimum pulse width, but could not find it. Now we know another tech spec detail and dependency on power (saving) mode.

    I do not really care about the reported pin state, because when push comes to shove, I control it anyway myself. Important is that the pulse comes thu. This even helps for complicated debouncing.

    @billsalt 's addition of the flip flop that cuts the frequency in half and watching both edges is really a great solution pattern.

    The most though I liked the test driver. When I suggested it a while ago I was not sure if it is possible to create such a short pulse... now it's proven (I got the idea from another test driver implementation when exciting an LC circuit for figuring the resonance: Espruino controlling LC resonance experiment in HAM Radio class. In this example I was not sure how high the frequency could go. Since for finding the resonance frequencies, excitement works also just 'provoking' along the harmonics...).

  • Great! Also worth noting that while we do create events for rising and falling edges, to make this work I extended the code to allow some extra flags to be specified when creating a watch. It'd allow us to make some changes to (finally) being able to specify whether to record only rising or falling edges.

    So far that hasn't been a big deal, but at least it can be done relatively easily now.

    One thing to add: The setWatch code isn't smart enough to know whether you have one hispeed watch and one not - so to make this work reliably you can only really have one watch on each pin (if you have >1 watch on a pin it'll use the hispeed setting from the first call to setWatch with that pin).

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

setWatch issue

Posted by Avatar for billsalt @billsalt

Actions