Page 2 - Related Documentation; Contributions; Gather What You Need to Get Started
Using PCI Serial with Linux 2 www.natinst.com Troubleshooting and Common Questions ...............................................12 Error Codes.......................................................................................12Common Questions .....................................................
Page 4 - Quick Start
Using PCI Serial with Linux 4 www.natinst.com Quick Start This section is for experienced Linux users who are familiar with the lspci and setserial tools. If you are not familiar with either of these tools or if you require a detailed explanation of the steps, skip to the next section, Setup . 1. If...
Page 5 - Create Devices; MAKEDEV Example
© National Instruments Corporation 5 Using PCI Serial with Linux Setup After you install the serial hardware (as shown in your PCI serial getting started manual), follow these steps to set up the interface. Create Devices Create a device for each port on your multiport interface. You only need to do...
Page 6 - Assign Serial Driver; setserial Example
Using PCI Serial with Linux 6 www.natinst.com 00:0a.0 Class ff00: 1093:d140 (rev 01) Flags: medium devsel, IRQ 11 Memory at 000dff80 (low-1M, non-prefetchable) I/O ports at dff0 I/O ports at dfe0 Write down the IRQ, memory location, and all the I/O port addresses for your computer. Note PCI Eight-Po...
Page 7 - Assign Serial Drivers Using PCI-485; Enable PCI Interrupt
© National Instruments Corporation 7 Using PCI Serial with Linux linux# setserial /dev/ttyS5 uart 16550A port 0xdfe0 irq 11 ^fourport Assign Serial Drivers Using PCI-485 Since the PCI-485 supports a higher baud_base of 460.8K at start-up, also enter the following at the linux prompt: linux# setseria...
Page 8 - Configuration; View Your Hardware Resources
Using PCI Serial with Linux 8 www.natinst.com linux PCI-SERIAL# ./intenable < PCI memory address found in lspci> For example, enter the following to enable interrupts for a PCI serial interface with memory at 0x000dff80: linux PCI-SERIAL# ./intenable dff80 Configuration View Your Hardware Reso...
Page 9 - FIFO Example; Transmit FIFO Trigger Level
© National Instruments Corporation 9 Using PCI Serial with Linux The hardware issues a transmit empty interrupt when the number of characters in the transmit FIFO falls below the trigger level. Also, the hardware issues a receive full interrupt when the number of characters in the receive FIFO rises...
Page 10 - Transceiver Mode
Using PCI Serial with Linux 10 www.natinst.com Configure PCI-485 If you are using a PCI-485 interface, you can select the transceiver mode for each device and select the lower baud rates listed in termios_program.c provided in your PCI-SERIAL directory. Select Transceiver Mode Use the rs485 program ...
Page 11 - Test the Setup
© National Instruments Corporation 11 Using PCI Serial with Linux one serial port. To change the baud base of your other serial ports, rerun clockspeed with a different serial port number specified in the command line. Enter the following to set the baud base. (In this example, high equals a baud ba...
Page 12 - Error Codes
Using PCI Serial with Linux 12 www.natinst.com Troubleshooting and Common Questions Error Codes This section lists possible error codes and solutions. Error Code /dev/ttyS< port number>: no such file or directory Solution The /dev/ttyS< port number> does not exist in the /dev directory. ...
Page 13 - Common Questions; What do I do if; does not work immediately or causes a
© National Instruments Corporation 13 Using PCI Serial with Linux Common Questions What do I do if intenable does not work immediately or causes a segmentation fault? Enter the following to recompile interrupt_enable.c and rerun intenable . Also, the source code for intenable is available for editin...
Page 15 - How can I use; Assign Driver
© National Instruments Corporation 15 Using PCI Serial with Linux linux# ./rs485 < transmit port number> 0 linux# ./rs485 < receive port number> 0 linux# ./serialtest < receive port number> <transmit port number> What do I do if my ports are not communicating correctly and pr...