hi,

yes i got your point now and correcting my coding now but then i realize how to define my dutycycle value from the lookup above since dutycyle register only accept numbers. example

For DUTY1 = 0 TO 44

LookUp DUTY1, [0,18,35,53,70,87,104,120,135,150,164,177,190,201,2 11,221,229,236,_
243,247,251,254,255,254,251,247,243,236,229,221,21 1,201,189,_
177,164,150,135,120,104,87,70,53,35,18,0],DUTY2

Duty2 = ?????? ' duty cycle. 1024/2 "10-bit resolution"
CCP1CON.4 = Duty1.0 ' Setup 10-bit duty cycle as
CCP1CON.5 = Duty1.1 ' a 10-bit word
CCPR1L = Duty1 >> 2
next DUTY1


what should i define the duty2 value since i want it to read from lookup table?

photoelectric