beautypg.com

Teledyne LeCroy PC_AT 200 User Manual

Page 8

background image

6

EXAMPLE 1

The following example is a C program that allows the user to type in the
register value in hex and the program will load the value to the probe register
on the board. The base address for this example is assumed to be set at 0x200.

#include
#include
int main(int argc, char **argv)
{
long i, port;

/* Scan in Register1 */
printf(
Enter Data for SW8-SW1 (D7-D0), in Hex:
);
scanf(
%lx , &i);

/*Set Register1 */
outp(0x200, i);

/* Scan in Register2 */
printf(
Enter Data for ON-OFF, SW10 & SW9 (D7,D1,D0), in Hex: );
scanf(
%lx , &i);

/*Set Register2 */
outp(0x201, i);

/* Quit */
exit(0);

}

EXAMPLE 2

You can use the DEBUG mode on your system to control the board manually. Type
debug and you will see the prompt "-". Type ? for list of commands if you need
to. Command "o" is for output and "q" for exit from the DEBUG. After you type
debug and you get the dash prompt then 1) type o for output, 2) space, 3) the
address, 4) space and then the 5) data.

C:\>debug
-o 200 00 To enable the switches 1-8.
-o 201 00 To enable switches 9 &10 and turn the board on (should see the

LEDs turn On)

-o 201 ff To turn the board Off (should see the LEDs go Off)

Please note to have the On-Off switch and the dip switch in the Off positions.

This manual is related to the following products: