greetings, I am a novice at the whole pic thing. I hope to change that with many experiments and networking with people like you guys.

anyway, I am trying to control a PWM with a 10k pot. It is for controlling the dimming of an LED driver. I have the pot hooked up correctly and am getting proper readings. I am using the pot command to read. Given that this gives me a number from 0-255, it seemed perfect to set a variable and plug it right into the hpwm command. I then let it loop, looking for changes in the pot. The drivers frequency is 10khz and outputs current to the led when the pin goes low.
Unfortunately what I get is a very erratic blink that really has no continuity with the pot being adjusted. Any ideas?

here is the code, remember, Im an extreme beginner.

----------------------------------
define OSC 8
v1 var byte 'Variable v1 holds pot information

high portc.2
pause 100
High portd.2 'power indicator

main:
pot portd.1,23,v1 'Read resistance of pot
Hpwm 1, v1, 10000 'hardware pwm on RC2
pause 100
goto main


End
-------------------------------

as for hardware, I am using a buckpuck made by luxdrive. It is a 1 amp LED driver that gives a regulated 5v reference for microcontroller power, it also has a control return which I hooked the pwm out pin (RC2/CCP1) to. I have an led indicating the chip is on & running. I also have a 10k pot with capacitor for the dimming adjustment. MCLR is pulled up with a 4.7k. I am also running an 8mhz crystal with two caps.

thanks in advance for your feedback.