Simplest way to count quadrature encoder counts
I'm not familiar with that chip but a quick scan of the datasheet shows that it has four external interrupts. All that should be required is to monitor, say, one of the encoder outputs with an interrupt pin and when triggered count up or down depending on the status of the other encoder output.



Figure 1. Encoder signals and resultant count.

Pseudo code
// Triggered by encoder output A
interrupt {
  if(B) {
    encoder--    // Encoder is running anti-clockwise.
  } else {
    encoder++    // Encoder is running clockwise.
  }
}


You make the encoder variable as many bits long as required for the accuracy you need.