Han Giap WROTE:hi Shahrul,
thanks for the info... very appreciate it
i would like to know... is ur port A as input? n ur servo motor connected to port C (CCP)?
thanks
Port A as analog input to set Servo Position value. refer " read_a2d(0) ", that is read channel 0.
Servo at RC0. refer " #define servo RC0 ". This output not using CCP Module, as I describe, just using counter in the interrupt function.
As alternative, you don't need analog input, you can set servo position manually.
Eg,
position=10;
for(i=0;i<100;i++) __delay_ms(10);
position=50;
for(i=0;i<100;i++) __delay_ms(10);
wish you good try.