[Ktechlab-devel] instruction cycles
David Saxton
david at bluehaze.org
Sat Feb 18 14:02:06 UTC 2006
Fixed. Thanks for the report :)
On Friday 17 February 2006 14:28, deifo at ono.com wrote:
> Recently I was experimenting with little programs and KTechLab, but
> sometimes strange things happen.
> For example, why is this program producing a perfect square wave in RA4
> output?
>
> loop:
> BSF PORTA, 4
> BCF PORTA,4
> GOTO loop
>
> According to the pic specification, GOTO should take 2 cycles and B?F
> should take only 1 cycle.
>
> To correct this, we must add two NOP's after BSF, is this correct?
> With this little program we should have a perfect square wave on the RA4
> pin.
>
> loop:
> BSF PORTA, 4
> NOP
> NOP
> BCF PORTA,4
> GOTO loop
>
More information about the Ktechlab-devel
mailing list