Pull up/down resistors

thunderace7

New Member
I have a 40x2 that I use for several functions, each being selected by coding 3 of the input pins of the plug-in measurement heads. Because the pull up/down resistors are housed within the plug I want to minimise them as much as I can. Although not best practice, I can't see why a single 10k resistor from +5v to 2 or 3 pins wouldn't work. Similarly, the same set up from 0v. Better still would be to leave out the pull up resistor altogether and rely on the internal resistor that I believe exists. Does all this sound ok?
 

AllyCat

Senior Member
Hi,
I can't see why a single 10k resistor from +5v to 2 or 3 pins wouldn't work.
So you would be commoning several pins together? A disadvantage of doing this is that the chip may be damaged if the program "accidentally" drives one to a High output and another Low. Unlikely, but why take the risk?

If you're trying to avoid any unused inputs "floating" (which is rarely a problem in practice), you could make them outputs, either High or Low. Or with M2s all the pins have internal "Weak Pullups", but sadly they are only available on Port B (Legs 21 - 28) of the 40X2.

Cheers, Alan.
 

hippy

Technical Support
Staff member
I would simply have the plug short its pins to 0V, with internal or external pull-ups on the pins, and take the risk of not ever making those outputs. That way there's no components in the plug.

If you wanted to do it more safely you could put the resistors on the PICAXE side of the connector ...
Code:
             +V ----.-.-.
                   .|.|.|. 
                   | | | |    All resistors ~ 10K
 PICAXE            |_|_|_|
.------.     ___    | | |
|      |<---|___|---^-|-|---( o---.
|      |<---|___|-----^-|---( o---{
|      |<---|___|-------^---( o   |
`------'                          |
             0V ------------( o---'
Added : You could probably do it with a single ADC pin and fewer resistors. No idea what values would be best ...
Code:
      +V ---.
           .|. 
           | |
 PICAXE    |_|
.------.    |        ___
|  ADC |<---^---.---|___|---( o---.
|      |        }---|___|---( o---{
|      |        `---|___|---( o   |
`------'                          |
             0V ------------( o---'
[/b]
 
Last edited:

thunderace7

New Member
I don't think my explanation was very good. The resistors are to code 3 input pins that identify the test head that is being used. The programme reads this code and diverts to the appropriate part of the programme. Each test head has a different code which is why the resistors need to go in the plug. I could put them in the actual test head but I would need connecting cable with 3 additional wires.
It looks like I will have to get 3 resistors into the plug somehow.
Thanks for all of the replies.
 

hippy

Technical Support
Staff member
It looks like I will have to get 3 resistors into the plug somehow.
But those 'resistors' can be zero-ohm. I really don't see why this would not work ...
Code:
             +V ----.-.-.
                   .|.|.|.     Plug
                   | | | |     _____
 PICAXE            |_|_|_|    |     \
.------.            | | |     |      \           Head
|  SIG |<-----------|-|-|---( o-----. \       __________
|      |     ___    | | |     |     |  \     |          |
|    C |<---|___|---^-|-|---( o--.  `---|----|--< SIG   |
|    B |<---|___|-----^-|---( o--{      |    |          |
|    A |<---|___|-------^---( o  |  .---|----|--- 0V    |
`------'                      |  |  |  /     |__________|
             0V ------------( o--^--' /
                              |      /
                              |_____/
For that particular head unit the PICAXE will read A=1, B=0, C= 0 and can determine which of eight head units is plugged in.
 
Top