The FPGA to FPGA interface provides us with a means to send data between two FPGAs. The interface is very similar to our simplified Xbus interface. The interface uses a total of three pins, two pins for data and one for a strobe signal. Once the receiving FPGA sees the strobe signal go high it knows that data is being sent and it stores this data into a shift register.
FPGA 1 uses this interface to send the x- and y-coordinates of both the location of the user’s touch and the stepper motor’s location to FPGA 2. Since these coordinates range between zero and 512, we need at most nine bits for each coordinate. However, we send two bytes per coordinate, with only the lower nine bits representing coordinate data.
FPGA 2 can identify a transition between stepper
motor coordinates and touch screen coordinates by watching for the strobe
signal to go low. FPGA 2 can distinguish stepper motor coordinates
from touch screen coordinates by looking at the MSB of the high order byte
of each coordinate. When FPGA 1 sends touch screen data, the MSB
of the high order byte of a touch screen coordinate is set to 1.
When FPGA 1 sends stepper motor data, the MSB of the high order byte of
a stepper motor coordinate is set to 0. When the shift register on
FPGA 2 has received all four bytes describing the x- and y-coordinates
of either the touch screen of the stepper motors, it asserts a done signal
to indicate to the other components in FPGA 2 that it has received all
the data from FPGA 1.