Home

Sun Microsystems EDT S16A User's Manual

image

Contents

1. get README 6 Exit ftp quit 7 Follow the instructions in the README file to extract and install the software from the Z file The latest release of this manual is also available via the World Wide Web site under Technical Support Manuals or via ftp to ftp edt com in pub manuals s 1 6a ps Z postscript format compressed 40 EDT Inc October 1996 S16A User s Guide Index A ADC16071 See National Semiconductor ADC16071 Analog Input Module usus sa SR sa Ee sk 1 configuration amp Control 15 16 internal register vnisecicnarinicotda Ee Ges dee edge 31 B Burr Brown POM1702 rios 1 product specification sccm conca 39 BURST EN register DI eise ee dis 30 Cc Connectors SPD EEN 25 external ER OE Ee 25 Control And Next Count registers esse esse sees 29 Current Count registers e sredeeugeteeukerdeneregerk 29 Current DMA Address registers sesse esse sees 28 D DAC Output Control register uses esse ee se ee ee 30 Device driver installing Re oe ER id naisena 2 Ie tel AE N EE raet 3 multiple EE 3 leese 3 DIFFERENTIAL register bit sees ee esse esse sesse ees 32 DIO Data r gist rt iasiasind cid 30 DIO Direction tegistel iniciaron cia 30 Distribution diskette iese ee ee ee se ee 3 4 DMA DIR READ register Dit esse esse sees see 29 DMA START register DI iss ses sg tsetse eveeses 29 E Electrical Interface siese Ge GERGEN EE REG Ee 23 EN EODMA register bit sessies idees sees pinitos 29 Error conditi
2. Table 3 Error Codes and Conditions 22 EDT Inc October 1996 S16A User s Guide Hardware Interface Hardware Interface This section describes how to connect your device to an S16A interface including the electrical characteristics of the signal the signal descriptions the timing specifications and the connector pinout Electrical Interface The two S16A analog inputs each have the following characteristics e 100 KOhm impedance e configurable input sources differential input signals either of the two differential leads plus and minus as a single ended signal either of the analog outputs ground e base input range 2 5 to 2 5 volts e input gain adjustments ranging from 1 to 100 power in 7 steps e offset and gain trim adjustments The 516A analog outputs have the following characteristics e low impedance 70 Ohm e single ended non differential signals e 20 bit precision e range from 2 5 to 2 5 volts e separate adjustable level offsets The S16A also provides 12 general purpose I O pins each of which can be configured as either input or output The outputs are TTL level high impedance 1 KOhm the inputs are TTL level 0 5 volt compatible EDT Inc October 1996 23 Hardware Interface Interface Signals S16A User s Guide The following table describes the signals in the external connector Signal S16A I O Description DIOOO 11 CHOOUT CH1OUT CHOINP CHOINM CH1INP CH1INM
3. Sun SBus Specification B 0 part number 800 5323 05 available from Sun Microsystems Inc 415 960 1300 EDT Inc October 1996 39 Contacting EDT S16A User s Guide Contacting EDT Contact EDT directly at the following address or phone numbers Engineering Design Team Inc 1100 NW Compton Drive Suite 306 Beaverton Oregon 97006 Phone 503 690 1234 FAX 503 690 1243 In addition a variety of services from sales information to updated manuals to technical support is available through EDT s World Wide Web site at http www edt com If you have had the board for a period of time before installing it we recommend you get the latest software over the internet to ensure you have all the latest enhancements You can either do this by accessing our World Wide Web page and selecting Technical Support then Software then specifying which operating system version and driver to download Alternately you can use ftp to get the software directly using the following procedure 1 FTP to the EDT ftp server by typing ftp ftp edt com 2 Login as anonymous The password is your e mail address 3 Change tothe appropriate directory for the version of the operating system you are running If you are running SunOS 4 1 3 or later type cd pub sl6a 4x If you are running SunOS 5 x Solaris 2 4 or later type cd pub sl6a 5x 4 Set binary transfer mode by typing bin 5 Download the software and README file get EDTsl6a tar Z
4. program that defines them If the Xilinx is not loaded or loaded with an incorrect program those registers are inaccessible The Xilinx IC is programmed when the S16A driveris loaded User applications should not access the Xilinx registers EDT Inc October 1996 37 Specifications S16A User s Guide Specifications The SBus 16 bit Dual Analog Interface conforms to the following specifications SBus Compliance Number of slots 1 Transfer size Input 1 word per transfer Output 4 words per transfer DVMA master SBus memory space approx 320 KBytes Clock rate 25 MHz Software Drivers for Sun OS Version 4 1 3 or later and System V Version 4 Solaris 2 4 or later Power 5Vat2A Environmental Temperature Operating 10 to 40 C Nonoperating 20 to 60 C Humidity Operating 20 to 80 noncondensing at 40 C Nonoperating 95 noncondensing at 40 C Physical Dimensions 3 3 x 5 78 x 0 5 Weight 3 5 OZ 38 EDT Inc October 1996 S16A User s Guide References References The following additional documentation may prove helpful Burr Brown PCM1702 product specification in Burr Brown Integrated Circuits Data Book Data Conversion Products1995 pp 8 2 108 to 8 2 115 Available from Burr Brown Corporation 800 548 6132 National Semiconductor ADC16071 product specification in National Data Acquisition Databook 1995 Edition pp 2 672 to 2 689 Available from National Semiconductor Corporation 800 272 9959
5. writing past 291 does not fail This call is not multibuffering and no transfer is active when it completes Syntax int sl6a_write Sl6aDev sl6a_p void buf int size Arguments sl6a_p S16A device handle returned from s16a_open buf address of buffer to write from size size of write in bytes Return The return value from write errno is set by write on error EDT Inc October 1996 21 Input and Output S16A User s Guide foi_parity_error Description Checks to determine if a parity error has occurred since the last time this routine was called and returns 0 if not 1 if so and 1 if the routine is not supported for a particular device or an illegal argument was provided Syntax int foi_parity_error Sl6aDev sl6a_p Arguments s16a p S16A device handle returned from s16a open Return 0 if no error 1 if parity error 1 if the routine is not supported or if an illegal argument was provided Error Conditions The table below shows some of the error codes that may be received from a call to the S16A driver After any I O system call the errno global variable contains the error code if any and the perror system call can print out a string describing the error code Refer to your system programming documentation for details about errno and perror Error Code Failing Driver Call Error Condition The S16A attach failed The device is not present The S16A is already opened with an exclusive lock
6. 1 The UART responds with the eight character sequence xxxx return linefeed gt space where xxxx is the four character hexadecimal value read from the 16 bit register EDT Inc October 1996 35 Registers S16A User s Guide Write to a Trim Register The trim registers are written by sending a four byte sequence beginning with D or w Damm Write an 8 bit value to a trim register n Number of the trim register to be written 2 Output 0 offset 3 Output 1 offset 4 Input 0 gain trim 5 Input 0 offset 6 Input 1 gain trim 7 Input 1 offset mm Hexadecimal value to write to the register The UART responds with the four character sequence return linefeed gt space Read the Temperature Register The Temperature register is read by sending a one byte command T or t T Read the Temperature register The UART responds with the seven character sequence xxx return linefeed gt space where xxx is the three character hexadecimal value See Temperature Register beginning on page 34 for details on how to interpret this value UART Command Status Register The UART CSR is an 8 bit register at 0400C0x This register controls the serial byte stream protocol used to configure and control the internal analog input module Bit Description 7 A read only status bit A value of 1 indicates the S16A UART is asserting an SBus interrupt 6 Unused 0 when read 5 UART_TXBSY A read only status bit A value of 1 indicates the S16A UART i
7. offset to be zero calibrated by configuring its input to be ground and adjusting its input offset while monitoring the input data for zero After setting up one of the analog I O channels as a calibrated input reconfigure the analog I O channel input to monitor the analog I O channel output in question Finally with all zeros for the output data adjust the output trim until zeros are read in the input channel EDT Inc October 1996 33 Registers S16A User s Guide Trim Input Gain Registers These two trim registers control the fine tuning of the analog I O input gain Trim register 4 controls the gain trim for analog I O channel 0 input trim register 6 controls the gain trim for channel 1 input The input offset should be set using a zero level input signal before setting the input gain Trim Input Offset Registers These two trim registers control the fine tuning of the input gain Trim register 5 controls the input offset for analog I O channel 0 trim register 7 controls the input offset for analog I O channel 1 The recommended procedure for adjusting these input trim registers is to connectit to the signal source set the source to generate a zero level signal and then adjust the input offset while monitoring the input data for zero The input offset trim should be set using a zero level input signal before configuring the input gain and input gain trim settings Temperature Register The S16A contains an internal temperature probe
8. returned from the driver Syntax void sl6a wait buffers Sl6aDev sl6a_p int bufnum Arguments s16a np S16A device handle returned from s16a open bufnum buffer number for which to block Completed buffers are numbered cumulatively starting with 0 when the S16A is opened Thus the allocated buffer number is the transferred buffer number modulo the number of allocated buffers NOTE If you wait for all the buffers the driver is left with none to use when this call returns and an overrun or underrun will occur Return Address of last completed buffer on success NULL on error If an error occurs check the errno global variable for more information 20 EDT Inc October 1996 S16A User s Guide Input and Output s16a_wait_for_next_buffer Description Blocks until the next buffer is returned from the driver Returns immediately if a buffer is already complete The completed buffers are numbered consecutively so the first call to s16a_wait_for_next_buffer returns the address of buffer 0 the next will be 1 and so on Syntax void sl6a_wait_next_buffer Sl6aDev sl6a_p Arguments s16a p S16A device handle returned from s16a open Return Address of completed buffer on success NULL on error If an error occurs check the errno global variable for more information s16a write Description Perform a write on the 16A The UNIX 2 GB file offset bug is avoided during large amounts of input or output that is
9. sub assembly the Analog Input Module This module is controlled and configured using a byte sequence protocol as described in the section Analog Input Module Control Protocol beginning on page 34 The S16A boards fully support the requirements of the SunOS operating system Example programs are included Each of the two I O channels appears as two subdevices to the SunOS operating system one for input and one for output for a total of four subdevices This document explains how to install the S16A interface and driver and how to write applications for it It is divided into the following sections Installation describes how to install the board and its related software Input and Output describes the programming interface library Hardware Interface Protocol provides a connector pin out diagram and describes the 516A signals and timing Registers describes the hardware registers Specifications lists the product specifications References lists other documentation resources that may be helpful Contacting EDT describes how to contact EDT and how to access EDT resources on the Internet EDT Inc October 1996 1 Installation S16A User s Guide Installation Installing the S16A SBus 16 bit Dual Analog Interface is a two step process First you must physically install the board inside the host computer Then you must install the software driver so that applications can access the S16A Hardware installation is described in the follow
10. that can be read via the Analog Input Module UART interface to provide data for temperature dependent calibration adjustments This two byte register returns a 12 bit reading that can be converted to a Celsius temperature using the formula C 5 0 r 4096 1 375 0 0225 where r is the raw temperature reading and C is the resulting Celsius temperature As an Analog Input Module register this register is accessed via the UART registers Analog Input Module UART Registers The S16A Analog Input Module is configured and controlled by a byte stream protocol via two UART registers on the SBus Command sequences of bytes are sent to the module which in turn responds with byte sequences Two interface registers the UART CSR and the UART Data register implement this byte stream interface on the SBus Analog Input Module Control Protocol All command and status sequences consist entirely of printable ASCII characters Commands are case insensitive The command character is always echoed valid arguments are also echoed invalid argument characters are ignored Commands are not terminated with a carriage return or newline when the last character of the command is sent the command is immediately executed and the response string is sent back 34 EDT Inc October 1996 S16A User s Guide Registers Write to a Clock Prescale Register The clock prescale registers are written by sending a four byte sequence beginning with W or w Wam
11. 16 or 20 bits Syntax int sl6a set output bits SlbaDev sl6a_p int value Arguments sl6a_p S16A device handle returned from s16a_open value Either 16 or 20 indicating the operational mode of the output DAC Return Returns 0 on success or 1 on failure Fails if s16a_p does not refer to an output channel or if value is anything but 16 or 20 Sets errno on failure s16a_start_buffers Description Releases the specified number of buffers to the driver for transfer Syntax int sl6a_start_buffers Sl6aDev sl6a_p int bufnum Arguments sl6a_p S16A device handle returned from s16a_open bufnum Number of buffers to release to the driver for transfer An argument of 0 causes the driver to perform continuous transfers Return 0 on success 1 on error If an error occurs check the errno global variable for the error number EDT Inc October 1996 19 Input and Output S16A User s Guide s16a_stop_ buffers Description Stops DMA transfer after the current buffer has completed whether DMA is occurring continuously or noncontinuously If DMA is continuous also dismantles ring buffer mode and frees the resources it consumed Syntax int sl6a_stop_buffers Sl6aDev sl6a_p Arguments s16a p S16A device handle returned from s16a open Return 0 on success 1 on error If an error occurs check the errno global variable for the error number si6a wait for buffer Description Blocks until the specified buffer is
12. 16a configure ring buffers Configures the ring buffers s16a buffer addresses Returns addresses of ring buffers s16a wait for buffer Blocks until specified buffers have completed s16a wait for next buffer Blocks until the next buffer completes s16a check next buffer Checks whether next buffer is complete s16a start buffers Begins transfer from or to specified number of buffers s16a cancel Shuts down the device as soon as possible optionally resets it s16a cancel current Cancels the current DMA moves pointers to the next s16a stop buffers Stops the interface after all buffers have completed s16a done count Return absolute cumulative number of completed buffers Io parity error Checks for parity error since last call Table 1 General DMA Library Routines EDT Inc October 1996 7 Input and Output S16A User s Guide The following driver specific routines are also available Routine Description s16a get dac control reg Get the current state of the output DAC control register s16a get dio data reg Get the current state of the DIO Data register s16a get dio direction reg Get the current state of the DIO Direction register s16a get output bits Get the output resolution of the S16A s16a serial read Read a response string from the Analog Input module s16a serial str Send a command string to the Analog Input module and return the response only if it differs from the string sent s16a serial write Send a co
13. 6A User s Guide s16a_get_output_bits Description Get the output resolution of the S16A Returns 16 or 20 reflecting the current driver setting for the output channel Syntax int sl6a_get_output_bits Sl6aDev sl6a_p Arguments s16a p S16A device handle returned from s16a open Return Returns 16 or 20 on success returns 1 if the ioctl driver call fails and sets errno to indicate the problem s16a open Description Opens the specified S16A and sets up the device handle Syntax S16aDev sl6a open int unit int channel int output Arguments unit specifies the device unit number channel specifies the analog I O channel number O or 1 output specifies the direction 1 means the output subdevice 0 means the input subdevice Return A handle of type S16aDev or NULL if error If an error occurs check the errno global variable for the error number 14 EDT Inc October 1996 S16A User s Guide Input and Output s16a read Description Performs a read on the S16A The UNIX 2 GB file offset bug is avoided during large amounts of input or output that is reading past 2 does not fail This call is not multibuffering and no transfer is active when it completes Syntax int sl6a_read Sl6aDev sl6a_p void buf int size Arguments sl6a_p S16A device handle returned from s16a_open buf address of buffer to read into size size of read in bytes Return The return value from read errno is set b
14. NEN 30 Analog Input Module Internal Registers un 31 Input Clock Prescale Registers EE A AEA AR A aE eE aa nana ESE ESAE a 32 Input Configuration Registers irssi e ekrevis e a nonanar nn Eae nara EEEE EAS 32 Ir EE 33 Temperature TES E a a E E E RE EEEE 34 Analog Input Module UART Registers een 34 Analog Input Module Control Protocol ee 34 UART Command Status Register Eeer EENS EENS 36 UART Data Register iS ES SEE De ie DE dE dee Eege 37 Xilinx Programming Regieterg EEN 37 PEC CALL ONS A A a AA AA AAA AAA AAA ee 38 EE 39 Boe did BAR EE ER N OE EN AE mbr 40 A EE TEE RE EN EE EL OE EE OG 41 EDT Inc October 1996 iii S16A User s Guide Tables General DMA Library Routines cuidat 7 S16A 5pecitic Library ROUUMES cita ia daa 8 Error Codes and Comditrons EE OE NE OE N OE OE N 22 SAGA Interface SIA SE ed sesh id EE RE EE NE N EE EN 24 Connector Egeter CECR 25 DMA Channel ASsignmiments sist see Ee de A Se ic 28 Current DMA Address Registers sees see se se e Ge ee Se ee ee ee E Ge ee Gee AR AA GR GR ee cn ee Se ee ee ee ee E 28 Next PMA Addres RESISTORS N N N OK N OR EO EE 29 Current Count Reeistef EER EE A A A es 29 Controliand Nest Count Registers i s HR EER SE aiii 29 DAC Output Control Register diia ee Ee ee ek eg Ge Ge Ee TR De ee be Rye e 31 Analog Input Module Internal Regtoterg AA 31 Input Selection Low Byte Values non cnn non crono nn ee conc on GR non neon Se ee cn near E ee nn ee ee ee 32 Input Gain Eligh Byte V
15. ONLY ees esse sees se ee ee ee ee 32 OUTO 20BIT isc Se Ed de De ds se N Gede 31 OUTO ENABLE ee 31 OUTO MINUS ees sesse se ee ee ee ee ee 32 OUTO PLUS esse sees sesse ee ee ee ee ee 32 SURN VERE N EE EN 31 OUTI_ENABLE iese sees sees ees ee ee ss ee ss ee 31 OUT1 MINUS osse Gees Seeds ieia 32 QUTI PLUS esse a ee ee ee ee ee ee 32 PLUS ONL Ycua anda 32 VART CR EE 36 UART_RXRD Y esse sees sesse es see eed ee see ee 36 UART_TXBSY ees esse se ee ee ee ee ee 36 UART TINT sissies sesde eko Ge sd SE gese 36 ZERO ES SEE ee Ge Ge Ge ee Ge Ed ee 32 Registers Control And Next Count esse sesse ses ee ee ee 29 Current Collin lira 29 Current DMA Address sesse see ee ee 28 DAC Output Control dese taa 30 BIO Data cuina dead 30 DIO RE e EE 30 Input Clock Prescale sesse se os de eg 32 Input Confie uration asse ER ees 32 Next DMA Address 28 Temerarios 34 Trim Input GR Ee deen 34 Tem Input E 34 Trim Output OFS E sos ss ees 33 UART Command Status sees esse ee se see 36 ERR ER EE 37 EE 37 S s16n get dio data reg 13 s16n get dio direction Te9 eeue ee ee ee ee ee 13 s16a get output bits sesse ese ee ee ee ee ee eg 14 SLOG serial rende ee Biss tt 15 EES UR SO NE EE WE RI 16 SL OA serial write see ES AE es De Ee ge ee Ee gede 16 s16n set doc control reg 17 s16n set dio data Teg EE 18 s16n set dio direction reg 18 s16a set output DitS ees ee ee Ge ee ee ee ee 19 HER Gr OE N EE NE 19 42 S16A User s Guide SBu
16. S16A SBus 16 bit Dual Analog Interface for the Sun SPARC station USER S GUIDE 008 00630 01 S16A User s Guide The information in this document is subject to change without notice and does not represent a commitment on the part of Engineering Design Team Inc The software described in this document is furnished under a license agreement or nondisclosure agreement The software may be used or copied only in accordance with the terms of the agreement No part of this manual may be reproduced or transmitted in any form or by any means electronic or mechanical without the express written agreement of Engineering Design Team Inc O Copyright Engineering Design Team Inc 1992 1997 All rights reserved Refer questions or problems with this manual or the hardware or software described herein to Engineering Design Team Inc 1100 NW Compton Drive Suite 306 Beaverton Oregon 97006 Phone 503 690 1234 Fax 503 690 1243 E mail info edt com Web www edt com Sun SunOS SBus SPARC and SPARCstation are trademarks of Sun Microsystems Incorporated UNIX and OPEN LOOK are registered trademarks of UNIX System Laboratories Inc X Window System is a product of the Massachusetts Institute of Technology EDT and Engineering Design Team are trademarks of Engineering Design Team Inc ii EDT Inc October 1996 S16A User s Guide Contents COV EL VICW ik RE ee A AAA A A AAA Ee Ge ee 1 sta ii SA A E AT ai AA ceoma nee web
17. T Inc October 1996 25 Registers S16A User s Guide Registers The S16A SBus 16 bit Dual Analog Interface is configured and controlled with 8 bit and 32 bit SBus registers Eleven additional internal registers in the Analog Input Module are accessed indirectly through the SBus registers using a simple protocol Applications access S16A registers through library calls or ioctl calls with S16A specific parameters as described in the s16a h header file NOTE All registers initialized and manipulated by the S16A driver User applications do not ordinarily need to read or write these registers In addition the S16A provides a standard SBus configuration ROM at the beginning of its block of addresses Thus the SI6A answers with valid data for the first 64 KBytes in addition to the SBus registers 26 EDT Inc October 1996 S16A User s Guide Registers SBus Addresses The addresses listed in the figure below are offsets from the SBus slot base address Obtain the SBus base address from the SBus host documentation The following sections describe the S16A registers in detail 0x0006 0000 0x0004 0x0004 0x0004 0x0004 0x0004 0x0004 0x0004 0x0004 0x0004 0x0004 0x0004 0x0004 0x0004 0x0002 0x0002 0x0002 0x0000 0x0000 00C4 00C0 0080 0044 0040 003 0038 0034 0030 000 0008 0004 0000 0008 0004 0000 FEFC 0000 Byte Word reserved uart_csr not used nx
18. The low order byte controls the input source the high byte provides a primary gain control The following two tables list the useful values for the low and high bytes One value from each table must be chosen and bitwise ORed together to configure this register As Analog Input Module registers these registers are accessed via the UART registers Value Value hex Description DIFFERENTIAL Both input pins for this channel are monitored as a differential signal PLUS ONLY The plus input pin for this channel is monitored as a single ended xx48 signal MINUS ONLY Dee input pin for this channel is monitored as a single ended ZERO The input is taken from ground Used for offset calibration xx48 OUTO PLUS The plus signal from output channel 0 is monitored as a single ended signal x84 OUTO_MINUS The minus signal from output channel 0 is monitored as a single ended signal OUT1 PLUS The plus signal from output channel 1 is monitored as a single ended signal x82 OUT1_MINUS ae signal from output channel 1 is monitored as a single ended Table 13 Input Selection Low Byte Values 9 2 EDT Inc October 1996 S16A User s Guide Registers Value hex AIN_ Description e A LI 09xx X2 Gain factor 2 0Axx X5 Gain factor 5 OC xx X10_1 First gain factor 10 Uses the first stage gain at maximum Second gain factor 10 Uses the second stage 10 x gain Recommended for higher ba
19. UVCC 24 Configurable VO pins Output of channel 0 Output of channel 1 Channel 0 plus input Configurable as one of a pair of differential signals the only single ended signal or disabled Channel 0 minus input Configurable as one of a pair of differential signals the only single ended signal or disabled Channel 1 plus input Configurable as one of a pair of differential signals the only single ended signal or disabled Channel 1 minus input Configurable as one of a pair of differential signals the only single ended signal or disabled Available 5 volt supply Thermally fused for 200 mA resets after cooling Table 4 S16A Interface Signals EDT Inc October 1996 S16A User s Guide Hardware Interface Connector Pinout The S16A uses a 37 pin D connector such as an AMP 748878 1 The following pinout diagram describes the connection from the S16A board to the cable NOTE Do not connect your own circuits to the unused pins as they may be internally connected to the S16A Pin Signal 1 20 DIO01 2 DIO02 DIO03 3 Ground Ground 4 DIO04 DIO05 5 DIOO6 DIOO7 6 Ground Ground 7 DIOO8 DIOO9 8 DIO10 DIO11 9 Ground Ground 10 CHOOUT Ground 11 Ground CHOINP 12 CHOINM Ground 13 Ground Reserved 14 Reserved Ground 15 Ground CH1INP 16 CH1INM Ground 17 Ground CH1OUT 18 Ground Ground 19 UVCC Table 5 Connector Pinout ED
20. a a library call Sets errno on failure s16a_serial_ write Description Send a command string to the Analog Input Module Syntax int sl6a_serial_write Sl6aDev sl6a_p char buf size Arguments s16a p S16A device struct returned from s16a open buf Array of characters containing the command string to send to the Analog Input Module size Number of characters in the command string Return Success number of characters transferred 1 on driver error Sets errno on failure 16 EDT Inc October 1996 S16A User s Guide Input and Output s16a_set_dac_control_reg Description Write a specified value to the output DAC Control register Syntax int sl6a_set_dac_control_reg Sl6aDev sl6a_p int value Arguments sl6a_p S16A device handle returned from s16a_open value Value to write to the DAC Control register Return Returns 0 on success or 1 on failure Fails if s16a_p does not refer to an output channel Sets errno on failure s16a_set_defaults Description Resets the S16A configuration to its default state e The Xilinx Programming registers are set to S16A_XRESET and then cleared e The UART Command Status register and the DAC Output Control register are set to 0 e Gain and offset values are set from deo s16a cfg which is generated when you run s16acalibrate e Ring buffer mode is disabled and driver or library allocated ring buffers are released Syntax int sl6a set defaults Sl6aDev sl6a_p Argume
21. ach channel The second lowest hexadecimal address digit specifies the DMA channel The maximum byte count for a single DMA transfer is 1 MB Each of these registers reflects the counter for the current DMA transfer in progress if any on it s channel Bit Description 31 20 Always 0 19 2 When read these bits display how many words remain in the DMA transfer currently in progress 1 0 Always 0 S16A DMA transfers consist of whole 32 bit words Table 9 Current Count Registers Control and Next Count Registers The Control And Next Count registers are 32 bit registers at address 0x4000C 0x4001C 0x4002C and 0x4003C The second lowest hexadecimal address digit specifies the DMA channel These registers provide the transfer counts and control of the DMA hardware for each of the four DMA channels Bt SIGA Description 31 INT A read only status bit A value of 1 indicates the S16A is asserting an SBus interrupt 30 Unused 0 when read 29 DMA_START A value of 1 enables DMA transfer 28 Unused 0 when read 27 EN EODMA A value of 1 enables end of DMA interrupt 26 Fe Unused 0 when read 25 DMA DIR READ DMA direction a value of 1 reads host memory 0 writes it For channels 0 amp 1 must be 0 for channels 2 amp 3 must be 1 Table 10 Control and Next Count Registers EDT Inc October 1996 29 Registers S16A User s Guide Bit S16A_ Description BURST EN A value of 1 enables burst transf
22. alles iii ot ae 33 Trim EE 33 UART Command St tus Register 2 OR EO ER OR Eed ie eer egen 36 iv EDT Inc October 1996 S16A User s Guide Overview Overview The S16A SBus 16 bit Dual Analog Interface is a single slot board for SBus based computer systems The S16A has two analog I O channels each incorporating one 16 bit Analog to Digital ADC converter and one 20 bit Digital to Analog DAC converter The S16A is designed for continuous input and output on both channels simultaneously and is typically used for scientific and medical research and development The S16A employs two Burr Brown PCM1702 analog output DACs running at a sample rate of 705 6KHz which is 16 times the standard audio frequency of 44 1 KHz The two S16A analog input ADCs are National Semiconductor ADC16071s running with a base sampling rate of 192KHz The S16A provides a clock prescale register to divide this frequency down for lower rates The S16A uses the SBus DMA interface and can transmit or receive any amount of data to and from host memory continuously on both channels at once Each I O channel s input ADC can monitor a differential signal either of the two differential inputs as a single ended signal either of two I O channels DAC outputs or a reference ground The ability to monitor the outputs directly or ground allows the S16A to be tested and adjusted using these internal loop backs A portion of the functionality of the S16A is contained in a
23. are copied to the Current DMA Address register the next count is copied to the Current DMA Count register and the new transfer is started automatically Bit Description 31 20 The 1 MB page addressed by the DMA 19 2 When read the next address to access on the SBus 10 Always 0 S16A DMA transfers must be 32 bit word aligned Table 7 Current DMA Address Registers Next DMA Address Registers The Next DMA Address registers are 32 bit registers at addresses 0x40004 0x40014 0x40024 and 0x40034 one for each DMA channel The second lowest hexadecimal address digit specifies the DMA channel 28 EDT Inc October 1996 S16A User s Guide Registers These registers hold the address of the next DMA transfer to be performed for each channel When the current DMA transfer on a channel completes if there is a next one set up the contents of the Next DMA Address register for the channel are copied to the Current DMA Address register the next count is copied to the Current DMA Count register and the new transfer is started automatically LEE EE AA I I I I IE Show or store the 1 MB page addressed by the next DMA Show or store the address within the page for next DMA to use Set to 0 S16A DMA transfers must be 32 bit word aligned Table 8 Next DMA Address Registers Current Count Registers The Current Count registers are 32 bit read only registers at address 0x40008 0x40018 0x40028 and 0x40038 one for e
24. c s16a 0 sun4m s16a s16aload c s16a rbt drv_ioctl h s16a_reg h libs16a h libs16a c s16a h s16a INSTALL makefile README setdebug c calfiles The executable S16A driver for SunOS 4 1 3 on a Sun 4C architecture such as a SPARCStation 1 1 2 or IPC The executable S16A driver for SunOS 4 1 3 on a Sun 4M architecture such as a SPARCStation 5 10 20 LX Classic or an Ultra 1 or 2 The executable S16A driver for Solaris Version 2 4 or later Initializes the S16A Xilinx hardware at boot time Xilinx data file Common driver architecture ioct definitions Hardware definitions for the drivers Library definitions for applications using the libs16a a library Source code for the libs 16a a library The S16A driver header file defining ioctls and registers The installation script used by the S16A makefile The makefile for installing loading and unloading the S16A driver and making example programs Used with the SunOS make command to automatically install the driver or compile the example programs An ASCII file containing last minute information about the S16A software This file sets the internal driver debug levels for the S16A Call EDT for details Calibration files whose names match the serial numbers of shipped units EDT Inc October 1996 5 Input and Output S16A User s Guide Input and Output The driver can perform two kinds of DMA transfers continuous and noncontinuous For noncontinuous transfer
25. eboot yln y Entering y or simply typing lt Return gt causes the S16A driver to be loaded whenever you reboot your host computer If you respond with n you must manually reload the driver after rebooting To do so enter make load During the installation the following question appears on the display How many S16A devices do you want 1 You can install as many S16A boards in your system as you have DMA SBus slots available Enter the number corresponding to the number of S16A boards you have installed in your system If you simply type lt Return gt one S16A device entry is installed Note that each S16A board is appears to SunOS as one main device and four unidirectional subdevices one input and one output each for both of the analog I O channels NOTE If you anticipate installing more than one S16A board into your system install as many S16A device entries as you will ultimately require The extra device entries will do no harm and will be there when you need them saving you a step If the S16A has not been installed inside the host computer or has been installed incorrectly the follow ing message appears on the display Can t load this module If you see this message go back to the section entitled Installing the Hardware and reinstall the board If troubles persist contact EDT for further assistance To unload the S16A driver 1 2 Change to the directory in which you placed the 516A files if you are
26. er For channels 0 amp 1 must be 0 for channels 2 amp 3 must be 1 Unused 0 when read SIZ_MSK Number of words to transfer in the next DMA transfer When the next DMA starts this value is copied into the corresponding bits of the current count register Always 0 S16A DMA transfers consist of whole 32 bit words Table 10 Control and Next Count Registers Continued Direct I O Registers The S16A provides 12 pins in its external connector that can be used for general purpose I O signals Each pin can be configured as either an input signal or an output signal Signal levels are TTL level 0 or 5 volt with 1 KOhm source impedance The following sections describe how to access these signals DIO Direction Register The DIO Direction register is a 32 bit register at address 0x40040 This register configures the 12 DIO pins in the S16A connector to be either input or output Each of the low 12 bits in this register controls the corresponding DIO signal if the bit is set the pin is an output signal if the bit is clear the pin is an input signal DIO Data Register The DIO Data register is a 32 bit register at address 0x40044 The low 12 bits in this register reflect the state of the corresponding DIO pins in the S16A connector Writes to this register set the states of the pins that have been configured to be output signals reads return the states of the pins that have been configured to be input signals DAC Out
27. gure_ring_buffers sl6a_p 1024 4 NULL EDT_READ 4 Acallto sl6a start buffers with an argument of 0 to initiate a continuous transfer such as sl6a_start_buffers sl6a_p 0 5 Acallto sl6a wait for buffer orsl6a_wait_for_next_buffer to such as buf_ptr sl6a_wait_for_buffer sl6a_p 4 6 Acallto s16a_close to close the device before ending the program as in sl6 a_close sl6a_p 6 EDT Inc October 1996 S16A User s Guide Input and Output 7 The 1s16a option to the compiler to link the library file libs16a a with your program See the makefile and example programs provided for examples of compiling code using the library routines DMA Library Routines The DMA library provides a set of consistent routines across many of the EDT products with simple yet powerful ring buffered DMA capabilities Table 1 DMA Library Routines lists the general DMA library routines In addition if driver specific library routines exist they can be found in a table thereafter The sections that follow describe the DMA library routines in alphabetical order Routine Description s16a open Opens the S16A for application access s16a close Terminates access to the S16A and releases resources s16a read Single application level buffer read from the S16A s16a write Single application level buffer write to the S16A s16a set defaults Restores the driver and hardware to factory specified default state s
28. ice handle returned from s16a_open Return Integer containing current state of the DAC Control register The global variable errno is set on error 12 EDT Inc October 1996 S16A User s Guide Input and Output s16a get dio data reg Description Get current state of the DIO Data register The low 12 bits reflect the current state of the DIO pins Bits that are configured as outputs are read as zero To check for an error clear the errno global variable before calling this function then check it for nonzero after the function returns Syntax u_int sl6a_get_dio_data_reg Sl6aDev sl6a_p Arguments s16a p S16A device handle returned from s16a open Return Integer containing current state of the DIO Data register The global variable errno is set on error s16a get dio direction reg Description Get current state of the DIO Direction register The low 12 bits reflect the configuration of the corresponding DIO pins If a bit is set the DIO pin of the same number is configured as an output signal To check for an error clear the errno global variable before calling this function then check it for nonzero after the function returns Syntax u_int sl6 a_get_dio_direction_reg Sl6aDev sl6a_p Arguments s16a p S16A device handle returned from s16a open Return Integer containing current state of the DIO Direction register The global variable errno is set on error EDT Inc October 1996 13 Input and Output S1
29. ice with a cable This cable is typically device specific Installing the Software The S16A can run on a Sun workstation using either SunOS Version 4 1 3 or later or Solaris 2 4 or later System V Release 4 or SVR 4 The installation procedures differ Both are given below Using SunOS Version 4 1 If you are using SunOS Version 4 1 3 or later use the following procedure to install the S16A driver 1 Become root or superuser 2 Create a directory in which you wish to install the S16A driver EDT suggests var EDTs16a 3 Change to the directory in which you wish to install the S16A driver 2 EDT Inc October 1996 S16A User s Guide Installation 10 Place the diskette that came with the S16A into the diskette drive The S16A driver and related files are included on a diskette in tar format To copy them to your hard disk enter tar xvf dev rfd0 The tar program extracts a number of files The list of files distributed is provided in the section entitled Included Files The S16A diskette contains versions of the S16A driver for a variety of Sun platforms and versions of the Sun operating system The installation program installs the correct driver based on the host platform and operating system version To install the driver enter make install The makefile provided installs and loads the S16A driver During the installation the following question appears on the display Automatically load the S16A driver during each r
30. ing section Software installation is described in the section after Installing the Hardware The S16A board is a single slot SBus board To install it refer to your SBus host computer documentation for complete information on installing an SBus board For example many Sun systems contain this information in a manual entitled SPARCstation Installation Guide Use the following procedure to install the SBus 16 bit Dual Analog Interface CAUTION Both the S16A and your SBus host computer contain static sensitive components Install the S16A at a static free work area If a static free work area is not available take the following precautions to reduce the risk of component damage 1 Remove from the immediate area all materials that can generate or hold a static charge 2 Discharge yourself by touching both hands to a metal portion of the host computer s chassis before you open the host computer or open the S16A static shielded bag 1 Unpack the SBus 16 bit Dual Analog Interface from the shipping packaging Do not remove the S16A from the static shielding bag until you remove all other packaging materials from the area and establish a static free work area 2 Install the S16A in the SBus host following the directions provided with the SBus host The S16A can be installed in any DMA slot To remove the SBus 16 bit Dual Analog Interface reverse the installation procedure The SBus 16 bit Dual Analog Interface connects to your dev
31. m Write an 8 bit value to a Clock Prescale register n Number of the Clock Prescale register to be written 0 is input channel 0 1 is input channel 1 mm Hexadecimal value to write to the register The UART responds with the four character sequence return linefeed gt space Write to an Input Configuration Register The input configuration registers are written by sending a six byte sequence beginning with W or w Wnmmmm Write a 16 bit value to an Input Configuration register n Number of the Input Configuration register to be written 2 is input channel 0 3 is input channel 1 mmmm Hexadecimal value to write to the register The UART responds with the four character sequence return linefeed gt space Read from a Clock Prescale Register The Clock Prescale registers are read by sending a two byte sequence beginning with R or r Rn Read an 8 bit value from a Clock Prescale register n Number of the Clock Prescale register to be read 0 is input channel 0 1 is input channel 1 The UART responds with the six character sequence xx return linefeed gt space where xx is the two character hexadecimal value read from the 8 bit register Read from an Input Configuration Register The Input Configuration registers are read by sending a two byte sequence beginning with R or r Rn Read a 16 bit value from a Input Configuration register n Number of the Input Configuration register to be written 2 is input channel 0 3 is input channel
32. mmand string to the Analog Input module s16a set dac control reg Write a value to the output DAC Control register s16a set dio data reg Write a value to the DIO Data register s16a set dio direction reg Write a value to the DIO Direction register s16a set output bits Set the output resolution of the S16A Table 2 S16A specific Library Routines s16a buffer addresses Description Returns an array containing the addresses of the buffers Syntax void sl6a_buffers Sl6aDev sl6a_p Arguments s16a p S16A device handle returned from s16a open Return Address of an array of pointers to the ring buffers allocated by the driver or the library The array of buffer pointers is allocated by the library Null on error 8 EDT Inc October 1996 S16A User s Guide Input and Output s16a_cancel Description Stops any transfers currently in progress resets the ring buffer pointers to restart on the current buffer Syntax int sl6a_cancel Sl6aDev sl6a_p Arguments sl6a_p S16A device handle returned from s16a_open Return 0 on success 1 on failure Sets errno on failure s16a_cancel_current Description Stops the current transfers resets the ring buffer pointers to the next buffer Syntax int sl6a_cancel Sl6aDev sl6a_p Arguments s16a p S16A device handle returned from s16a open Return 0 on success 1 on failure Sets errno on failure s16a check next buffer Description Check
33. ndwidth Gain factor 20 12xx X50 Gain factor 50 14xx X100 Gain factor 100 Uses both stages at maximum Table 14 Input Gain High Byte Values Trim Registers The Analog Input Module contains six Digital to Analog converters DACs that control various trim adjustments on the S16A The analog input and output signals can be level shifted and the input signal gains can be fine tuned with these DACs These trim DACs are controlled by six 8 bit trim registers These trim registers are set with the D command described in Analog Input Module Control Protocol beginning on page 34 As Analog Input Module registers these registers are accessed via the UART registers Trim Register Use 2 controls the output trim for analog I O channel 0 controls the output trim for analog I O channel 1 controls the input gain trim for analog I O channel 0 controls the input offset for analog I O channel 0 controls the input gain trim for analog I O channel 1 N OO oy Pi controls the input offset for analog I O channel 1 Table 15 Trim Registers Trim Output Offset Registers These two trim registers control a voltage offset for the output of each analog I O channel Trim register 2 controls the output trim for analog I O channel 0 trim register 3 controls the output trim for channel 1 The recommended procedure for adjusting these output trim registers is to first adjust one of the analog I O channels input
34. not already there Become root or superuser EDT Inc October 1996 3 Installation S16A User s Guide 3 Enter make unload Using System V Release 4 Solaris 2 4 or Later If you are using Sun System V Release 4 Solaris 2 4 or later use the following procedure to install the SI6A driver 1 Become root or superuser 2 Place the diskette that came with the S16A into the diskette drive 3 Enter volcheck pkgadd d floppy floppy0 EDTsl16a The pkgadd program asks several confirmation questions which you can answer with a y for affirmative Refer to your Solaris system administration documentation for further information on the pkgadd command To remove the S16A driver 1 Become root or superuser 2 Enter pkgrm EDTsl6a For further details consult your Solaris 2 0 documentation or call Engineering Design Team Inc Building the Sample Programs To build any of the example programs enter the command make file where file is the name of the example program you wish to install without the c suffix To build and install all the example programs simply enter the command make All example programs display a message that explains their usage when you invoke them with the h switch 4 EDT Inc October 1996 S16A User s Guide Installation Included Files The S16A driver release diskette contains the following files see the readme file for a complete up to date listing s16a 0 sun4
35. nts sl6a_p S16A device handle returned from s16a_open Return Return value from ioctl call to driver 0 on success 1 on error If an error occurs check the errno global variable for the error number EDT Inc October 1996 17 Input and Output S16A User s Guide s16a set dio data reg Description Write a specified value to the DIO Data register Only the low 12 bits are significant of these bits that are configured as inputs are ignored when written Syntax int sl6a set dio data reg SlbaDev sl6a_p int value Arguments s16a np S16A device handle returned from s16a open value Value to write to the DIO Data register Return Returns 0 on success or 1 on failure Fails if s16a_p does not refer to an output channel Sets errno on failure s16a set dio direction reg Description Write a specified value to the DIO Direction register The low 12 bits configure the corresponding DIO pins If a bit is set the DIO pin of the same number is configured as an output signal Syntax int sl6a set dio direction reg Sl6aDev sl6a_p int value Arguments sl6a_p S16A device handle returned from s16a_open value Value to write to the DIO Direction register Return Returns 0 on success or 1 on failure Fails if s16a_p does not refer to an output channel Sets errno on failure 18 EDT Inc October 1996 S16A User s Guide Input and Output si16a set output bits Description Set the output resolution of the S16A to
36. ons EXIST at SEN 22 EN ion ani ni 22 l Input Clock Prescale registers uses esse ee se ee ee 32 Input Configuration registers sesse esse ee se ee ee 32 EDT Inc October 1996 Index Installation hee oi Ge N Te 2 eo Ie RE EE ES 2 INT register Dit ses ers ed Eg 29 M A a aient aAA a raaa 3 MINUS ONLY register Dit esse sesse sesse esse es se ee 32 N National Semiconductor ADC16071 ees see 1 product specification dee Ee 39 Next DMA Address registerS esse ses see se ee 28 O OUTO_20BIT register bt ese sisie ens ee ee 31 OUTO ENABLE register bit esse esse see sees se ee 31 OUTO MINUS register bit sesse sesse esse es se ee 32 OUTO PLUS register Dit ss see N RA N de 32 OUT1_20BIT register bit iese kes ER ei 31 OUT1 ENABLE register bit esse esse sees see ese ee 31 OUT1 MINUS register bit sesse sesse esse es se ee 32 QUITA PLUS register bit as se ED Ergo 32 P PCM1702 See Burr Brown PCM1702 pkgadd command ege ER Se GE SG ee 4 PLUS ONEY register E 32 R Eet 39 Burr Brown PCM1702 product specification39 National Semiconductor ADC16071 product sp cification enin seeni ae 39 SBus POCO see se De Dee 39 41 Index Register bits BURST EN EG See de de ge ge ee EDE ei 30 DIFFERENTIAL ees esse es sees ees ee se ee se ee se ee ee 32 DMA DIR READ esse sesse ss ee see se ee ss ee ee 29 DMA START sesse seeks es bee ged SE Ge sd 29 EN EODMA i s iet dee idees be ee eie se ve de aae 29 TIN WEE 29 MINUS
37. page 34 Name Description Trim Output Offset 0 Controls the output voltage offset adjustment for output channel 0 Trim Output Offset 1 Controls the output voltage offset adjustment for output channel 1 Trim Input Gain 0 Controls the input gain adjustment for input channel 0 Trim Input Offset 0 Controls the input level offset adjustment for input channel 0 Trim Input Gain 1 Controls the input gain adjustment for input channel 1 Trim Input Offset 1 Controls the input level offset adjustment for input channel 1 Temperature Two byte register containing a 12 bit temperature reading for calibrating the S16A for different operating temperatures Table 12 Analog Input Module Internal Registers EDT Inc October 1996 31 Registers S16A User s Guide Input Clock Prescale Registers The Analog Input Module contains two 1 byte Input Clock Prescale registers one for each input channel that provide 1 biased divisors for the input clock which has a base rate of 192 KHz The low 3 bits of these registers are significant Thus the input sample rate for each channel is 192 KHz value 1 where value is the channel s Input Clock Prescale register value which can range from 0 to 7 As Analog Input Module registers these registers are accessed via the UART registers Input Configuration Registers The Analog Input Module contains two two byte Input Configuration registers one each for the two input channels
38. put Control Register The DAC Output Control register is a 32 bit register at address 0x40080 This register controls the output analog converters Each of the two channels output converters can be enabled or disabled and can be configured for 16 bit or 20 bit DAC operation In 16 bit mode each sample uses two bytes of DMA data in 20 bit mode each sample uses four bytes of DMA data Upon the first open of an I O channel for output the driver enables the channel and configures it for 20 bit operation The operational mode can then be changed by a library or ioctl call after the channel is opened When the channel is closed the driver clears the enable bit disabling the output 30 EDT Inc October 1996 S16A User s Guide Registers SSA Description OUTO_ENABLE Enables VO channel 0 output 1 OUTO_20BIT When set configures I O channel 0 as 20 bit digital to analog when clear the channel is in 16 bit mode 4 OUT1_ENABLE Enables I O channel 1 output 5 OUT1_20BIT When set configures I O channel 1 as 20 bit digital to analog when clear the channel is in 16 bit mode Table 11 DAC Output Control Register Analog Input Module Internal Registers The Analog Input Module contains 11 internal registers described in the following sections that control the analog input and other settings These registers are accessed using the two UART registers described in the section Analog Input Module UART Registers beginning on
39. s Must be 1 or greater Four is recommended bufarray array of pointers to individual buffers if the buffers are allocated by the application Must be NULL if in library or have nbufs elements library Must be NULL user This array must be filled with the addresses of the buffers allocated by the application for the library to use data_direction Indicates whether this connection is to be used for input or output Only one direction is possible per device or subdevice EDT_READ 0 EDT_WRITE 1 Return 0 on success 1 on error If all buffers cannot be allocated none are allocated and an error is returned EDT Inc October 1996 11 Input and Output S16A User s Guide s16a done Description Returns the cumulative count of completed buffer transfers Syntax int sl6a done count Sl6aDev sl6a_p Arguments sl6a_p S16A device handle returned from s16a_open Return The number of completed buffer transfers Completed buffers are numbered consecutively starting with 0 when the S16A is opened Thus the allocated buffer number is the transferred buffer number modulo the number of allocated buffers s16a_get_dac_control_reg Description Get current state of the output DAC control register To check for an error clear the errno global variable before calling this function then check it for non zero after the function returns Syntax u_int sl6a_get_dac_control_reg Sl6aDev sl6a_p Arguments sl6a_p S16A dev
40. s configuration ROM sis dese vee ep ee 26 SION EE E cda ide US ea cols 2 Specifications environmental esse esse ee see ee ee ee ee ee ee 38 UM en da se Go ss 38 physical aaa 38 POWER is 38 SBUS SN e ee edad 39 EE 38 a A N 38 WAS os 38 SunOS SOAPS WEE 4 AA a ea 4 Version A1 3 2 T tar commande 3 Temerature register En 34 Trim Input Gain registers esse se se se se se ee ee ee 34 Trim Input Offset registers ENEE 34 Trim Output Offset registers sesse esse se ee ee 33 U UART Command Status register sesse esse ee 36 UART Data Register tido 37 UART_INT register bi se Ek Ee Ee tortures 36 UART_RXRDY register bit 36 UART TXBSY register bit vesciciiiosiclndiciai ais ns 36 UART_TXINT register Dit un 36 X Xilinx Programming register iese sees see se ee 37 Z ZERO register E 32 EDT Inc October 1996
41. s the driver uses DMA system calls for read and write Each read and write system call allocates kernel resources during which time DMA transfers are interrupted To perform continuous transfers use the ring buffers The ring buffers area set of buffers that applications can access continuously reading and writing as required When the last buffer in the set has been accessed the application then cycles back to the first buffer See s16a configure ring buffers for a complete description of the ring buffer parameters that you can configure Elements of S16A Applications S16A applications for performing noncontinuous transfers typically include the following elements 1 The preprocessor statement include libsl6a h 2 Acallto s16a_open such as sl6a_p sl6a_open sl6a_p 3 Acalltos16a_read or sl6a_write suchas sl6 a_read sl6a_p buf ptr 512 or sl6a_write sl6a_p buf_ptr 1024 4 Acallto s16a_close to close the device before ending the program such as sl6a_close sl6a_p 5 The 1s16a option to the compiler to link the library file libs16a a with your program S16A applications for performing continuous transfers typically include the following elements 1 The preprocessor statement include sl6a h 2 Acallto s16a_open such as sl6a_p sl6a_open sl6a_p 3 Acallto s16a configure ring buffers to set up the ring buffers as required such as sl6a_confi
42. s 2 Installing the Hardware 2 Installing the Softw Teens Es nar EER Eeer dde 2 UE H Using System V Release 4 Solaris 2 4 or Later se eek SR GER ER ER ER REKE RE REK EEEEE so 4 Building the Sample Programs EE 4 Included E 5 Inputand Output EE ARE EE OE BEE ER EO EE EE 6 Elements of ST6A Applications reste ek ge Sek Ese Re geed ee 6 DMA Library Routines EE Ke ek Se Ge BEKER ER GR Eaa ESAE ek Se BEKER ek ER ra REKE Rek nn ee Ke bek ee ERKEN ee ee ee 7 Exror Conditions si ER Re ke ek ee ees ee ve de Pe Ee eg ee ek ee Ee tov Gee Ge e N ee GE ee ee 22 Hardware Interfaces ocio EE EE RE EE OE EE EE EE OE OR N 23 Electrical Interfaces ee tese ER Sk RE ee Deen Ecker ge ke ee Re Rd se dadas eege 23 Interface Signals coto EE Ee EE geed eege 24 Beast ure duine RE EE EE EE OE OE EE EE 25 RE a e dd dee do Seen 26 SBus Addresses union EE OE EN EE iaa 27 A E 28 Current DMA Address Registers piosse tonn K en EEEE DSE E E nara Bek nr ek ee ER ee ee ee 28 Next DMA Address Registers ese eek Se SE GER ER ER EER ER ER ERGE A Ge BEKER ER ER ER ER ER ek SR ge eek ee ee BEKER ek EER ee ee ee 28 Current Count Registers si ms RE Ee EE Se De gee eet dE gee died Shoal 29 Control and Next Count Registers iese ee se se sek ER ER EER ER eE eK KEERA EEEE RERET eek nara BEKER ek EER ee ee ee 29 Direct I O ES EE AE OO dd EN iaa 30 DIO DirecHon R sister ii eech ESE SR SERE n Gee EI 30 DIO P ta Register AE N RE ER EN AE N EE 30 DAC Output Control Register sis sees beer SEE
43. s currently transmitting a command byte to the analog input module No other bytes can be sent until this bit is clear 4 UART_RXRDY A read only status bit A value of 1 indicates the S16A UART has received a status byte from the analog input module Valid status bytes can only be read from the UART_DATA register when this bit is set 3 UART_TXINT A value of 1 enables the UART transmit complete interrupt 2 UART_TXINT A value of 1 enables the UART receive complete interrupt 10 Unused 0 when read Table 16 UART Command Status Register 36 EDT Inc October 1996 S16A User s Guide Registers UART Data Register The UART Data register is and 8 bit register at address 0400C4x This register provides the byte stream for communicating with the analog input module Write to this register when the UART CSR indicates that it is ready for a write to send a byte to the Analog Input Module Read this register to receive status bytes from the Analog Input Module when the UART CSR indicates that a received byte is available Xilinx Programming Registers The Xilinx programming registers are 3 8 bit registers at addresses 0x20000 0x20004 and 0x20008 The Xilinx chip is a programmable integrated circuit used to implement the S16A interface or to test the board NOTE Any registers defined to control the interface reside in the Xilinx IC In order to access those registers the S16A board requires that the Xilinx be loaded with a
44. s whether the next buffer is complete Syntax int sl6a check next buffer Sl6aDev sl6a_p Arguments sl6a_p S16A device handle returned from s16a_open Return 0 on success 1 on failure Sets errno on failure EDT Inc October 1996 9 Input and Output S16A User s Guide s16a close Description Closes the device associated with the device handle and frees the handle Syntax int sl6a close Sl6aDev sl6a_p Arguments sl6a_p S16A device handle returned from s16a_open Return 0 on success 1 on failure Sets errno on failure 10 EDT Inc October 1996 S16A User s Guide Input and Output s16a_configure_ring_buffers Description Configures the SBus 16 bit Dual Analog Interface ring buffers Any previous configuration is replaced and previously allocated buffers are released Buffers can be allocated and maintained within the SBus 16 bit Dual Analog Interface library or within the user application itself Syntax int sl6 a_configure_ring_buffers Sl6aDev sl6a_p int bufsize int nbufs void bufarray int data_output Arguments sl6a_p S16A device handle returned from s16a_open bufsize size of each buffer For optimal efficiency allocate a value approximating throughput divided by 20 that is if transfer occurs at 20 MB per second allocate 1 MB per buffer Buffers significantly larger or smaller can overuse memory or lock the system up in processing interrupts nbufs number of buffer
45. t_ent_ctl_3 nxt_dma_add_3 cur_dma_add_3 nxt_cnt_ctl_0 cur_cnt_0 nxt_dma_add_0 cur_dma_add_0 not used xpg_stat not used xpg_din not used xpg_reg not used not used S16A ROM 0 1 2 3 0 1 Figure 1 S16A SBus Addresses EDT Inc October 1996 27 Registers S16A User s Guide DMA Registers The S16A provides four independent DMA channels one each for input and output for each of the two analog I O channels Each DMA channel can be accessed to set up a new DMA transfer while itis currently performing a DMA transfer When the current transfer completes the new one begins automatically without pause allowing non stop I O on both I O channels in both directions The following table shows the assignment of DMA channels to I O channels DMA Channel Use 0 Analog VO channel 0 Input 1 Analog l O channel 1 Input 2 Analog VO channel 0 Output 3 Analog l O channel 1 Output Table 6 DMA Channel Assignments Current DMA Address Registers The Current DMA Address registers are 32 bit read only registers at addresses 0x40000 0x40010 0x40020 and 0x40030 one for each DMA channel The second lowest hexadecimal address digit specifies the DMA channel These registers hold the address of the DMA currently in progress for each channel When the current DMA transfer on a channel completes if there is a next one set up the contents of the Next DMA Address register for the channel
46. y read on error s16a_serial_read Description Read a response string from the Analog Input Module Syntax int sl6a_serial_read Sl6aDev sl6a_p char buf size Arguments sl6a_p S16A device struct returned from s16a_open buf Array of characters to receive the response string from the Analog Input Module size Number of characters in the buffer Return Returns the actual number of bytes transferred or 1 on ioctl error Sets errno on failure EDT Inc October 1996 15 Input and Output S16A User s Guide s16a_serial_str Description Send a command string to the Analog Input Module Read the response from the AIM and return it only if it differs from the command string sent Otherwise return NULL This routine is especially useful for command strings which echo the command string unless an error occurs Syntax char sl6a_serial_str Sl6 aDev sl6a_p char str Arguments sl6a_p S16A device struct returned from s16a_open str Null terminated command string to send to the Analog Input Module Return NULL indicates a response string that matches the input command string which indicates successful transmission Otherwise this routine returns a pointer to a string containing the characters received in response to the command string The response string is in a single buffer allocated by the library Therefore if you need to preserve the response string you must copy it to another buffer before making another libs16

Download Pdf Manuals

image

Related Search

Related Contents

  Gigabyte GV-R567D3-1GI AMD Radeon HD5670 1GB graphics card  Zerofranchise.com fait le boulot à votre place  Sony_Nissin_i40_Italian_user manual_July  ASI-8DI-M8-3POL  LevelOne 150Mbps Wireless Access Point  HP 54721A User's Manual  Manuale dell`utente  Dicota Code Backpack 13-15  specoRemote Lite for DVR-4TL User`s Manual  

Copyright © All rights reserved.
Failed to retrieve file