Andy's explanation is correct but a little more explanation may help. A BSF and BCF instruction both implement their actions(a set and a clear respectively) at the same point in the cycle. As BCF & BSF are 1 cycle instructions and the clock is 10MHz and the clock is divided by 4, each cycle is 4 x 100nS = 400nS. In this case as the instructions are implemented one after the other there is a 1 cycle delay between the rise and the fall. The width of the high pulse is therefore 400 nanoseconds as expected. If you implement a series of these you get an overall cycle (one high pulse and one low pulse) of 800 nS = 1.25 MHz. The biggest confusion MAY come from the fact that the 10 MHz clock is divided by 4 to produce one basic PIC cycle. -----Original Message----- From: Andrew Warren To: PICLIST@MITVMA.MIT.EDU Date: Thursday, 16 April 1998 20:16 Subject: Re: PIC 16X84 Andrejus Stavickis wrote: > i have made some hardware, but pic is not running fast enought: > ........ > bsf PORTB,5 > bcf PORTB,5 > ........ > > in configuration i have used XT oscillator and in hardware ceramic > 10 MHz oscillator > .... > and in after this on 5 pin i have got sometnig like: > > +----+ + > | | | > | | | > | |____| > : : > : : > freq something like 1.25 MHz. Is it normally or i have missed > somenthing ? Andrejus: This is exactly normal; each PIC instruction cycle takes 4 clock cycles, so your "BSF" and "BCF" instructions each take 0.4 microseconds. -Andy === Andrew Warren - fastfwd@ix.netcom.com === Fast Forward Engineering - Vista, California === http://www.geocities.com/SiliconValley/2499