ICS-121. VxWORKS DEVICE DRIVER MANUAL

Similar documents
TDRV006-SW-42. VxWorks Device Driver. 64 Digital Inputs/Outputs (Bit I/O) Version 4.0.x. User Manual. Issue December 2017

TIP700-SW-42. VxWorks Device Driver. User Manual. The Embedded I/O Company. Digital Output 24V DC. Version 2.0.x. Issue June 2008.

TPMC500-SW-42. VxWorks Device Driver. User Manual. The Embedded I/O Company. 32 Channel 12 Bit ADC. Version 2.0.x. Issue 2.0.

CARRIER-SW-82. Linux Device Driver. IPAC Carrier Version 2.2.x. User Manual. Issue November 2017

TIP120-SW-42. VxWorks Device Driver. Motion Controller with Incremental Encoder Interface. Version 2.1.x. User Manual. Issue 2.1.

PAS 9796/DIO ENGINEERING SPECIFICATION

TIP675-SW-82. Linux Device Driver. 48 TTL I/O Lines with Interrupts Version 1.2.x. User Manual. Issue November 2013

TPMC851-SW-42. VxWorks Device Driver. Multifunction I/O (16 bit ADC/DAC, TTL I/O, Counter) Version 2.0.x. User Manual. Issue 2.0.

TIP114-SW-72. LynxOS Device Driver. User Manual. The Embedded I/O Company. 10 Channel Absolute Encoder Interface (SSI) Version 1.0.

TPMC821-SW-42. VxWorks Device Driver. User Manual. The Embedded I/O Company. INTERBUS Master G4 PMC. Version 1.4. Issue 1.

VME Basics. Appendix. Introduction to the VMEbus Accessing boards across the VMEbus VMEbus interrupt handling

The Embedded I/O Company TIP700-SW-82 Linux Device Driver User Manual TEWS TECHNOLOGIES GmbH TEWS TECHNOLOGIES LLC

Trident Robotics and Research, Inc. User Documentation Department 2516 Matterhorn Drive Wexford, PA (412)

TPMC860-SW-82. Linux Device Driver. 4 Channel Isolated Serial Interface RS232 Version 1.4.x. User Manual. Issue 1.4.

CARRIER-SW-42. VxWorks Device Driver. IPAC Carrier. Version 4.2.x. User Manual. Issue July 2018

VxWorks Device Driver User s Manual

OPTO32A 24 Input Bit, 8 Output Bit Optical Isolator Board

TPMC868-SW-42. VxWorks Device Driver. 16 Channel Serial PMC. Version 2.1.x. User Manual. Issue December 2011

Figure 1.0 ULTRA 22C Board Layout JP1 JP5. Table 1.0 Default Jumper Settings

TPMC815-SW-72. LynxOS Device Driver. User Manual. The Embedded I/O Company. ARCNET Controller. Version 1.0.x. Issue 1.0 May 2004

TPMC550-SW-12 OS-9 for PPC Device Driver 8 (4) Channels Isolated 12-bit D/A

Introduction to VME. Laboratory for Data Acquisition and Controls. Last modified on 4/16/18 5:19 PM

TIP670-SW-95. QNX-Neutrino Device Driver. User Manual. The Embedded I/O Company. Digital I/O. Version 1.0.x. Issue August 2008.

TIP570-SW-95 QNX-Neutrino Device Driver TIP570 16/8 Channel 12 Bit ADC and 8 Channel 12 Bit DAC on SBS PCI40 Carrier

ATC-AD8100K. 8 Channel 100 khz Simultaneous Burst A/D in 16 bits IndustryPack Module REFERENCE MANUAL Version 1.

PAS 9715/AO ENGINEERING SPECIFICATION

Technical Information Manual

Artisan Technology Group is your source for quality new and certified-used/pre-owned equipment

Technical Information Manual

SmartHeap for Multi-Core

Allen-Bradley PLCs. Product Data

DT9000 Development Kit V1.1

DYNAMIC ENGINEERING 150 DuBois St. Suite C, Santa Cruz, CA Fax Est.

VMEbus Vertical Interconnect Alan Jones

1 PROJECT OVERVIEW This project develops a simple file system using an emulated I/O system. The following diagram shows the basic organization:

Janus-MM Basic CAN Driver For Linux 2.6.xx and Windows XP. User Manual Revision A

TPMC901-SW-95. QNX4 - Neutrino Device Driver. User Manual. The Embedded I/O Company. 6/4/2 Channel Extended CAN-Bus PMC

PAS 9732/AI ENGINEERING SPECIFICATION

Operating Systems. Lecture 05

VxWorks Device Driver User s Manual

USB Debug Adapter. Power USB DEBUG ADAPTER. Silicon Laboratories. Stop. Run. Figure 1. Hardware Setup using a USB Debug Adapter

CS140 Operating Systems Final December 12, 2007 OPEN BOOK, OPEN NOTES

INTRODUCTION TO THE UNIX FILE SYSTEM 1)

IP-1553B MIL-STD-1553

ams AG austriamicrosystems AG is now The technical content of this austriamicrosystems document is still valid. Contact information:

PROGRAMMAZIONE I A.A. 2017/2018

Chapter Operation Pinout Operation 35

TDRV010-SW-95. QNX6 - Neutrino Device Driver. Isolated 2x CAN Bus. Version 1.0.x. User Manual. Issue September 2016

LabWindows Guidelines for Interrupt and DMA Programming in Loadable Object Modules

Table of Figures Figure 1. High resolution PWM based DAC...2 Figure 2. Connecting the high resolution buck converter...8

spwr_base & spwr_chan

DRIVER AND LIBRARY FOR DB67 DSP BOARD DRIVER AND LIBRARY FOR DB67 DSP BOARD

Kinco PLC Training. Kinco Automation

Technical Information Manual

RELEVANT MANUALS...2 CHAPTER 1 INTRODUCTION 3 CHAPTER 2 USING C CONTROLLER MODULE 5

ProvideX. C-Library File IO Routines

DDA-06 External DAS Driver

DYNAMIC ENGINEERING 435 Park Dr., Ben Lomond, Calif Fax Est

The CCB gpio-104 device-driver

ALPHI Technology ATC-1553-DDC. MIL-STD-1553 BC/ RT/ BM Industry Pack Module REFERENCE MANUAL Revision 1.0 Jan.

Fall 2015 COMP Operating Systems. Lab #3

MOTOROLA SDI INTERFACE USER S MANUAL

MP1251/MP1252 SMBus Voltage Source

ENGR 3950U / CSCI 3020U Midterm Exam SOLUTIONS, Fall 2012 SOLUTIONS

Chp1 Introduction. Introduction. Objective. Logging In. Shell. Briefly describe services provided by various versions of the UNIX operating system.

Introduction. This project will focus primarily on processes.

INSTALLING INSTALLING INSTALLING

S1V30080 Series I2C Interface Sample Program Specifications

Operating Systems. Lecture 06. System Calls (Exec, Open, Read, Write) Inter-process Communication in Unix/Linux (PIPE), Use of PIPE on command line

VMISFT-RFM2G. Drivers for Windows NT, 2000, 2003 Server and XP Operating Systems Installation Guide Document Number # Rev.

IP-AD Channel 500 khz Simultaneous IndustryPack Module REFERENCE MANUAL Version 1.4 June 2003

VTR2535T-128K and VTR2535T-512K OCTAL 12bit 10MHZ TRANSIENT RECORDER

PEMP ESD2531. I/O and File System. Session Speaker. Deepak V. M.S Ramaiah School of Advanced Studies - Bengaluru

In the HEW, open a new project by selecting New workspace from the main menu.

A Fast Review of C Essentials Part I

PMC-DA Channel 16 Bit D/A for PMC Systems REFERENCE MANUAL Version 1.0 June 2001

Project 1 System Calls

Allen-Bradley Spares

CNT5505 Programming Assignment No. 4: Internet Packet Analyzer (This is an individual assignment. It must be implemented in C++ or C)

Lecture 3: Concurrency & Tasking

Maxim > Design Support > Technical Documents > Application Notes > Microcontrollers > APP 4465

UMAC Guide PUB NE 60th Way Vancouver, WA Voice Fax

CSCI 2212: Intermediate Programming / C Review, Chapters 10 and 11

82V391x / 8V893xx WAN PLL Device Families Device Driver User s Guide

Qedit 5.7 for HP-UX. Change Notice. by Robelle Solutions Technology Inc.

Lecture 8: Unix Pipes and Signals (Feb 10, 2005) Yap

bc620at Developer s Kit User s Guide November, 1998

VxWorks BSP User Guide. Ref: BSPUG0120

C Language Programming, Interrupts and Timer Hardware

VMIVME-3113A Specifications

NIOS CPU Based Embedded Computer System on Programmable Chip

Real Time Control of the MIT Vehicle Emulator System

INPUT-OUTPUT ORGANIZATION

SL100/SL240 Software Installation Manual for Tornado 2.2 and VxWorks Using the PCI, PMC, or CPCI Cards. Document No. F-T-MI-VWXXGS21-A-0-A5

Introduction to C Programming

The Peripheral Component Interconnect (PCI) Bus and vxworks

DREAM 2 WIRED RTU SYSTEM GUIDE

Introduction to OS Processes in Unix, Linux, and Windows MOS 2.1 Mahmoud El-Gayyar

TCP866-SW-82. Linux Device Driver. User Manual. The Embedded I/O Company. 8 Channel Serial PMC Version 1.0.x. Issue 1.

AC/DC. Adapter. Ribbon. Cable Serial. Serial. Adapter. Figure 1. Hardware Setup using an EC2 Serial Adapter

Transcription:

ICS-121 VxWORKS DEVICE DRIVER MANUAL Interactive Circuits And Systems Ltd. February 1999 The information in this manual has been carefully checked and is believed to be reliable; however, no responsibility is assumed for possible inaccuracies or omissions. Interactive Circuits and Systems Ltd. reserves the right to make changes to products herein described to improve reliability, function, or design. No patent rights are granted to any of the circuits described herein. Extra copies of this manual are available from the factory. ICS Ltd 5430 Canotek Road Gloucester, Ontario K1J 9G2 Canada Tel: (613) 749-9241 USA: (800) 267-9794 Fax: (613) 749-9461 E10540 REV.A

TABLE OF CONTENTS 1 INTRODUCTION 1 1.1 Related Documents 1 2 INSTALLATION GUIDE 2 2.1 Installing the ICS-121 2 2.2 Installing the ICS-121 Device Driver Software 3 2.3 Using the ICS-121 Device Driver 4 3 PROGRAMMING GUIDE 5 3.1 Driver Initialization Functions 5 ics121drv Initialize ICS-121 Driver 5 ics121devcreate() Add ICS-121 board to device list 5 3.2 Dynamic Installation of ICS-121 Device Driver at Run Time 7 3.3 Opening and Closing the ICS-121 Device 7 3.4 Library Functions 9 ics121deviceopen Open an ICS-121 board 9 ics121deviceclose(ics121) Close an ICS-121 board 9 ics121devicereset(ics121) Reset board 9 ics121gainset(ics121) Set gain for One Channel 9 ics121rangegainset(ics121) Set gain on range of channels 11 E10540 REV.A i

1 INTRODUCTION The ICS-121 is a 32-channel single-width 6U VMEbus analog signal conditioning board. It is designed to be used with the ICS-130 Sigma-Delta Analog-to-Digital Converter board. VxWorks is a high performance real-time operating system with UNIX-compatible networking facilities available from Wind River Systems, Inc. This manual describes a VxWorks device driver that implements a standard I/O model for the ICS-121. With this driver and its associated C language function library, an applications programmer can efficiently configure and operate the ICS-121. To facilitate the learning process, working example code is included. These routines configure and operate the ICS-121 under various configurations. Document Overview There are three sections to this document: Section 1 Section 2 Section 3 This section. The Installation Guide describes how to install an ICS-121 and it's device driver into a VxWorks environment. The Programming Guide describes the ICS-121 library that contains routines to perform each of the major card functions. 1.1 Related Documents This document should be read in conjunction with the following related documents: 1. ICS-121 Operating Manual, Interactive Circuits and Systems Ltd., Document number E10539. 2. VxWorks Programmer's Guide, Version 5.1, Wind River Systems Inc., December 1993, Document Number DOC-100000-0002. 3. VxWorks Reference Manual, Version 5.1, Wind River Systems Inc., December 1993, Document Number DOC-100001-0001. E10540 REV.A 1

2 INSTALLATION GUIDE 2.1 Installing the ICS-121 Step 1 - The ICS-121 base address must be selected so as not to conflict with other devices in the target system. The ICS-121 occupies a 256 Byte physical address space. Either A16 or A24 addressing mode may be used to access the board; jumper JP1 on the board determines which mode is active. The base address of the board is selected by means of switches on the board (see Ref. 1). To avoid choosing a physical address which conflicts with memory space already in use, it is recommended that the addresses of any boards already installed be identified. Step 2 - Backplane jumpers for the VMEbus bus grant (BG0 - BG3) signals and the IACKIN/IACKOUT signal may be either in place or removed, as these lines are shorted on the board in order to provide continuity for boards further down the daisy chain. The ICS-121 has no interrupt capability. E10540 REV.A 2

2.2 Installing the ICS-121 Device Driver Software Step 1 - The ICS-121 driver should be placed in the <VxWorks>/src/drv/ics121 directory, where <VxWorks> represents the directory where VxWorks was installed on the host computer. To do this, the installer must login as root (or any other account with Superuser privileges) on the host computer and change the default directory using: $> cd <VxWorks>/src/drv $> mkdir ics121 $> cd ics121 Step 2 - Next, the distribution tape should be inserted into the tape drive and the command: $> tar xv should be used to restore its contents. Once this is done, read the README file, and the file test.c. Step 3 - During normal operation, the driver code in file ics121.c uses the VxWorks function taskdelay() to generate a delay after programming a channel gain value. This is required in order to allow time for the serial data to be clocked to the programmable gain amplifiers. The delay value is determined by the variable ICS121_WRITE_WAIT which is declared near the start of the file. The default delay value is one tick of the processor clock, which is typically 10ms for the Motorola MVME-167 CPU board. The minimum delay required by the ICS-121 is 50µs. The user may need to modify this delay value for the target processor. Step 4 - Rebuild the driver by running 'make'. (The test program assumes operation with a Motorola MVME 167-32A, and an ICS-121 card configured to respond to VME A16/D16 addressing). $> make The ICS-121 driver is now installed and ready for use. E10540 REV.A 3

2.3 Using the ICS-121 Device Driver The test program should be read first. It may need to be customized for your target system. After VxWorks is running correctly on the target processor, you may download and run the test program from the VxWorks Shell as follows: -> ld < <Host_Name>:<VxWorks>/src/drv/ics121/test ------------------ -> test where <Host_Name> represents the Ethernet node name of the VxWorks development station. This example assumes either that the user has a direct serial port connection to the VxWorks target, or else has an Ethernet connection and has performed a remote login to the target. The driver and function library object files may be linked in to any application that uses functions of the driver, in the same way that other functions are included. The test program first calls the ics121drv() and ics121devcreate() functions. If either of these calls returns an error, a message will be printed to the console device and the program will exit. If the latter of these two functions returns an error, it usually means that the board address or jumper JP1 setting are not compatible with the base address and address mode given in the call to ics121devcreate(). Alternatively, the target processor VME mapping hardware may not be correctly programmed. The user must make sure that this is done correctly in all application programs. The test program includes code necessary to configure a Motorola MVME-166, MVME-167 or MVME- 187; however, this code will not be applicable to other computer models. Once the icsdrv() and ics121devcreate() functions have returned without error, a menu is printed on the console. The user may choose to reset the board, to set the gain of a single channel, to set the gains of a range of channels, or to exit the program. E10540 REV.A 4

3 PROGRAMMING GUIDE 3.1 Driver Initialization Functions This section describes the driver initialization functions. NAME ics121drv Initialize ICS-121 Driver SYNOPSIS STATUS ics121drv(void); Initializes the ICS-121driver code for VxWorks. This function must be called before any other ICS-121functions are invoked. If multiple ICS-121boards are installed in the current system, this function need only be called once. RETURNS OK If successful, or if the driver was already initialized, ERROR If VxWorks was unable to initialize the driver. NAME ics121devcreate() Add ICS-121 board to device list SYNOPSIS STATUS ics121devcreate( char *devicename, /* Device name e.g. /ics121/0" */ int adrmod, /* Address Modifier */ unsigned long vmeaddress /* Base address of board */ ); Adds a named ICS-121 board to the VxWorks device list. The driver name parameter should specify the device type ("/ics121") and a unit number ("/n"), where n = 0 to number of cards - 1. The device type/unit number combination must be unique in the system. This function must be called after ics121drv() and before any other ICS-121 function is invoked for this board. The base address must be a value consistent with the A16 or A24 address mode selected with parameter adrmod. It must also be configured using switch blocks SW1 and SW2 on the board; factory default is 0x008000. E10540 REV.A 5

The choice of A16/A24 addressing selected by the adrmod parameter must also be configured using board jumper JP1; factory default is A16. Legal values for the Address Modifier are as follows. The symbols are defined in VxWorks header file <VxWorks>/h/vme.h: VME_AM_SUP_SHORT_IO VME_AM_USER_SHORT_IO VME_AM_STD_SUP_PGM VME_AM_STD_SUP_DATA VME_AM_STD_USR_PGM VME_AM_STD_USR_DATA Short (A16) Supervisory Access Short (A16) Non-privileged Access Standard (A24) Supervisory Program Access Standard (A24) Supervisory Data Access Standard (A24) Non-Priv. Program Access Standard (A24) Non-Priv. Data Access RETURNS OK If successful, or if the driver was already initialized, ERROR If VxWorks was unable to initialize the driver, with errno set to one of: S_ioLib_NO_DRIVER ICS121_INVALID_BOARD ICS121_DEVICE_ALREADY_CREATED ICS121_HARDWARE_INIT_FAILED ICS121_ADD_DEVICE_FAILED E10540 REV.A 6

3.2 Dynamic Installation of ICS-121 Device Driver at Run Time Before the driver can be used, it must be initialized by calling ics121drv(). This routine should be called exactly once regardless of the number of ICS-121 boards in the system. This must be done before any reads, writes, or calls to ics121devcreate(), e.g.: ics121drv(); The function call ics121devcreate() must be made once for each ICS-121 board in the system, giving a unique name to each board. This must be done before any driver I/O functions are called, e.g.: ics121devcreate( "/ics121/0", VME_AM_SUP_SHORT_IO, 0x8000); This example creates the ICS-121 device called "/ics121/0" which will communicate to the ICS-121 board at the address 0x8000 in VME Short address space. The user must ensure that the processor is configured to generate D16 data cycles. If more than one ICS-121 is installed in the system, the file name could then be "/ics121/n", where (n) ranges from 0 to the number of boards installed less one. 3.3 Opening and Closing the ICS-121 Device After calling the device initialization functions described in section 3.1, the ICS-121 must be opened before any I/O can take place between the user and the ICS-121. This may be done either by using the VxWorks open() function or by using the ics121device Open() function included in the function library described in section 3.4. The open() function takes three parameters: the name of the device to be opened, the flags and the access mode. The name of the device to be opened will be the name given to VxWorks by the function call 'ics121devcreate()'. The flags parameter should be O_RDWR, which allows the user to both read and write the device. Further details of this call are given in Ref. 3 under the iolib library entry. If the ics121deviceopen() call is used to open the device, the only required parameter is the device name. When an ICS-121 is successfully opened, both open() and ics121deviceopen() return an integer (the file descriptor) that is used to refer to the active ICS-121 in all subsequent actions. If an error has occurred, open() returns ERROR, while ics121deviceopen() returns NULL. E10540 REV.A 7

A typical application program would use the following code to create and open the ICS- 121 device attached to "/ics121/0": int ics121; if (ics121drv() == ERROR) { printf(" ics121drv returned error\n"); printf(" errno = 0x%x\n", errnoget() ); return (ERROR); } if (ics121devcreate("/ics121/0", VME_AM_SUP_SHORT_IO, 0x8000 ) == ERROR) { printf(" ics121devcreate returned error \n"); printf(" errno = 0x%x\n", errnoget() ); return (ERROR); } if ( (ics121 = ics121deviceopen("/ics121/0")) == NULL ) { printf(" Error opening /ics121/0 "); exit (errno); } The ics121deviceopen() will fail if the device driver has not been installed, if the ICS-121 is not present, or if the ICS-121 is being used by another process. Once the ICS-121 has been successfully opened, the user can control the card using the library functions described in section 3, or the ioctl() routines. When the application has finished using the device, the close() function should be used to free it up for use by other users or processes: ics121deviceclose(ics121); which should generate no errors. E10540 REV.A 8

3.4 Library Functions This section describes the ICS-121 library functions contained in file "121low.c". NAME ics121deviceopen Open an ICS-121 board SYNOPSIS RETURNS int ics121deviceopen( char *devicename /* Device name e.g. /ics121/0" */ ); Opens the ICS-121 attached to "devicename". File descriptor, or A null pointer if an error occurred. The file descriptor is needed in all subsequent library function calls. NAME ics121deviceclose(ics121) Close an ICS-121 board SYNOPSIS RETURNS STATUS ics121deviceclose( int ics121 /* File descriptor */ ); Closes the device attached to the file descriptor "ics121". OK NAME ics121devicereset(ics121) Reset board SYNOPSIS RETURNS STATUS ics121devicereset( int ics121 /* File descriptor */ ); Resets the ICS-121 to a gain setting of -12dB on all channels. OK NAME ics121gainset(ics121) Set gain for One Channel E10540 REV.A 9

SYNOPSIS STATUS ics121gainset( int ics121, /* File descriptor */ int channel_number, /* Number of channel */ int gain /* Gain value, -12 to +42 db incl. */ ); Sets the specified channel (1-32 inclusive) to the specified gain value (-12dB to +42dB in steps of 6dB). After programming a gain value, a task delay of ICS121_WRITE_WAIT of the CPU clock is made before the function returns (see section 2.2 above). RETURNS OK or ERROR, and errno equal to ICS121_INVALID_CHANNEL_NUMBER if channel number not valid. or ICS121_INVALID_GAIN_VALUE if gain value not valid. E10540 REV.A 10

NAME ics121rangegainset(ics121) Set gain on range of channels SYNOPSIS STATUS ics121rangegainset( int ics121, /* File descriptor */ int first_channel, /* Number of first channel to program */ int last_channel, /* Number of last channel to program */ int gain /* Gain value, -12 to +42 db incl. */ ); Sets all of the specified range of channels (1-32 inclusive) to the specified gain value (-12dB to +42dB in steps of 6dB). After programming a gain value to each channel, a task delay of ICS121_WRITE_WAIT of the CPU clock is made before the next channel is programmed or before the function returns (see section 2.2 above). RETURNS OK or ERROR, and errno equal to ICS121_INVALID_CHANNEL_NUMBER if either first_channel or last_channel not valid. or ICS121_INVALID_GAIN_VALUE if gain value not valid. E10540 REV.A 11