HPWM and PWM is between 0-255 and a 10 bit read for the a/d results in a 0-1023 reading. Divide a/d result by 4 or reduce resolution to 8 bit.