Hi, I am implementing a robot control circuit using the PIC16C73. The motor is driven by a National LMD18201 H-Bridge that is being fed from the microcontroller with a PWM pulse train. I successfully used the Timer2 (TMR2) in conjunction with the CCP1 pin to generate the pulse. Now, I need to read "bleeps" or pulses from a digital encoder mounted on the motor shaft. I want to be able to count the number of bleeps from the encoder while the pulse train is being generated by the pic, then shut the motor down. I tried implementing on pin change interrupt from PORTB pin, so that each time an interrupt occur, a counter is incremented. But when I debugged the code, everything was working fine. That is the TMR2 will increment and set CCP1 at the appropriate timing even if it is in the interrupt service routine. I built the circuit and nothing happened. Actually, the pic would read a series of pulse from the encoder then turn off the pulse train. I can't find the culprit! So my questions are: * how do I read the bleeps from the encoder (digital)? * Does the TMR2 overflow interrupt is turned off when the code goes in the ISR causing a o% duty cycle? Help me please. Franck PS: Please use the same subject for mail sorting purposes. Thank you.