Internal pullups on 18F45K22


+ Reply to Thread
Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2014
    Location
    England
    Posts
    16

    Default Internal pullups on 18F45K22

    Hi,

    I'm going round in circles trying to find how to set the weak pullups on Port B of the 18F45K22.

    It seems to involve INTCON2 to enable the pullups; and WPUB to set the individual bits.

    Could anyone assist with the correct syntax that will get through the PBP3 compiler?

    Thank you!

  2. #2

    Default Re: Internal pullups on 18F45K22

    Hi
    You can add these lines to your code to enable pull-ups

    Code:
    TRISB = %11111111 ' Portb set to input
    
    WPUB = %11111111 'all pull ups on portb enabled
    
    INTCON2.7 = 0 ' 0 = enabled, 1 = off

  3. #3
    Join Date
    Mar 2014
    Location
    England
    Posts
    16

    Default Re: Internal pullups on 18F45K22 - SOLVED!

    Hi Mark,

    Thank you for this: I had tried every similar variation but failed to make it work!

    Problem solved!

Similar Threads

  1. Unknown Processor(18f45k22)
    By Azreel420 in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 15th August 2014, 13:47
  2. Replies: 8
    Last Post: - 27th June 2013, 04:13
  3. Internal pullups 16C72
    By Michael in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 23rd December 2011, 17:57
  4. 16C65B internal pullups
    By Michael in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 20th January 2009, 16:26
  5. Effects of Current Draw Using Internal VS External PullUps
    By rixtalbert in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 16th September 2006, 09:43

Posting Permissions

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