> > Byron A Jeff wrote: > > Again I'm confused. Presuming the signal is in the 15 Mhz range (67 ns perio d) > > and a PIC is running with a 5Mhz instruction clock (200 ns period), then eve n > > if such a chip existed, the finest resolution that the PIC could control the > > counter is at 3 count intervals, which is the number of ticks the counter > > would clock inbetween instructions. Right? > > > > Is the exact count necessary? Then you need something quite more complex tha t > > could be programmed with the amount of time to gate the incoming pulses alon g > > because the PIC isn't fast enough. > > > > If an exact count isn't necessary, then you simply prescale the count and le t > > the PIC count it. > > > > But in any case the PIC's prescaler and count hardware is fast enough to > > handle the signal.... > > > > BAJ > > Well, its application requires a minimum counting of 15MHz, and it is > not > a pulse counter, but a frequency counter, what means it can stay holding > the counting as long it needs to read the shift register. So what's the maximum frequency? > > The counting gate is easily calculated with the PIC instruction > execution > time versus quantity of instructions, the common time loop, so it is > easy > to make a high precise counting gate even with a pic. Using a round > number > crystal frequency it will go to the crystal precision and accuracy. But if the frequency of what is counted is a lot higher than the frequency of the PIC then you cannot have precise control over the precision of the counts. No to within one pulse. Say you have a frequency that's 8 times faster than the PIC. The accuracy of the count you get will only be within 8 pulses of the actual number of pulses due to the slowness of the PIC's clock. So would it then not be better to simply prescale the pulses by 8 and let the PIC count the results? > > There is another problem involved, I didn't say at the first post, the > pic > will serve just as an interface between the device that will make use of > the data and the 8 (yes, eight) counters like that working at the same > time. I guess the real question is there a requirement for each of the counts to be taken at the same time. Since the interface PIC can hold and count as necessary, simultaneous counting doesn't seem to be a strong requirement. If that's the case then a simple multiplexer should be sufficient to gate the appropriate signal to the PIC. > > The interesting point in here is that a simply 8 jk's fflops counter and > an > incorporated shift register could not cost more than $0.60, while it > would > be just the PIC crystal's cost. But the part doesn't exist AFAIK. You'd have to have 2 parts, a counter like a 74HC393 and a loadable shift register. So to get simultaneous counting you'd need at least 16 parts. Whereas if you use the PIC, which is already there. You only need to add a single multiplexer. Can you be more specific about your design requirements? What are the min and max frequency of the sampled signals. Do they need to be sampled simultaneously? BAJ