PIC18F4550 internal pull-ups


Closed Thread
Results 1 to 4 of 4
  1. #1
    Join Date
    Apr 2008
    Location
    Gainesville, VA
    Posts
    15

    Default PIC18F4550 internal pull-ups

    Hi,
    I'm using a PIC18F4550 and wanted to program port B for the internal pull-ups on all inputs. The data sheet says I can do this in software, but I can't seem to find anything in the PIC Basic Pro compiler manual. Can someone tell me how to do this?
    Thanks,
    Klaus

  2. #2
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    Hi Klaus,
    welcome on the forum. The beauty of the compiler is that you can access each and every PIC register to do what YOU want to do. Here, it's not a compiler built-in feature you need, it's a specific PIC feature you need to enable/disable.

    Let's see the datasheet (yeah you must make friend with it... even if this one is pretty big) i heard the size don't matter

    http://ww1.microchip.com/downloads/e...Doc/39632D.pdf

    PDF page 69 , table 5-2, find INTCON2 register and look bit 7 RBPU..ok ok.. i agree for now it doesn't mean anything...

    Go at page 102, There you find the whole explanation for this INTCON2 register and RPBU bit.

    As you see, to enable the internal pull-up, you just need to 'clear' bit 7 of this register. How to? Easy..
    Code:
    INTCON2.7=0
    That's it that's all
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  3. #3
    Join Date
    Apr 2008
    Location
    Gainesville, VA
    Posts
    15


    Did you find this post helpful? Yes | No

    Default

    Many thanks. It will take me awhile to get familiar with this. Been using a basic stamp so this is all new to me.
    Klaus

  4. #4
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    You're welcome... once you use PIC, you never go back to Stamps. Big jump though.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

Similar Threads

  1. Internal vs. external osc for comms
    By mtripoli in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 29th January 2010, 14:58
  2. Weak pull Up 12F629
    By Lionheart in forum General
    Replies: 1
    Last Post: - 9th December 2008, 21:07
  3. 12F683 internal pull up
    By hvacrtech in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 27th July 2008, 02:35
  4. PIC12F675, accuracy of baud rate with Internal Oscillator
    By Chris Mayhew in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 31st August 2005, 22:41
  5. Counting better ?
    By Franko in forum mel PIC BASIC Pro
    Replies: 16
    Last Post: - 25th August 2005, 01:27

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