2021-04-24 11:04 PM
the sampling logic and countig is not very standard:
1) If A = rising edge and B = 0, counter++
2) If A = falling edge and B = 1, counter++
3) If B = rising edge and A = 1, counter++
4) If B = falling edge and A = 0, counter++
5) If A = falling edge and B = 0, counter--
6) If A = rising edge and B = 1, counter--
7) If B = rising edge and A = 0, counter--
8) If B = falling edge and A = 1, counter--
Since the M4 core is doing other things during the sampling i do not want to use interrupts as the solution to this problem.
Please help me understand wether this is possible using some king of HW interface (perhaps timer?)