your code complies ok for me
chk pic16f15009 microcontroller selected and mpasm assembler selected
for 10 bit pwm you need to
pot1<<6 before you load the regs
psCode:pot1=pot1<<6 PWM1DCH = POT1.HIGHBYTE PWM1DCL = POT1.LOWBYTE
I'm assuming pot1 is 0-1023 value of course
you could be clever here an not right justify adc reading and save a step




Bookmarks