Port A and B can be configures as either quadrature encoder
input or step and direction input. When used as Step and Direction, you can use port A as a high speed counter
Simply issue "MS0" (stands for Mode-Step-Zero).
This will clear out the external encoder counter register
(CTR) and set it to zero.hen for each incoming pulse on port A, CTR will increment (or decrement) it's value depending on the logic level of port B.
You can also set Port B as an output and control the
direction of count.his method can be sued to reliably count at rates up to 2megahertz.
The administrator has disabled public write access.