Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!ucbvax!hplabs!hpfcdc!hpfcmgw!rdg From: rdg@hpfcmgw.HP.COM (Rob Gardner) Newsgroups: comp.sys.hp Subject: Re: HELP needed with GPIO interface Message-ID: <1080057@hpfcmgw.HP.COM> Date: 6 Jun 89 18:46:44 GMT References: <52@eutnv1.UUCP> Organization: HP Fort Collins, CO Lines: 36 > We are designing an interface between the 98622A GPIO interface in > our HP9000-330 computer (HP-UX 6.2) and a bus system that was developed > char character; > > gpio_dev = open("/dev/gpio", O_RDWR); Check the return value from the open. This could easily fail!! Also, if you are writing one char at a time, add in: io_width_ctl(gpio_dev, 8); /* need to link w/ -ldvio */ io_reset(gpio_dev); /* usually a good idea */ > for (i = 0; i < 1000000; i++) > { > write(gpio_dev, character, sizeof(char)); ^^^^^^^^^ You need &character here to get the correct data out. You're lucky this doesn't simply core dump. Check the return value here also. > and use a bus monitor to simulate handshaking manually, the first > write() doesn't wait for the PFLG to become low but the second does. Check the senses of the handshake switches on the 98622 card, as they can affect the logic. Rob Gardner hplabs!hpfcmr!rdg Hewlett Packard or rdg%hpfcmr@hplabs.hp.com Fort Collins, Colorado 303-229-2048 80525-9599 "Ask me about Home Brewing"