James Newton, webhost wrote: > Bob Ammerman defined it better with:
> > fmax = maximum output frequency > > loop forever: > f1 = get frequency of first input > if (f1 > fmax) then f1 = fmax > f2 = get frequency of second input > if (f2 > fmax) then f2 = fmax > fout = fmax - min(f1,f2) > end loop That's not what I understood you wanted, but we finally seem to have a spec. You implied you wanted the output frozen if one of the inputs saw no pulses at all, but apparently not if you're happy with the above. The only wrinkle I would add is that the computations be done on period instead of frequency. That is technically a different response, but probably still satisfactory for your application. > However, I find it hard to believe that the cost of the photo > detectors, LED, PIC, crystal or resonator, etc... I would use a 12F629 running on its internal 4MHz oscillator. These things are well under a buck in quantity and you wouldn't need a crystal or resonator. > It violates KISS to use a PIC, for this doesn't it? I don't think so, unless the spec is different from above. > The AND part is easy... the photo transistors just get hooked in > series. Argh! Look James, I know you don't like my "grumping" about wanting a spec, but that lack of exact spec is the big problem here and probably the reason you aren't getting useful answers. Hooking the photo transistors in series is very different from any behaviour you have described so far. That will give you the AND on an instantaneous pulse by pulse basis. It is certainly different from Bob's algorithm above. Continuing with this thread is a waste of time until you finally define what you really want. ***************************************************************** Embed Inc, embedded system specialists in Littleton Massachusetts (978) 742-9014, http://www.embedinc.com -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body