Deja News Toolbar BuyDirect BuyDirect message/thread Message 29 of 191 for search * return to search results help Re: User port Author: John Iannetta <73510.2152@CompuServe.COM> Date: 1999/02/20 Forum: comp.sys.cbm sponsored by: eBay more headers author posting history post reply prev next _________________________________________________________________ Martin Gunnarsson said, 'As default all the 8 pins (pb0-pb7) is set as inputs. That way there's 5V between every pin and the ground. It would be pretty bad if all the relays (one for each pin) would be open before the program loads. Actually it could cause pretty much troble. So now I was wondering if there's some kind of "flag pin" or some other way I can find out if a pin is set to input or output. Otherwise I'll just have to use a manual switch and turn on the realy card after the program is loaded.'. There is no such pin, but I suggest thst you do the following. Use PA2 (pin M, bit 2 of $DD00) to deenergize all relays when that pin is high. On power-up, both PA and PB are set to all inputs, so that pin is high (behind about 5 kohms of resistance). Then, a KERNAL routine defines PA2 as an output, and sets the bit (so it is still high, but it can source more current). In your program, clear that bit: poke56576,peek(56576)and251 That should take the line low and let the relays work. -- I pressed RETURN, and the message said, "Missing GOSUB". John _________________________________________________________________ view for bookmarking text only mail this message to a friend post reply << prev · next >> subscribe to comp.sys.cbm SPONSORED LINKS Yellow Pages · Bid on Bargains · Express by Infoseek · Shopping · Free Stuff AutoConnect · Trade with Datek · Auctions & Classifieds · GET IT NOW @ NECX Home · Communities · My Deja News · Power Search · Post About Deja News · Ad Info · Our Advertisers ____________________________________________________ Copyright © 1995-99 Deja News, Inc. All rights reserved. Conditions of use · Site privacy statement reviewed by TRUSTe