As you mentioned, one way is to count the pulses within a fixed time period. The other is to measure the time it take to receive a fixed number of pulses. The coice between the two depends on the accuracy and the sample rate you need. As for time measuring, you want to use additional timer that runs on a fixed clock (you can use the PIC clock with the proper internal division to get the desired time clock). Now that you have two timers, one for the pulses and one for the time, start both of them, enter a loop and wait until the 'fixed' count timer (depending on which of the two options above you choose) get to its end or predefined value and than ready the other one and do the proper math. BTW, and I don't know if this is the case, if you need a timer with more bits than the hardware provides, you can extend it in software, that is, have an additional variable in memory and each time the timer warps, increment the memory variable.=20 Also, I assume that the pulses from the encoder are at equal angular intervals. If not, you want to count a multiple of 200 pulses (that is, complete revolutions). Otherwise, it does not matter. Hope this helps, Tal > -----Original Message----- > From: pic microcontroller discussion list=20 > [mailto:PICLIST@MITVMA.MIT.EDU] On Behalf Of Steger Stefan Georg > Sent: Wednesday, May 07, 2003 8:35 AM > To: PICLIST@MITVMA.MIT.EDU > Subject: [PIC]: >=20 >=20 > I want do measure the rpm=B4s from a electro motor, and I get a=20 > pulse signal from an encoder. Now I=B4ve decided to count the=20 > pulses with the Timer T1. I know 200 pulses are equal to one=20 > rotation. The problem I have now, is to measure how many=20 > pulses I receive in one second, so that I can calculate the=20 > rpm(rotations per minute). Can anyone say me, how can I do=20 > this the best way, or exists another possibility to measure the rpm? >=20 > Mfg > Stefan >=20 > -- > http://www.piclist.com hint: PICList Posts must start with ONE topic: > [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads >=20 -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads