Weak Pullups?

eclectic

Moderator
I can't get me weak pullups to work. Oooh Errr Missus!

But seriously,
I've seen several recent references to “weak pullups” (WPU)

For example, Post no. 13 of
http://www.picaxeforum.co.uk/showthread.php?t=3974&highlight=frost+alarm&page=2

AXE091 board./ Ultra LED/ 08M

Using the above link, I tried this program :
Code:
looper:
poke $81, %01111111 'Enable GPPU General pull up enable

poke $95, %00011110 'E.g. Pull up all pins 1,2,3,&4
wait 1

poke $95, %00010000 'E.g. Pull up pin 4 only
wait 1

poke $95, %00001010 'E.g. Pull up pin 3 and 1 only 
wait 1

poke $95, %00000000 'E.g. Pull up no pins
wait 1

goto looper
I connected an LED to pin 2. On ALL the time.

Then, I tried this :
Code:
poke $81, %00011110 'Enable GPPU General pull up enable

main:
poke $95, %00000000
wait 1

poke $95, %00000100
wait 2

goto main
Again, the LED on pin2 was always ON.


And, while both of the above programs were running,
the F8 terminal screen showed gobbledegook.

OK, I've probably made a giant mistake somewhere,
(so what's new?)
but,
has anyone pulled 'em up?

:))
 

eclectic

Moderator
Getting slightly less worse?

Code:
poke $81, %00011110 'Enable GPPU General pull up enable

main:
poke $95, %00000100
wait 1

poke $95, %00000000
wait 2

goto main
e
 

manuka

Senior Member
I'm aware of Andrew's 2006 posting, but (being of the "hardware pullup/pulldown" persuasion) recommend just a "weak but firm" 10k resistor for the job. Aside from being easier to wrestle with, this usually saves code space over the POKE/WAIT approach. I confess to in fact not having even tried this tweak of Andrew's, although many of his other PIC insights (underclocking etc) have been valuable.

In a 08M of course the $95 poke could cover a region being used by the loaded program (or even Rev.Ed's boot strap)- this may explain the bizarre F8. Stan
 
Last edited:

eclectic

Moderator
I'm aware of Andrew's 2006 posting, but (being of the "hardware pullup/pulldown" persuasion) recommend a "weak but firm" 10k resistor for the job.
Exactly what RevEd use.

My query was of the

"Has ANYONE got this to work, reliably?"

type.

e
 

Dippy

Moderator
Maybe an idea to read the PIC Data Sheet.
Esp wrt to reg 95h.
I've had this working OK with 'raw' PIC never tried it on PICAXE but should work OK.
 

eclectic

Moderator
I'm aware of Andrew's 2006 posting, but (being of the "hardware pullup/pulldown" persuasion) recommend just a "weak but firm" 10k resistor for the job. Aside from being easier to wrestle with, this usually saves code space over the POKE/WAIT approach. I confess to in fact not having even tried this tweak of Andrew's, although many of his other PIC insights (underclocking etc) have been valuable.

In a 08M of course the $95 poke could cover a region being used by the loaded program (or even Rev.Ed's boot strap)- this may explain the bizarre F8. Stan
I have NO need of the WPU, but others might.

But, if the concept worked, reliably, then many Picaxers
might benefit.

e
 

hippy

Ex-Staff (retired)
$95 is the WPU settings per I/O bit. This worked for me, Pins 1, 2 and 4 as inputs, a LED+R to 0V flashes at 1Hz on each ...

#Picaxe 08M
Poke $81, $7F
Do
Poke $95, $FF : Pause 500
Poke $95, $00 : Pause 500
Loop

But ... as Andrew noted on the link above, that also pulls Serial In pin high so if the download cable is unplugged it jams in downloading mode ( all pins pulled high, LED's permanently on ) until the cable is plugged in again and the non-existent download times-out.
 
Last edited:

westaust55

Moderator
Weak Pullups

I note that in the linked thread to Andrews past work, he mentiones that the WPU’s are approx 33kOhm but in the 08M datasheet could find no value stated.

The datasheet does state that the GPIO Weak Pull-up Current (IPUR) is typically 250 uA (min 50, max 400uA) so it is not as if the WPU’s can supply a lot of current to control an LED, even if just trying to “block”.

I am about to try and use the WPU's in the MCP23017 IO expander on inputs for some tests relating to signals into a port for PICAXE interrupts. This could prove to be interesting.
The MCP23017 datasheet indicates the WPU's there as 100 kOhm.
 
Last edited:
Top