Weak internal pull up

BeanieBots

Moderator
None of the PICAXE have weak pull-ups enabled.
However, if the PIC supports weak pull-up, then you can poke the required register to set the pull-ups.
Don't know specifically about the 12F683, you'll have to check the datasheet.
 

MPep

Senior Member
Use the POKE command but you need to work out the address the POKE. The address being the PIC register you need to look into. NOTE not PICAXE!!
Hippy has done this stuff before and a forum search should turn the relevant info.
 

westaust55

Moderator
Weak Pull-up control for 08M

Have a look at my variable map covering most current PICAXE's. Post 14 in this thread:
http://www.picaxeforum.co.uk/showthread.php?t=9525&page=2

You need to poke the SFR's (See bottom left of the sheet).

Two registers involved:

1. The Options register at POKE location 129.
Bit 7 must be a zero to enable WPU's in general

2. The Weak Pull-Up register at POKE location 149
Setting the desired bit correspnding to an IO to a "1" turns on the WPU.

You should also have a read of the datasheet for the PIC12F683.
You may need to PEEK the Option Register to get the current value then use that value to just turn on bit 7 and POKE the value back.
 
Last edited:

Dippy

Moderator
Weak pull-ups are very handy, but I wouldn't use them on low-power battery circuits.
Fine in most cases, so this is just a have-a-think-about-it general comment.

So, for very low power stuff have a care with your code or stick to external high-ohm resistors.
 

Dippy

Moderator
Oh, I wasn't saying don't do it, but check out the PIC Data sheet to see power consumption for weak pullups.

In a recent thing I did with a 16F886 I had to revert to external 1M5 pullups to get my power down. They may be called weak, but a current consumption of 250uA (ish) is quite steep for a low power circuit that could easily work at a tenth of that (average).
 

Protolisk

Member
Oh ok. I wasn't not going to do it. If that makes sense. I just still didn't really get what these guys meant so I was going to figure it out. Just didn't want to say that I have no idea give me a day or 2 to figure it out.
 

Dippy

Moderator
Here are the pages from the Data Sheet.
Have a look and you'll understand Westaust's notes.
Note: Westy talks in decimal, the Data Sheet in hex.

So, by Poking you tell the PIC;
1) I want you to use Weak Pullups (Option s Reg)
2) These are the pins i want you to pullup 'weakly'.

Note2: On I/O pins if you change the I/O direction you will have to reinstate WPUs if you need them again.
 

Attachments

Top