I have to make a PID temperature control. I do not want to use any existing inc files though they have helped a lot in understanding. I am starting from basics and would like some help in understanding a few concepts. I am starting with only proportional control for now and will develop the whole code as I go along and will post the whole working code at the end. So, here I go:

I have a 12 bit adc with LM35 connected to it. I have a 16f877a which runs the show.
My questions are:
1) When the error is -ve or zero (i.e. current value is greater than or equal to the set point )then should proportional drive become zero? (i.e. if error.15=1 then prop_drive=0)
2) Can Kp be a positive integer between 1 to 100 or is it better to have it as 1-10 with 2 decimal digit. i.e 1.12/2.34/5.88 ....etc?
3) How does a 0-255 duty cycle relates to value in few hundreds or thousands of proportional drive? For example, if MAX set point is 55 degrees or 416 ADC value and current reading is 200, error is 216, lets say kp is 5 then proportional drive will be 216 x 5 which is far higher than MAX duty cycle of 255. So how do I relate the drive to a number between 0-255?

These are the initial questions I am looking for answers for and will have more as I go along. Thanks