13.07.2015 Views

CompuScope SDK Manua.. - Egmont Instruments

CompuScope SDK Manua.. - Egmont Instruments

CompuScope SDK Manua.. - Egmont Instruments

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

DIGITAL_INPUT.EXEThe sample program DIGITAL_INPUT.EXE is provided with <strong>CompuScope</strong> <strong>SDK</strong> for C/C++ for Windows.The sample program is provided for use with digital input <strong>CompuScope</strong>s like the CS3200. Conceptually, adigital input <strong>CompuScope</strong> is just like analog input <strong>CompuScope</strong> with its analog signal conditioning frontend and A/D converter chips replaced with a digital input buffer. Because of the similarity in the operationof the analog and digital <strong>CompuScope</strong>s, Gage uses exactly the same set of subroutines (the API) to accessboth types of <strong>CompuScope</strong>s. Gage has modified the operation of some API subroutines for digital input<strong>CompuScope</strong>s so that they fit the functionality of these boards.Three important differences exist that must be considered when programming a digital input <strong>CompuScope</strong>1. <strong>CompuScope</strong> Mode. – For an analog <strong>CompuScope</strong> the operating mode, SINGLE or DUAL, specifiesthe number of channels on which to acquire analog signals. For digital input <strong>CompuScope</strong>s, however, themode parameter is used to specify the digital input width. The <strong>CompuScope</strong> 3200, for instance, can beconfigured for 8, 16 or 32 bit input width. In this way, memory usage is optimized. For example, a<strong>CompuScope</strong> 3200 with 2 Mega Bytes of on-board memory can capture 2 Mega Samples in 8-bit mode, 1Mega Samples in 16-bit mode and one-half Mega Samples in 32-bit mode. In order to control the mode,the programmer must set the board.opmode to GAGE_SINGLE_CHAN for 8-bit mode,GAGE_DUAL_CHAN for 16-bit mode and GAGE_QUAD_CHAN for 32-bit mode.2. Logic Input Levels. – One may specify the logic input levels for digital input <strong>CompuScope</strong>s. Forinstance, for the single-ended <strong>CompuScope</strong> 3200, the logic level may be selected to be either CMOS (witha logic threshold of about 2.5 Volts) or TTL (with a logic threshold of about 1.4 Volts). The selection ofeither logic level is done through the analog input range control for channel A, which has no meaning on adigital input <strong>CompuScope</strong>. For selection of the CMOS logic level, the programmer must select the ±5Volts input range and for TTL, the ±1 input range. So the programmer should set board.range_a toGAGE_PM_5_V for CMOS logic and should set board.range_a to GAGE_PM_1_V for TTL logic.3. External Sampling Clock Inversion. – Most digital input applications require the use of an externalclock. In digital electronics, the digital data are generally stable on either one clock edge or the other(rising or falling). The user’s device under test may have differential signal propagation delays, whichmeans that the clock and digital data may take different times to arrive at the digital <strong>CompuScope</strong>. Theuser, therefore, may not know upon which clock edge the data are stable. Consequently, the user must becapable of selecting on which clock edge the digital signals are sampled. The sampling clock edge may beselected using the use_invert_clock variable. If the use_invert_clock variable is set to 0 then the digital<strong>CompuScope</strong> will sample on the rising edge of the input external clock. If the use_invert_clock variable isset to 1 then the digital <strong>CompuScope</strong> will sample on the falling edge of the input external clock.The DIGITAL_INPUT sample program captures a digital signal in single-(8 bit), dual-(16 bit), or quad-(32bit) mode from a digital input <strong>CompuScope</strong>. All captured data are written to separate ASCII data files.Data are stored as unsigned integers in decimal format with ranges 0-255, 0-32767 and 0-4,294,967,295 for8, 16 and 32 bit modes respectively.In order to view the resulting files, you will have to run Microsoft Excel or another program, whichallows you to import ASCII data. You can also use any text editor. In Microsoft Excel, data files can beread by opening them from the File menu. Excel’s Import Wizard will guide you through importing thedata. Select “Delimited” for the type of data, and “Tab” as the delimiter for the data. You can then plot thedata.Page 50<strong>CompuScope</strong> <strong>SDK</strong> <strong>Manua</strong>l

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!