Hi all,
today I would like to share my experience with encoder on scs, the board version made by ilmenator (semper laudetur), attached to MBHP_CORE_STM32F4, midibox_NG project.
I noticed that sometimes, especially when fast rotating my encoder (I choosed a bourns PEC12R), midibox_NG detects more events than really executed, or worse, events in opposite verse.
Using an oscilloscope I saw many spikes on encoder pin, duration shorter than 1 ms.
Following suggestion on attached datasheet (I hope attaching this document is permitted, I did not find any rule against, but if so I will remove it immediately), second page, bottom right, I modified circuit with some patches.
Now it works perfectly, but I have some requests/suggestion to improve design
- if anyone knows, please tell me if there is a NGC parameter to allow debouncing on encoder inputs, otherwise
- for TK, please modify SCS scheme to suggest RC filter usage;
- for ilmenator, please modify your board design and allow to connect necessary 4 resistances and 2 capacitors.
Thanks to anyone,
Regards,
Cristiano
PEC12R.pdf
Hi!
Yes, there is a debounce_mechanism:
SRIO debounce_cycles=<0..65535>
Anyway: Improving the hardware should be better than software debouncing.
Thank you FantomXR, I missed it!
And now I cannot try, damn!
Ok, I am not pretty sure which of two soultion is better, but… who cares
I’m not sure if software debounce affects encoder events? We’ve heard a lot of stories about low-quality Bourns encoders. Better seem to be ALPS EC12.
I use PEC16 without issues.
24 minutes ago, latigid on said:
I’m not sure if software debounce affects encoder events?
You’re right it doesn’t affect it, SW debounce just let some times for the inputs to stabilize, in counterpart we loose reactivity, it’s a balance to find depending on the hardware, and encoder quality of course 
Note: PEC12 and PEC16 are not equivalent(replacement), I also never get any trouble with the PEC16 which is bigger and more solid than the PEC12.
4 hours ago, FantomXR said:
Anyway: Improving the hardware should be better than software debouncing.
Alright! An interesting article.
https://hifiduino.wordpress.com/2010/10/20/rotaryencoder-hw-sw-no-debounce/