PA 200
Functions of the board
25
9.3
Programming examples in C, Pascal, Assembler, Basic
/*
TURBO C
*/
/* Writes digital outputs of a PA200 board */
/* Used compiler: TURBO C version 2.0 mode SMALL */
#define Basic_Adr_PA200 0x390 /* Basic address of PA200 board*/
void main (void) /* ***** Main program ***** */
{
/* Example 1 :
*/
/* Writing occurs in 4 x 8 bits
*/
outportb (Basic_Adr_PA200, 0xAA); /* Bit 0 of value 0xAA on */
/* digital output number 1 */
outportb (Basic_Adr 1, 0x55); * Bit 7 of value 0x55 on
*/
/* digital output number 16 */
outportb (Basic_Adr 2, 0xAA); /* Bit 0 of value 0xAA on */
/* digital output number 17 */
outportb (Basic_Adr 3, 0x55); /* Bit 7 of value 0x55 on digital
*/
/* output number 32 */
}
(*
TURBO PASCAL
*)
(* Writes digital outputs of a PA200 board
*)
(* Used compiler: TURBO PASCAL version 4.0
*)
PROGRAM PA200;
USES DOS;
CONST
Basic_Adr_PA200 = $390; (* Basic address of PA200 board
*)
BEGIN (* **** Main program **** *)
(* Example 1 : *)
(* Writing occurs in 4 x 8 bits *)
PORT [Basic_Adr_PA200] := $0AA; (* Bit 0 of value $0AA *)
(* on digital output number 1
*)
PORT [Basic_Adr 1] := $055; (* Bit 7 of value $055
*)
(* on digital output number
16 *)
PORT [Basic_Adr 2] := $0AA; (* Bit 0 of value $0AA *)
(* on digital output number
17 *)
PORT [Basic_Adr 3] := $055; (* Bit 7 of value $055 *)
(* on digital output number 32 *)
END.