ESP32 - Onewire library

Posted on
  • Any ideas how I can debug onewire library?

    I think my wiring is ok, however ow.search() is not returning anything.

    Would the onewire lib be using timer functions that might not be implemented properly yet?

    I added this to get around an error, but have not got any futher:

     case JSHPINSTATE_GPIO_OUT_OPENDRAIN_PULLUP:
        mode = GPIO_MODE_OUTPUT_OD;
       pull_mode=GPIO_PULLUP_ONLY;
        break;
    
  • Personally I'd say you probably want to put a logic analyser on it and compare with a board that does it properly.

    The OneWire library itself should be pretty good now (i mean, it's worked fine on pretty much every architecture) and the only external things it uses are:

    • out_opendrain_pullup
    • the delay function
    • disabling IRQs

    You found the first two, so if they work fine then about the only thing it could be is IRQs jumping in and causing problems.

    Of course if it's like the ESP8266 then it actually 'caches' flash data in RAM and executes from that. If the OneWire + GPIO + delay code isn't in the correct section, it may end up having to be loaded on demand, which would mess up the timings.

  • Thanks @Gordon

    Ok. Maybe time to justify/invest in a logic analyser! Any recommendations? (cheap)

    Using a poorman's Led on the signal line, I can see it glowing dimly.

    The disable/enable interrupts are just stubs at the moment, as the espruino was pinned to a core I was wondering if that was not important - but probably is!

    Time to read the sparse documentation again!

  • I tried a few things to disable interupts but no cigar at this point

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

ESP32 - Onewire library

Posted by Avatar for Wilberforce @Wilberforce

Actions