The invention discloses a UART-SPI conversion
system and method based on an FPGA, and belongs to the technical field of data communication. The
system comprises an upper computer, an FPGA board and a
chip to be tested; a UART-SPI communication protocol conversion circuit is integrated in the FPGA board, and the UART-SPI communication protocol conversion circuit comprises a UART interface module, a
system control module, a register configuration module, an SPI interface module, a
clock and reset management module, a
peripheral signal generation module, an
asynchronous FIFO module and a
clock domain crossing synchronization module. And the system control module analyzes the configuration data packet from the upper computer and executes various configuration instructions. The UART data frame structure and the SPI data frame structure are dynamically configured through the instruction, flexible configuration of an SPI mode, a
clock, UART parameters and various
peripheral signals is supported, the
reconfigurability of an FPGA is fully utilized, the adaptability to diversified communication protocols in scenes such as
chip testing is remarkably improved, and the method has the advantages of being short in
development period and wide in applicability.