To make quantitative analysis of the performance of UV communication system, a transceiver system for error code test based on FPGA is designed and the bit error rate (BER) is analyzed and calculated by the labVIEW program. The nine order m sequence which is sent to the LED driving circuit at a certain rate is used as the test sequence at the transmitter side. The photoelectric signal processing, pulse synchronous and data extraction are accomplished at the receiver side. Formatted data is transferred to the PC program for further processing via a serial port. The indoor test results show that this design is suitable for the BER measurement and can provide a basis for selecting the best link of the UV communication system.