Hi, please take into account GPIO.3 can not be used as an output pin. It is simply not capable. BTW, if you BTFS it, then it is o.k. I do not know what she makes if her TRIS bit is set to 0. Regards, Imre +-----------------------------------------------------------------------+ | The information transmitted is intended only for the person or entity | | to which it is addressed and may contain confidential and/or | | privileged material. Any review, retransmission, dissemination or | | other use of, or taking of any action in reliance upon, this | | information by persons or entities other than the intended recipient | | is prohibited. If you received this in error, please contact the | | sender and delete the material from any computer. | +-----------------------------------------------------------------------+ On Tue, 14 Aug 2001, Kevin Blain wrote: > 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 > > > -- 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