> -----Original Message----- > From: Olin Lathrop [SMTP:olin_piclist@EMBEDINC.COM] > Sent: Wednesday, September 03, 2003 1:12 PM > To: PICLIST@MITVMA.MIT.EDU > Subject: Re: [PIC:] How to monitor a dozen shafts? > > Michael Rigby-Jones wrote: > > The period of just one > > tooth on the 16 tooth wheel at 200RPM would be a whopping 188ms, > > This is WAY off, observe: > > (200rev/min / 60sec/min) = 3.333Hz shaft speed > > 3.333Hz * 16 teeth/rev = 53.33Hz tooth frequency > > 1 / 53.33Hz = 18.8mS tooth period > Granted, I screwed up with that one..not sure how I got a factor of ten out. > > so you > > wouldn't need to poll the inputs particularly quickly to get a > > reasonable precision. > > Except that this is based on a value that is off by an order of magnitude. > > > (the CCP module is great for arbitrary rate interrupts > > with no timer loading overhead) > > Yes, a CCP module can be used to generate a periodic interrupt. However, > my first choice for this is timer 2 since it's less useful for other > stuff. > > > By running a counter for each > > input and storing the value on a rising (or falling) edge you can > > easily and quickly make a multi channel counter. > > But he wants speed, not total elapsed revolutions. > And speed (or at least period, from which speed can be derived) is what he would get. The counter would counter the number of interrupts between rising edges, not the total number of rising edges. Mike ======================================================================= This e-mail is intended for the person it is addressed to only. The information contained in it may be confidential and/or protected by law. If you are not the intended recipient of this message, you must not make any use of this information, or copy or show it to any person. Please contact us immediately to tell us that you have received this e-mail, and return the original to us. Any use, forwarding, printing or copying of this message is strictly prohibited. No part of this message can be considered a request for goods or services. ======================================================================= Any questions about Bookham's E-Mail service should be directed to postmaster@bookham.com. -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu