A PIC can't do 10 bit PWM to 500Khz, since it would need a counter running at 500KHz * 1024 = 512MHz.