Hi

I would like to make a small project to read an incremental encoder
with differencial A/B outputs and send its position on request via RS232

I need to count the pulses, determinate if it is going CW or CCW
on a serial request I need to send the number of counted pulses via RS232

Which way shall I go:

Use I/O ports for the A & B pulses and use a Hardware UART to handle the incoming request of the encoder (the request command is only 2 bytes)

Or count the pulses of the encoder with an interupt based routine ?

Any idea's are welcome