Product User’s Manual – MOSPG30ExxxK
3.0 Sample Schematic
Figure 3.0 Sample schematic diagram with respect to sample source code**
**Schematic above is an example with respect to the sample source code provided. RC4, RC7,
RA2, and RA5 can be replaced by any other digital I/O pins. Besides, for PWM control, user can
also use CCP1 instead of CCP2. For Channel A and channel B, this sample (schematic and source
code) shows continuous monitoring of quadrature signals which can be done by any digital I/O pin.
Users are encouraged to modify the schematic and source code to allow use of external interrupt to
count the rising or falling edge of either channel to reduce the processing power used by monitoring
both channel A and B. The encoder output is
open drain
or sometime called
NPN output
. Users
need to pullup resistor to any voltage user want. As an example circuit above, channel A and
channel B are pullup with 1K resistor to 5V, therefore it will output ground and 5V when the motor
rotates.
Created by Cytron Technologies Sdn. Bhd. – All Rights Reserved
7