Peter Hinch

Results 371 comments of Peter Hinch

I'm really not in a position to do a full analysis of this substantial chunk of code. I would use one of three approaches. 1. Try to produce a minimal...

The time constant of 10nF and 10KΩ is 100μs. Depending on the threshold levels of the Schmitt triggers, pulses rather shorter than that could get through. You haven't mentioned what...

The waveforms look OK - 4ms between edges should be no problem with hard IRQ's. The callback runs synchronous code. How long does that block for? Another thought is that...

I am confident of the integrity of the exclusive or algorithm for these reasons: 1. The theory detailed [here](https://github.com/peterhinch/micropython-samples/blob/master/encoders/ENCODERS.md#7-algorithm). 2. I implemented it in hardware for an industrial NC machine:...

I've now run [this test (with pin nos. adapted)](https://github.com/peterhinch/micropython-async/blob/master/v3/primitives/tests/encoder_test.py) on a Pyboard 1.1. This is on the basis that it uses the same chip as your board. With `div=4` I...

No debouncing. Optical encoders can produce jitter due to vibration, but they don't produce nasty logic levels. I assume you're running with `div=1`? I wonder if there is a mismatch...

My efforts so far have been on approaching bit-perfect results with a detent-less optical encoder and "good enough for GUI" results with a mechanical one without pre-conditioning. I never considered...

I've thought some more about this and I think accurately tracking the mechanical detents is likely to be difficult. This is because, as a process, it has no fault-tolerance. If...

OK. I don't yet understand why that works, but I'm glad you have something that meets your needs. I'll build some hardware and investigate to satisfy my curiosity about mechanical...

Thank you. I've downloaded it and will study it in detail. Your ISR's are commendably concise :+1: