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
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