Workshop Users wrote: > > Hi to all. I am new to using PIC's and am a but stuck. > I want to count down from 8999 (d) to zero in 60ms , and then repeat. > This works out as counting at about 150khz. Am using a pic 16c84 at 4Mhz. > I wrote a routine to do this , but as I am a beginner my code was not all > that good:0) , > and it took to many instruction cycles and was hence to slow.It needs to > count at > 1 count per 6.6us about.I can use TMR0 and I can use an external clock > source > if need be. > Am I going to have problems because the PIC is to slow maybe? > Any help would be appreciated. > Cheers all > Rob ; PULSOUT port, pin, time ; Generates an output pulse in 10-cycle (10 us at 4 MHz) units, ; based on a 16-bit (1 to 65,535) value. The pulse is the reverse ; of the pin's state when pulsout is called. For instance, if the ; specified pin is initially 1, Pulsout will invert it to make a ; negative-going pulse. Half of Pulsout's 10-cycle delay is produced with nop instructions. If you want a 5-cycle version of Pulsout, remove the nops. found at: http://www.dontronics.com/convert2.html#pulsout Don McKenzie mailto:don@dontronics.com http://www.dontronics.com Don's Download Dungeon: http://www.dontronics.com/download.html Australian Electronics Ring http://www.dontronics.com/aering.html Win $500USD Cash. Micro design contest: http://www.simmstick.com