The invention belongs to the technical field of
time synchronization, and particularly relates to a method and a device for converting a direct-current B code into a
serial port time message of a power
system. The invention aims to solve the problems of low precision and high cost of a CPU (
Central Processing Unit) conversion mode adopted by the traditional method, and the time accuracy of the
serial port time message
signal of the power
system can be superior to 1
microsecond. According to the main scheme, the device comprises a 10-frequency multiplication module, a code element identification module, a B code
information analysis module, a second punctual
edge extraction module, a 1PPS generation module, a time correction module, a
serial port time message coding module, a serial port time message sending module and a serial interface
driving circuit. Except for the serial interface
driving circuit, the other modules are realized by the FPGA. The FPGA is adopted to convert the
direct current B code into the power
system serial port time message, high-precision serial port time message
signal output is achieved, a CPU is not used, the
hardware architecture is simple, stable and reliable, the cost is low, the device can be miniaturized and modularized, the application is flexible, and the expansibility is good.