Okay, let's break down the requirements for interfacing a quadrature encoder with RS422/485 receivers to a 3.3V system.
Understanding the Setup:
- Quadrature Encoder: Typically outputs two main signals (A and B) in a square wave pattern, phase-shifted by 90 degrees, plus possibly an index pulse (Z). These signals indicate position and direction of rotation.
- 5V Output: The encoder outputs signals using 5V logic levels (like TTL or 5V CMOS).
- RS422/RS485 Interface: You need to use these differential signaling standards. This is usually for noise immunity or longer distances. RS485 is typically half-duplex (using 2 wires: A and B), while RS422 can be full-duplex (using 4 wires: TxA, TxB, RxA, RxB). For receiving encoder signals, you often use RS485 transceivers, dedicating one pair of differential lines (A and B) for the encoder's A signal and another pair for the encoder's B signal.
- 3.3V Input: The receiving microcontroller operates at 3.3V.
- Receiver IC: You need an IC that takes the differential RS422/485 input and outputs standard 3.3V logic levels for the microcontroller.
- Cheap: We'll focus on common, widely available parts.
Important Note: Standard quadrature encoders usually output single-ended 5V signals. To use RS485/422, you typically need both drivers (to convert the 5V single-ended signals to differential RS485 signals) and receivers (to convert the differential RS485 signals back to logic levels). The ICs below are usually transceivers (containing both driver and receiver), but you would primarily use their receiver functionality. You'll need two such ICs if your encoder provides separate A and B signals that need simultaneous differential transmission/reception.
Recommended Cheap RS485 Transceiver ICs (Used as Receivers):
These are common choices that operate from a 3.3V supply and provide 3.3V logic-level outputs. They are usually sold as transceivers, but their receiver sections meet your needs.
-
Texas Instruments SN65HVD72 / SN65HVD75 Family:
- Type: RS485 Half-Duplex Transceiver.
- Supply Voltage: 3.3V.
- Logic Output: 3.3V CMOS.
- Functionality: Receives differential signals (on RO, RE pins) and outputs a single 3.3V logic signal.
- Max Frequency/Speed: Typically rated for 20 Mbps (Megabits per second). This is generally fast enough for most quadrature encoders, even at high speeds. (e.g., 20 million transitions per second).
- Cost: Generally inexpensive, widely available.
- Note: You would need two of these ICs, one for the encoder's A channel and one for the B channel, connected to the differential lines.
-
Analog Devices / Maxim MAX3470 / MAX3471 Family:
- Type: RS485/RS422 Transceiver (MAX3470 is Half-Duplex, MAX3471 is Full-Duplex).
- Supply Voltage: 3.3V.
- Logic Output: 3.3V CMOS.
- Functionality: Receives differential signals (A/B lines) and outputs single 3.3V logic levels (RO pin).
- Max Frequency/Speed: Typically rated up to 20 Mbps.
- Cost: Also common and relatively inexpensive.
- Note: Similar to the TI parts, you'd likely need two for the A and B encoder signals.
Older / Potentially Slower Options (Check Datasheets Carefully):
- Maxim MAX487 / MAX489: These were often 5V devices but sometimes had variants or characteristics that made them usable in 3.3V systems (check common-mode input/output voltages and logic levels carefully). Their speed is often lower, around 2.5 Mbps or 10 Mbps, which might be too slow depending on your encoder's maximum rotation speed and resolution.
Key Considerations:
- Number of ICs: A quadrature encoder needs two signals (A and B) tracked simultaneously. Since RS485 uses a differential pair per signal, you will typically need two transceiver ICs: one for the A signal and one for the B signal.
- Encoder Output Type: If your encoder outputs standard single-ended 5V TTL/CMOS signals (A, B, Z), you need RS485 drivers in addition to the receivers. Using transceiver ICs handles this: you connect the single-ended 5V encoder signal to the driver input (e.g., DI pin) and use the transceiver's differential output pair (e.g., RO/RE pins wired for differential output) to send the signal differentially. You then use another transceiver IC at the receiving end to convert the differential signal back to 3.3V logic. Alternatively, and perhaps simpler if distance/noise allows, consider just using 74LVC-series logic buffers (like 74LVC245) for 5V-to-3.3V level shifting without differential signaling.
- Frequency: Calculate the maximum expected frequency. If your encoder has, say, 1000 counts per revolution and spins at 3000 RPM, that's 1000 * (3000/60) = 50,000 counts per second. For quadrature, this means ~100,000 phase changes per second, which is 0.1 MHz or 100 kHz. The 20 Mbps rated parts are vastly sufficient for this. Check your encoder's datasheet for its maximum output frequency.
- Datasheets: Always consult the specific datasheet for the part number you choose. Pay attention to maximum data rates, common-mode voltage ranges, and power supply requirements.
In summary, the SN65HVD72 or MAX3470 are excellent, cheap, and readily available choices for receiving RS485/RS422 signals and converting them to 3.3V logic levels, with speeds up to 20 Mbps. Remember you'll likely need two ICs for the A and B channels of the quadrature encoder.