What else must the PIC do, i.e. what are you doing with the count? Is it being displayed on something, or being set on the PIC's ports somehow? What happens at the end of the count? You can decrement a 16 bit number in just 4 cycles (4us at 4MHz) but then you have to add code to pre-load your counter to 8999 and check for zero at the end, so I suspect it won't be possible at 4MHz. Regards Mike Rigby-Jones > -----Original Message----- > From: Workshop Users [SMTP:Workshop@PCM5.PCM.CO.ZA] > Sent: Wednesday, October 27, 1999 8:27 AM > To: PICLIST@MITVMA.MIT.EDU > Subject: counting at 150khz (pic16c84 -04) > > 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