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!
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
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!