I'm not 100% sure about the writes you're doing... You need to write 4 to turn it on, but 4<<16 to turn it off (it's a bit set/reset register). I'm not sure that second store is actually turning it off?
@DrAzzy yes, sadly it really is that bad - but on a device by device basis. If it were calibrated for each board then it'd be Ok, but obviously I can't do that very easily. I was looking into a way to calibrate it on the fly against the high speed oscillator, but I haven't had much luck with that to date.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
I'm not 100% sure about the writes you're doing... You need to write 4 to turn it on, but 4<<16 to turn it off (it's a bit set/reset register). I'm not sure that second store is actually turning it off?
@DrAzzy yes, sadly it really is that bad - but on a device by device basis. If it were calibrated for each board then it'd be Ok, but obviously I can't do that very easily. I was looking into a way to calibrate it on the fly against the high speed oscillator, but I haven't had much luck with that to date.