your tris is upside down! 0x38 ( b'00111000' ) sets the 1's as inputs and the 0's as outputs. HOT TIP: (well, tip) use binary notation rather than hex for tris type commands, the 1s and 0s look like Is and Os too, it's also easier to see which pin is which. You need, b'00000111' or 0x07 Also in loop, you are checking GPIO,3 - should this be a different pin? You comment at the beginning says set 0,1,2 as input, but your comment later says read 3 as input......... Garage door warming system eh? What luxury! or is that a typo for warning? Regards, Kevin -----Original Message----- From: pic microcontroller discussion list [mailto:PICLIST@MITVMA.MIT.EDU]On Behalf Of Fok, Ben Sent: 14 August 2001 16:14 To: PICLIST@MITVMA.MIT.EDU Subject: [PIC]: Need help on PIC12C508A programming I am working on a little project using the 12C508A. It is a garage door warming system. The Pic is connected to a buzzer and two LEDs (GPIO 2), one red(GPIO 0) and one green(GPIO 1). I want use GPIO 3/MCLR/Vpp for detection. Here is a short program I wrote: start: org 0x00 movlw 0x38 tris gpio ;set gpio 0, 1, 2 as input and the rest as output movlw 0x3f option ;enable weak pullup and wake on pin change, bit 6 and 7 loop: btfsc gpio, 3 ;check and see if gpio 3 is low goto loop ;if not check again call buzzer ;make the buzzer buzz goto start When I program the PIC I use LP crystal, internal MCLR and no watchdog. The problem I have is gpio 3 is acting as an input pin. I don't know how to debug it because the ICE doesn't emulate that pin. Please help. Ben -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu