The simplified Xbus served as a means to send data, in our case, the
touch screen coordinates, from the microcontroller to FPGA 1. The
Xbus used in our project has been greatly simplified from the version designed
in class since our version only supports communication in one direction,
from the microcontroller to the FPGA.
The simplified Xbus uses a total of five pins. Four of the pins
are used to send data and the fifth pin is used as a strobe pin.
The strobe pin is used to indicate when the data on the data pins is valid.
This pin is set high when data is sent. The strobe pin is set back
low once the data has been sent.
When the FPGA side of the simplified Xbus sees the strobe signal set
high, it puts the four bits of data in a shift register. Since our
microcontroller has to send four bytes, 32 bits, of data, our shift register
is four bytes wide. A state machine keeps track of how many 4-bit
nibbles the shift register has seen and shifted over and once the shift
register has received all four bytes, it asserts a done signal to indicate
that its contents are valid. Note that if we wanted the microcontroller
to send more or less than four bytes of data, we could easily change the
size of the shift register and add or subtract states in the state machine
that controls the done signal.