I changed the resistors to 10k as you suggested but my program still did not work. It turns out all I had to do to solve my problem was to turn off the Low Voltage Programing feature in PicBasic. If this is enabled PortB.3 is used for programming. Turned off it can be used for digital Iinput/Output. That small problem has killed a few brain cells...ha. Thanks Wrong Way Ray (Raymond Choat) ----- Original Message ----- From: "William Tan" To: Sent: Wednesday, May 23, 2001 7:10 PM Subject: Re: [PIC]: PortB --> > Hi, Raymond, > > Try this > > 5V > ___ > | > | > R1 (R1: try 10k) > | > | > PortB.3 ------+ > | > | > SW > | > | > v > Gnd. > > Hope this work. Tell me the result! Good luck. > > > Raymond Choat wrote: > > > This is how I wired all three inputs > > > > +5v > > | > > R47k > > | > > pic PortB.3 <-------|-----R220 ---------------> Switch ------>Ground > > > > = = = = = = = = = = = = = = = = = = = = = = = > > Here is test program to try out just the trig inputs > > > > DEFINE OSC 20 ' Define processor speed to 20 MHz > > > > TRISB = %00111000 ' Set Three LineInputs on PORTB to input > > TRISC = %00000000 ' Set all of PORTC to outputs > > > > ' - - - - INPUT PORT B - - - - > > paus var PORTB.2 ' Rename PORTB.2 as emer > > trig var PORTB.3 ' Rename PORTB.3 as enab > > emer var PORTB.4 ' Rename PORTB.4 as trig > > > > ' - - - - OUTPUT PORT C - - - - > > done var PORTC.1 > > spare var PORTC.0 > > greenled var PORTC.2 ' Rename PORTC.4 as led_on > > yellowled var PORTC.3 ' Rename PORTC.5 as led_off > > > > PortC = %00000000 ' Turn off all PortC (Doneline, LEDs, Air) > > > > start: > > IF trig = 1 THEN > > yellowled = 0 > > greenled = 1 > > > > ENDIF > > > > IF trig = 0 THEN > > greenled = 0 > > yellowled = 1 > > > > ENDIF > > > > goto start > > > - - - - - - - - - - - - - - - - - - - - - - - - - - > > > > When I press switch the yellowled turns on > > When I do not press switch nothing turns on > > What gives. I even tried a new Pic chip > > Are my 47k pullup resistors too large or something? > > > > Wrong Way Ray (Raymond Choat) > > > > -- > > http://www.piclist.com hint: The list server can filter out subtopics > > (like ads or off topics) for you. See http://www.piclist.com/#topics > > -- > http://www.piclist.com hint: The list server can filter out subtopics > (like ads or off topics) for you. See http://www.piclist.com/#topics > > > -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu