button pullup/down resistor?


Results 1 to 11 of 11

Threaded View

  1. #1
    Join Date
    Dec 2007
    Posts
    60

    Default button pullup/down resistor?

    I have been working for days on an RF project, and I suspect I'm going crazy.

    I have put a button on my 16F877a just so I can tell it to do something.
    The problem is, that when I press the button it activates, but when I let go of it, it stays activated.

    I have gone as low as a 560ohm pullup/down resistor. Tried pulling to ground, and to +5V.

    I am currently using pin D.0

    Code:
    TRISD = %10000000
    but  VAR PORTD.0
    ....
    
    Start:
    
    lcdout $fe,$80,"Rec  ",dec counter
    lcdout $fe,$c0,bin result,"   "
    lcdout $fe,$d4,bin stats,"   "
    
    if but = 1 then
      lcdout $fe,$8A,"B"
      gosub chkstatus
    else
      lcdout $fe,$8A," "
    endif
    
    if nIRQ = 0 then
      lcdout $fe,$94,"Receiving!"
      gosub receive
    else
      lcdout $fe,$94,"Waiting..."
    endif
    
    pause 50
    counter = counter + 1
    
    goto start

    With a 560ohm to +5v, and the button to ground. After it has been pressed, and depressed - I am still measuring 185mV on pin D.0. Even after I remove the jump wire to the button entirely, I am still reading 185mV on the pic with only the resistor connected to +5v.


    HOWEVER... If I take the jump wire from pin D.0 and connect it straight to +5v, and then to ground. The display and functions work as expected.

    How could I have done this? I have tried 2 different (new) 877a's, and several port pins.

    Running on 10MHz, 5V regulated, smoothing caps, on a breadboard.
    Last edited by davewanna; - 15th June 2008 at 00:41.

Similar Threads

  1. Sony SIRC IR Issue
    By Ryan7777 in forum mel PIC BASIC Pro
    Replies: 10
    Last Post: - 8th August 2015, 08:10
  2. 3 HPWM channels
    By docwisdom in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 4th April 2006, 02:43
  3. Code check -- button not working
    By docwisdom in forum mel PIC BASIC Pro
    Replies: 12
    Last Post: - 2nd March 2006, 22:43
  4. Button Push within 3 second Window
    By Tissy in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 22nd December 2005, 10:06
  5. Button subfunction 16F628
    By Jųan in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 19th August 2005, 16:44

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts