| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → xPC Target |
| Contents | Index |
| Learn more about xPC Target |
| On this page… |
|---|
This topic assumes that you satisfy the requirements outlined earlier in Expected Background and that you have reviewed the following sections to prepare:
It also assumes that you already have a board for which you want to write a driver. Before you start, use the following checklist to specify the driver you want to write:
Determine the functions of your board that you want to access with your driver.
Determine the bus type for the board.
PCI
ISA
Select the I/O access mapping type.
I/O port mapped
Memory address mapped
Select polling versus interrupt.
Specify the blocks for the drivers. Identify
Input and output ports
Mask parameters
Work variables to be shared between driver start, output, and terminate routines
Determine your timing considerations.
Decide whether you use Inlined functions.
If yes, see the Target Language Compiler documentation of the Real-Time Workshop.
Standard I/O
Communication
DMA
Interrupt-driven
The xPC Target software supports the two standard PC bus types, ISA and PCI. The ISA bus is a 16-bit bus with an 8 MHz clock. Another form of ISA bus is the PC/104. The PCI bus is a 32-bit or 64-bit bus with a 33 MHz or 66 MHz clock. Another form of PCI bus is the PC/104+ (PC/104-Plus).
A driver performs I/O accesses through either I/O ports or memory addresses (memory mapped).
The xPC Target software accesses I/O port addresses for ISA and PCI buses as follows:
| Bus | Access |
|---|---|
| ISA | Board switches or jumpers usually select I/O port address and any memory-mapped region. |
| PCI | The BIOS determines the I/O port address during PCI PNP (Plug and Play) configurations. |
The memory space for I/O boards is different for ISA and PCI boards.
| Bus | Memory Space |
|---|---|
| ISA | The xPC Target software only permits use of the memory address between 0xA0000 and 0xFFFFF |
| PCI | Upper memory address space, typically greater than 2 GB |
A device board supports either I/O port or memory-mapped access to onboard registers. See the board manufacturer's register programming documentation.
You can choose to inline or not inline xPC Target drivers. Note the distinction between Simulinkand Real-Time Workshop® conditional compilation. Writing a device driver as an inlined S-function ensures that the driver can coexist with xPC Target device drivers.
Inlining drivers allows you to customize code generated from Real-Time Workshop. If you choose to create inlined drivers, you must use the Real-Time Workshop Target Language Compiler.
Note For convenience, you can create a noninlined version of the driver first, and create an inlined driver for the Target Language Compiler from the first driver. |
![]() | Introduction | Creating a Custom Driver | ![]() |

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |