
Control Programming
•
29
3.4.3
A Complete Example Program for Interrupt Handling
/**********************************************************/
/* File name : test.C */
/* Purpose : PET-48DIO TEST Source Code */
/* Date : 06/02/1994 */
/* Version : 1.0 */
/* Programmer : JIM LIU */
/* Configuration : (jumper settings)
*/
/*
JP5 : IRQ5
*/
/*
JP10 : 1-2 ( Disable)
*/
/*
JP11 : 2-3 ( Enable)
*/
/*
JP13 : 5-6 ( Disable)
*/
/*
JP14 : 5-6 ( Disable)
*/
/*
*/
/* Copyright ACLONE Inc. (c) 1994 all right reserved */
/*********************************************************/
#include <dos.h>
#include <conio.h>
/**************************************/
/* Constants Decalerations */
/**************************************/
#define LOBYTE(arg) (*(unsigned char *)&arg)
#define HIBYTE(arg) (*((unsigned char *)&arg + 1))
#define LOWORD(arg) (*(unsigned int *)&arg)
#define HIWORD(arg) (*((unsigned int *)&arg + 1))
/***** Define Relative Addresses *****/
#define CCW 0x83
#define COUNT 0x80
#define TIMER1 0x81
#define TIMER2 0x82
#define PA0 0x0
#define PB0 0x1
#define PC0 0x2
#define CW0 0x3
#define PA1 0x4
#define PB1 0x5
#define PC1 0x6
#define CW1 0x7
/*------- Define 8259 ---------------------------------*/
#define IC8259_1 0x20
#define IC8259_2 0xA0
#define EOI 0x20
/*-------------------------------------------------------*/
#define NO_INIT 0xff
#define INITIALED 0x00
#define IRQ5 0x0d
#define INDEX 0x300
#define DATA 0x301
Содержание PET-48DIO
Страница 1: ...NuDAQ PET 48DIO Programmable 48 bit DIO Event and Timer Cards User s Guide...
Страница 2: ......