PWM to 10K digipot?

You don't use PWM, you send 2 bits to raise/lower the pot setting. pina transition high before pinb to raise, pinb transition high before pina to lower.