Well... PICs can use timer 0 as a counter. This is a single bit in a register to set. If you require the PIC to tell you when a certain amount of pulses has appeared, some PICs have a compare function on timer 1 that enables them to set a flag when a specific amount of pulses are counted. Timer 1 is 16 bit, so you can do several turns without checking the count, and the hardware will tell you when you've reached you "destination". -DS Monday, August 30, 1999, 4:00:22 PM, you wrote: GC> I want to use a PIC to control a stepper motor and check that it has moved. GC> The problem that I see is that if I have a 400 step motor and a 1200 encoder (if one exists) GC> that every time a send a pulse to my stepper control board to move the motor one step I am going to GC> get back 3 pulses from a encoder. How can I firstly count pulses using a PIC and secondly how can I count the three pulses back when the GC> PIC is already doing an operation (the stepper pulse signal). GC> I can not think of how to do this. GC> I have one hardware type solution and that is to feed the encoders output in to a counter and then use the pic to read the counter value and GC> then reset the counter every time but I'm sure that there must be some way t o do this with the just the pic. GC> Speed is not a issue with the system as the motor will not be moving very qu ickly. GC> I am new to the PIC thing so please don't shout if this is dead easy to do. GC> Thanks & Regards GC> Gary Computer instruction and/or message: Press CTRL-ALT-DEL to continue....