• I hadn't done much on this to date I'm afraid. I do have several devices using OneWire on nRF52 that are running constantly, and they do work fine - but I just have to ensure the code can cope with occasional errors and retry.

    Personally, I feel like as @TomWS said, a 15uS delay should really be ok. However Nordic are really super clear on this so I'm very hesitant to add it: https://devzone.nordicsemi.com/f/nordic-q-a/7321/how-to-enable-and-disable-all-interrupts

    Bottom line - you can't do it. The max period you can disable interrupts is ZERO, you may not disable interrupts when the softdevice is running, not for 1ms, not for 1us, not at all, not ever. That is the contract you make with the softdevice. You cannot do time-sensitive operations with the softdevice running. Period.

    I'm not sure about the UART option - you might been external circuitry to combing RX and TX pins.

    However, I looked into the timeslot option and it wasn't too painful to implement, so I've just gone ahead and done it. If you use a cutting edge build now, everything should work.

    Onewire search in particular is quite slow now (1 second) because we use the timeslot API to schedule every single write, but I figure for most people that's a price worth paying :)

    Github issue at : https://github.com/espruino/Espruino/issues/1831

About

Avatar for Gordon @Gordon started