My somewhat outdated CCS compiler does delays using NOPs in a loop, not=20 a timer. Also, the 877 has no internal oscillators. Since you don't enable interrupts (and they default to 'off'), it seems=20 to me it can only be 2 things: 1) The debugger is using a LOT of time (seems unlikely) 2) The oscillator is not really running at 4MHz. Try running without the debugger (config=3D0F09), because that's easy. If that doesn't do it, write your own delay ms_delay(int d) // Only works with 4MHz clock!!! { for(i=3D0;i sorry i missed some details which might be important in solving this > problem. > > I started with my first project but it didn't worked so i decided to go b= ack > and blink leds,now the problem is when the delay between on off was set > 10ms the leds took 2.3sec(used a stopwatch n delay was approx. 2.3sec). > At first delay was set to 500ms but it took too much time to blink so del= ay > was set to 10ms. > CCS compiler demo version was used for compiling , 4MHz crystal oscillato= r > was used with 22pF capacitors and configuration bits 2F09 were entered in > PICKIT 2 v2.61 (not used in the code) > > #include <16F877A.h> > #use delay(clock=3D4000000) > void main() > { > while(1) > { > output_D(255); > delay_ms(10); > output_D(0); > delay_ms(10); > } > } > please solve my problem guys. > thank you and sorry again for missing the details in previous post. > =20 --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .