The manual states that at 4Mhz the resolution is 10us. At 20Mhz it is at 2us. How fast do I need the clock to have a resolution of 1us?
Thanks.
The manual states that at 4Mhz the resolution is 10us. At 20Mhz it is at 2us. How fast do I need the clock to have a resolution of 1us?
Thanks.
Actually that is NOT a silly question. I'm kinda carious myself.Originally Posted by CocaColaKid
My first thought would be in the time it takes to do the routine...
For example...The routine takes a certain amount of "Time" in us to execute. Thus your Pulsin resolution will take a certain amount of time to run through its routine before it can receive accurately the next pulse. If the routine takes 1000 us to read a pulse, then the maximum frequency it can read would be 1 pulse every 1 MS. which is 1000 hz. If you double the clock speed, your Pulse statement can read twice as fast, thus be able to read a pulse every 500 us... giving a 2000 hz speed max.
Dwayne
Last edited by Dwayne; - 17th November 2005 at 19:54.
Ability to Fly:
Hurling yourself towards the ground, and missing.
Engineers that Contribute to flying:
Both optimists and pessimists contribute to the society. The optimist invents the aeroplane, the pessimist the parachute
Pilots that are Flying:
Those who know their limitations, and respect the green side of the grass...
cotang, What statement in the book are you speaking of? If it is something like Pulsin, Rctime the resolution is based on the oscillator frequency and not the instructions being executed.
Dave Purola,
N8NTA
Its under the Picbasic pro manual where it defines Pulsin. Its states that for 4 mhz the pulse width returned is 10us. FOr 20mhz its is 2us. I tested it out and it correct, I just wondering how fast of a clock speed I need to get 1us or 0.5us resolution.Originally Posted by Dave
I would guess 40MHz and 80MHz respectively.Originally Posted by cotang
Guess based on the fact that it must take a minumum number of cycles to execute and the product of Clock in MHz and Resolution in uS seems to remain contant eg
4 * 10 = 40
20 * 2 = 40
therefore
40 / 1 = 40
40 / 0.5 = 80
I also think that 8Mhz would give 5uS resolution
40 / 8 = 5
Keith
www.diyha.co.uk
www.kat5.tv
keithdoxey, 40 Mhz. is correct for getting 1uS resolution. However 80Mhz. would be a stretch for a PIC micro. If you need 1uS resolution why not use the internal timers available in the PIC and use atleast a 4Mhz. crystal? That will give you 1uS. resolution..
Dave Purola,
N8NTA
Hi Dave,Originally Posted by Dave
I realise that a PIC wont run at that speed....yet, but give them a couple of years and we will probably see devices that will run at 100MHz+.
Look at the way Intel and AMD clock speeds have shot up over the last few years!
Also look at how the available memory is increasing as well. PICs are getting evermore powerful
Regards
Keith
www.diyha.co.uk
www.kat5.tv
Athough it might be nice ...
There aren't any defines that would make PulsIn count slower.
A slower OSC freq makes it count slower, or you could create your own define that adds some NOP's to the library routine. (not recommended)
Might just be easier to create a simple subroutine to count the time in a loop, which is all PulsIn does anyway.
<br>
DT
Bookmarks