Share this

Design of ARINC429 bus interface board driver based on WinDriver

2026-04-06 08:48:40 · · #1
Abstract: WinDriver is a powerful driver development kit. Developing Windows drivers using WinDriver eliminates the need for familiarity with DDK programming and driver models, simplifying the device driver development process and shortening the development cycle. This paper, based on an ARINC429 bus interface board architecture, elucidates the steps and methods for developing device drivers using WinDriver. Keywords: WinDriver; ARINC429; Device driver [b][align=center]Design of device driver for ARINC-429 bus interface card using WinDriver kit Yi Xiaoqing, Wang Qian, Luan Chunxu[/align][/b] Abstracts: Design of device driver for ARINC-429 bus interface card using WinDriver kit The WinDriver device driver toolkit has powerful functions. Using WinDriver to develop the driver under Windows does not require familiarity with DDK programming and the actuation pattern. It can also predigest the process of developing device driver and reduce the development cycle. This paper introduces the steps and methods of developing device driver with WinDriver based on the architecture of ARINC-429 bus interface card. Keywords: WinDriver; ARINC429; Device driver programming 0 Introduction In modern military and civilian aircraft, a large amount of information needs to be transmitted between systems. With the development of digital technology and the emergence of microcomputers, more and more avionics equipment has adopted digital technology. The ANINC429 digital information transmission specification, developed by ARINC, has become the aviation transportation industry standard for transmitting digital information between avionics devices. This standard overcomes the drawbacks of analog transmission, such as high cost, numerous transmission lines, and poor reliability, while improving information transmission accuracy. Extensive research has been conducted on bus interface boards for implementing ARINC429 data transmission. However, after designing the hardware circuit, a major challenge is developing its driver. How to quickly develop a high-quality, highly reliable driver with minimal system kernel knowledge is a pressing issue. Jungo's WinDriver development kit, due to its simplicity, efficiency, lack of involvement in low-level operating system programming, and excellent compatibility, has become a good tool for driver development. This paper will present a design method for an ARINC429 bus interface board driver based on WinDriver user mode. 1 ANINC429 Bus Interface Card Structure Design 1.1 Overview of the ARINC429 Specification The ARINC429 bus is a civil aviation digital bus transmission standard developed by ARINC, specifying the format for information flow from avionics devices using this bus to ARINC429 basic data words. ARINC429 is a unidirectional broadcast data bus, with the transmission medium consisting of twisted-pair shielded cable. The ARINC429 digital information transmission specification describes a method for serially transmitting digital data information from one port to other systems and devices via a pair of shielded twisted-pair cables (digital data bus). The information transmission rate is: 100Kb/s ± 1% for high-speed transmission and 12.0–14.5Kb/s ± 1% for low-speed transmission. ARINC429 specifies that data transmission uses bipolar return-to-zero (NRZ) code (as shown in Figure 1), meaning the modulation signal consists of "high," "zero," and "low" states. The basic signal waveform of the bipolar NRZ code carries bit synchronization information, which is identified by the state change from zero to "high" or "low." Word synchronization is based on a time interval of at least four bits during the transmission cycle; the starting point of the first bit to be transmitted immediately following this word interval is the starting point of the new word. Figure 2 shows an ARINC429 data word format. [align=center] Figure 1 ARINC429 Digital Information Transmission Format[/align] [align=center] Figure 2 ARINC429 Digital Word Format[/align] 1.2 ARINC429 Communication Module Principle The main functions of this ARINC429 data bus communication module are: to complete the serial-to-parallel conversion and parallel-to-serial conversion of two ARINC429 received data; to support interrupt mode and polling mode for receiving and sending data. Starting from the ARINC429 data bus communication protocol, communication between airborne devices or with detection devices should first be achieved through a transmitter to send data, convert this data into data conforming to the ARINC429 data bus specification, and transmit it on the data bus. When it reaches the target device, it is converted into a data format that the device can recognize through its receiver. 1.3 An ARINC429 Bus Interface Card Structure Design The card introduced in this paper adopts CPLD technology, which can realize communication between two PXI buses and the ARINC429 bus. Based on the characteristics of programmable chips, it can also be expanded to multiple receiving and transmitting channels. The circuit is simple, has few components, and has high reliability. The hardware circuit is divided into four parts: (1) CPCI/PXI interface chip; (2) CPLD chip; (3) FIFO chip; (4) level conversion circuit. Its basic block diagram is shown in Figure 3. This module can complete two-channel ARINC429 data transmission and reception, supports four transmission rates of 12.5K, 25K, 50K, and 100K, and supports interrupt mode and polling mode for receiving and sending data. 2 Design of ARINC429 bus interface card driver based on WinDriver 2.1 Overview of WinDriver development tool WinDriver is a tool software produced by Jungo in the United States for writing hardware drivers. It is mainly used for developing device drivers for hardware such as ISA cards, PCI cards, and USB. By running DriverWizard, a basic driver framework can be generated for the card, which has functions such as device detection, configuration register reading and writing, custom register reading and writing, I/O and memory space access. By adding code using a compiler and programming language that you are familiar with, you can get a satisfactory device driver. Because WinDriver encapsulates all the complex low-level operations within a kernel module, and provides users with standard WinDriver API functions for hardware access, it transforms the complex work of driver development into simply calling standard API functions for hardware operations, greatly simplifying the work of driver developers and accelerating the development cycle. 2.2 Design of the ARINC429 Driver Based on WinDriver WinDriver programming has two modes: user mode and kernel plug-in mode. In user mode, the software utilizes its own drivers Windrvr.vxd and Windrvr.sys. Users interact with the corresponding functional interfaces encapsulated in high-level languages ​​provided by the drivers, requiring little understanding of the operating system kernel. The other mode is kernel plug-in programming, which is the true driver program and is suitable for users with specific speed requirements. This paper adopts user mode. Taking the ARINC429 card designed in this article as an example, the development of a driver sample using WinDriver version 8.01 includes the following steps: 1) Install and configure the card on the PC; 2) Run Driver Wizard, select the item displaying the card name in the device list, and run the "Generate.INF file" option to name the device A429, which will generate the A429.INF file; 3) Continue running Driver Wizard, select the VC compilation environment to generate the driver sample; 4) Use the generated .INF file to install the hardware driver according to the usual steps, with the kernel file provided by WinDriver taking over the device; 5) In the development environment, port the API function code in the driver sample, write the specific functional code, and build the user-mode driver; 6) Package and release the driver. The WinDriver driver sample generates two important files: A429_lib.c and A429_diag.c. The former is the device's application-level API function file, which users can directly call to operate and access the hardware, belonging to the user-mode driver. The latter is a sample program file (console program) that uses the aforementioned API functions to access hardware. Analyzing this file can teach you how to call API functions to write simple drivers. Combining the analysis of the two files, the following functions are crucial: 1) `DeviceFindAndOpen()`: Obtains the handle of the driver (Windrvr.vxd or Windrvr.sys), and must be called at the start of the driver program. 2) `DeviceClose()`: Releases the handle of the driver program, and is called at the end of the program. 3) `DiagIntHandler()`: Interrupt handler function; user-added code implements hardware control when an interrupt signal arrives. 4) `A429_IntEnable()`: Interrupt enable; this function must be called with `DiagIntHandler` as a parameter to enter the interrupt handling function. 5) `A429_IntDisable()`: Interrupt disable function; disables interrupt signals. 6) `WDC_WriteAddr32()`: Writes a value to a register according to the address given in the parameter. 7) WDC_ReadAddr32(), reads from the register. This driver software is a DLL dynamic library written in VC language based on WinDriver under the Windows 2000 system platform. It mainly completes the initialization and data transmission and reception functions, and verifies the correctness of the data. Specific functions include input port selection, transmit/receive FIFO reset, data transmission rate setting and acquisition, parity setting and acquisition, checking whether the transmit FIFO is empty before sending data and checking whether there are numbers in the receive FIFO before receiving data, etc. To implement these functions, it is necessary to import the file A429_lib.c and appropriately call the above 7 functions according to the hardware design definition, and encapsulate the functions that can implement these functions as exported functions for the test program to call directly. The following is the correspondence between the designed functions and their functions: 1) void *A429_Open(), a wrapper for DeviceFindAndOpen(), obtains the handle of the driver. 2) int A429_Close(void *hDev), uses the handle returned by the above function as a parameter to exit the driver. 3) `void A429_SetCheck(BYTE chan, BYTE check)`: `chan`: Channel number. Sets the checksum of the corresponding port based on the value of `chan` and stores it in the variable `check`. 4) `void A429_SetSpeed(BYTE chan, BYTE boud)`: Sets the data transmission rate of the corresponding port and stores it in the variable `boud`. 5) `void A429_ResetSendChan(BYTE chan)`: Resets the send port corresponding to `chan`. The implementation code calls `WDC_WriteAddr32()`, and its address parameter value is passed according to the hardware design definition. 6) `void A429_ResetReceiChan(BYTE chan)`: Resets the receive port corresponding to `chan`. 7) `void A429_ResetAll()`: Resets all send and receive ports. 8) `BYTE A429_SendChanIsBusy(BYTE chan)`: Checks whether the send port corresponding to the parameter value is busy. A return value of 0 indicates an idle state, and 1 indicates a busy state. 9) `byte A429_GetCheck(BYTE chan)`: Gets the parity value set by the user. 10) `WORD A429_GetData(BYTE chan, WORD Maxlenth, DWORD *pdata)`: Retrieves an ARINC429 data word with a length not exceeding `Maxlenth` from the receive channel, stores it in the buffer pointed to by `pdata` allocated to the channel corresponding to `chan`, and returns the number of data words retrieved. [align=center] Figure 3: Basic Structure of the ARINC429 Bus Interface Card[/align] [align=center] Figure 4: Main Program Flowchart[/align] The above functions can implement simple one-time data transmission and reception and are exported functions provided to the user. The exported variables include read and write buffer addresses. To continuously test the correctness of data transmission and reception, this paper designs three threads: a write thread for writing data to the transmit FIFO, a read thread for retrieving data from the receive FIFO and storing it in the buffer, and a notification thread to notify the test program that data is available in the buffer and should be retrieved. A mutex object is established for these three threads to prevent errors when operating on the same data. In the write thread, WDC_WriteAddr32() is called repeatedly based on the number of inputs from the test program, and the sent data is stored in the transmit buffer. The read thread reads the number from the receive FIFO and compares it with the transmitted data. If they are correct, the data is stored in the receive buffer and the transmitted data is deleted to free up memory space for the next transmission. When the test program receives a notification, it calls the user-designed processing function to retrieve the data from the receive buffer and transfer it to verify whether the board can correctly send and receive data. Figure 4 is the flowchart of the entire program. Due to space limitations, the detailed code will not be described in detail. The initialization includes interrupt enabling, and the interrupt service routine is the read thread called in the interrupt handler function DiagIntHandler(). 3. Conclusion This driver program was tested under the following conditions: NI PXI-1000 chassis, PXI-8156 controller, CPU: x86 Fimily 5 Model 4, memory 81,460kB, operating system: Microsoft Windows 2000 Professional. Continuous single-channel transmit/receive and simultaneous two-channel transmit/receive tests were conducted. The results show that the driver program designed in this paper can run successfully and efficiently, has high practical value, and provides a certain reference value for subsequent research on driver development using WinDriver. It also demonstrates that hardware developers can quickly develop device drivers with satisfactory performance indicators using WinDriver without needing to understand complex kernel driver knowledge, making it a highly efficient tool for designing hardware drivers. References 1 Yang Shuyun, Liu Qiang. Design and development of device drivers based on WinDriver [J]. Electronic Technology. 2001 (9): 21-23 2 Huang Xun, Sun Zhengshun. Development of PCI device drivers using WinDriver [J]. Electronic Technology Application. 2001 (3): 15-16 Authors' biographies: Yi Xiaoqing (1984-), female, master's student, engaged in research on the application of computers in power dispatch automation. Wang Qian (1962-), female, professor, engaged in research on the application of computer technology in power systems.
Read next

CATDOLL 135CM Vivian (Customer Photos)

Crafted with attention to detail, this 135cm doll offers a well-balanced and realistic body shape that feels natural in...

Articles 2026-02-22