I have measuring wheel encoder like this one, which outputs its position using two RS422-encoded pin pairs, standard quadrature encoding. Note that these are not using the RS422 communication protocol, just the 2-pin differential encoding that RS422 uses.
This is connected to a bespoke PCB that includes a microcontroller, which was designed and programmed by some company for us, which basically counts pulses (and does a bit more which isn't relevant here)
As the software seems to have some bugs, I'd like to create a reproducible test environment, where I can simulate the wheel encoder turned at a specific rate, translating to a fixed, but configurable, frequency. My idea was an Arduino which I can write a small control program for, use the Arduino's GPIO pins to simulate the encoder's output, and connect that to the encoder input of the bespoke PCB.
As I'm not using RS422 to actually transmit bytes, just differential trigger signals, my idea is to set one GPIO pin to 1, another to 0, wait for half the pulse time, revert those signals, wait another half pulse time, and repeat from start. (Actually, I'll need 4 pins, to simulate A and B, and cycle between "set A to 1/0", "set B to 1/0", "set A to 0/1", "set B to 0/1").
A) Will this work? As far as I know, the only thing that's relevant is the differential between the two pins, and the +/- 5V between those pins should work well with the input chip of the PCB, which is a THVD2450.
B) Do I have to connect the Arduino's GND to the PCB's GND, or shouldn't I, to avoid any current loops?