CN-121996599-A - SPI interface software based on AD5781
Abstract
The application discloses SPI interface software based on AD5781, and relates to the technical field of fiber optic gyroscopes. The system comprises a pin configuration module, a clock configuration module, a frame format processing module, an SPI time sequence logic module and a data framing and transmitting module. To solve the problem that the prior art is difficult to realize the fiber optic gyroscope analog voltage data is converted at high speed and high precision.
Inventors
- BU YUTING
- GUO JUNCHAO
- Bai Guangqin
- LU LILIAN
Assignees
- 贵州航天控制技术有限公司
Dates
- Publication Date
- 20260508
- Application Date
- 20251210
Claims (5)
- 1. SPI interface software based on AD5781, characterized by comprising: the pin configuration module is used for configuring the functions of the DA driving module and related interfaces IO; the clock configuration module is responsible for generating, distributing and synchronizing clock signals required by each module, and a crystal oscillator and PLL phase-locked loop scheme is selected to multiply the frequency of the 25MHz crystal oscillator to 100MHz; the frame format processing module is automatically optimized into an advanced gate circuit through a comprehensive tool and is used for judging the signal effectiveness in bit stream transmission, and simultaneously solves bit sequence alignment, time sequence synchronization and effective signal handshake through parallel splicing of serial bit streams, thereby avoiding misreading; The SPI sequential logic module is used for carrying out communication by an AD5781 by adopting an SPI bus, software is matched with the time sequences of SYNC, SCLK and SDIN of three-wire serial interfaces of the AD5781, wherein SYNC is a frame synchronous signal of serial input data, SCLK is a serial communication clock signal, SDIN is a serial data input pin, the input pin updates voltage output at the rising edge of the SYNC, and SYNC, SCLK and SDIN signals are generated through an I/O pin of an FPGA chip and are input into the AD5781 to realize analog voltage data conversion; the data framing and transmitting module receives a DAC register with 24 bits wide to be transmitted as effective data, fills each field according to a preset frame structure, comprises a frame header, 24 bits of data bits and calculates a CRC check value, and completes SPI transmission frame assembly.
- 2. The SPI interface software of claim 1, wherein the SPI sequential logic module comprises an operating mode configuration sub-module: After the power-on, the AD5780 is put into a normal working mode to program the output, the control register controls the working mode of the AD5781, corresponding configuration words are written into the control register of the AD5781, the AD5781 enters the normal working mode, the internal reference voltage of the AD5781 and the output amplifier are configured through software, the dynamic switching of the output range is realized, namely the RBUF bit of the control register is set to be logic 0, so that the output amplifier with the gain of 2 is configured, and the bipolar output mode is realized by single-ended reference input.
- 3. The SPI interface software of claim 1, wherein the SPI timing logic module further comprises an SPI precision timing control sub-module: The data writing to the AD5781 can be performed after the configuration of the control register is completed, wherein the input DAC register is 24-bit wide, 24-bit data is loaded into the device in a MSB-priority mode under the control of a serial clock SCLK with the working speed up to 35MHz, and the input DAC register comprises R/W bits, 3 address bits and 20 data bits.
- 4. The SPI interface software of claim 3, wherein, The SPI accurate time sequence control submodule is further used for starting a writing period on the first falling edge of SYNC, at the moment, data are output one by one on the rising edge of SCLK, the falling edge of SCLK is effective, after 24 clock falling edges of SCLK, SYNC is pulled up again, after serial transmission is finished, the data are automatically transmitted to an addressing register from an input shift register and appear on an SDIN line, so that output is updated, the SPI accurate time sequence control module pulls down SYNC signals, then the data are transmitted bit by bit through SCLK signals which are strictly matched with the AD5781 sampling time sequence, and after transmission is finished, the SYNC is pulled up, and AD5781 conversion is waited for to be completed.
- 5. The SPI interface software of claim 1, wherein, The ideal transfer function of the DAC is: The digital-to-analog conversion method comprises the steps of enabling VREFN to be negative voltage applied to VREFNS input pins, enabling VREFP to be positive voltage applied to VREFPS input pins, enabling D to be 18-bit codes written into a DAC, and enabling AD5781 to be controlled through code writing to achieve conversion from digital quantity to analog quantity.
Description
SPI interface software based on AD5781 Technical Field The application relates to the technical field of fiber optic gyroscopes, in particular to SPI interface software based on AD 5781. Background The fiber optic gyroscope is upgraded and reformed to have the characteristics of other gyroscopes and the advantages of the fiber optic gyroscope, so that the fiber optic gyroscope is a brand new design thought, wherein the design technology of a high-precision digital-to-analog conversion circuit is required to be broken through, the fiber optic gyroscope has the analog voltage output characteristics of the liquid-to-analog gyroscope, and the fiber optic gyroscope has the advantages of good vibration resistance, large dynamic range, severe environment resistance, magnetic field shielding, insensitivity to gravitational acceleration, easiness in processing, high yield, low price and the like. The current design schemes are also various, but the effect of high-speed high-precision voltage conversion cannot be completely realized. The fiber optic gyroscope is used as a novel all-solid gyroscope, has the outstanding advantages of all solids, digitalization, strong environment adaptability, simple application and the like, but has no analog output interface. Disclosure of Invention The application aims to provide SPI interface software based on AD5781, which is used for solving the problem that the high-speed and high-precision conversion of analog voltage data of an optical fiber gyroscope is difficult to realize in the prior art. In order to achieve the above purpose, the application adopts the following technical scheme: The application provides SPI interface software based on AD5781, which comprises the following steps: the pin configuration module is used for configuring the functions of the DA driving module and related interfaces IO; the clock configuration module is responsible for generating, distributing and synchronizing clock signals required by each module, and a crystal oscillator and PLL phase-locked loop scheme is selected to multiply the frequency of the 25MHz crystal oscillator to 100MHz; the frame format processing module is automatically optimized into an advanced gate circuit through a comprehensive tool and is used for judging the signal effectiveness in bit stream transmission, and simultaneously solves bit sequence alignment, time sequence synchronization and effective signal handshake through parallel splicing of serial bit streams, thereby avoiding misreading; The SPI sequential logic module is used for carrying out communication by an AD5781 by adopting an SPI bus, software is matched with the time sequences of SYNC, SCLK and SDIN of three-wire serial interfaces of the AD5781, wherein SYNC is a frame synchronous signal of serial input data, SCLK is a serial communication clock signal, SDIN is a serial data input pin, the input pin updates voltage output at the rising edge of the SYNC, and SYNC, SCLK and SDIN signals are generated through an I/O pin of an FPGA chip and are input into the AD5781 to realize analog voltage data conversion; the data framing and transmitting module receives a DAC register with 24 bits wide to be transmitted as effective data, fills each field according to a preset frame structure, comprises a frame header, 24 bits of data bits and calculates a CRC check value, and completes SPI transmission frame assembly. Optionally, the SPI sequential logic module includes a working mode configuration sub-module: After the power-on, the AD5780 is put into a normal working mode to program the output, the control register controls the working mode of the AD5781, corresponding configuration words are written into the control register of the AD5781, the AD5781 enters the normal working mode, the internal reference voltage of the AD5781 and the output amplifier are configured through software, the dynamic switching of the output range is realized, namely the RBUF bit of the control register is set to be logic 0, so that the output amplifier with the gain of 2 is configured, and the bipolar output mode is realized by single-ended reference input. Optionally, the SPI timing logic module further comprises an SPI precise timing control sub-module: The data writing to the AD5781 can be performed after the configuration of the control register is completed, wherein the input DAC register is 24-bit wide, 24-bit data is loaded into the device in a MSB-priority mode under the control of a serial clock SCLK with the working speed up to 35MHz, and the input DAC register comprises R/W bits, 3 address bits and 20 data bits. Optionally, the SPI accurate timing control sub-module is further configured to start a writing period on a first falling edge of SYNC, at this time, the data is output one by one on a rising edge of SCLK, and after the falling edge of SCLK is valid, SCLK pulls SYNC high again after the falling edge of 24 clocks, after serial transmission is finished, the data is automatical