can i keep a pin high without current?

kardzzz

New Member
Hi guys,
I've have fun building my first few circuits with Picaxe 8M chips.

I understand the idea of feeding a +ve current to a pin and to use a switch to turn the current off to activate a routine. My question is, can I keep a pin in the 'high' position without feeding a current and feed a negative signal to the same pin via switch to turn the signal off?

What is the command to keep a pin high? I will probably build a circuit to test.

thx
 

jglenn

Senior Member
I'd say you probably always need a pullup resistor of some value, if there is nothing else determining the state of an input pin. You should not leave them open, tie to ground or something. 10K may be good. Maybe 100K. I've build fet inputs with a gate pullup of 1M, no problem. But that is a fet. So you must accept a tiny current, unless you ground it.
 

BeanieBots

Moderator
Maybe you should expand on what your concerns are.
What is the command to keep a pin high
Believe it or not, it's "High" followed by the pin number.

I am a little confused over if you are concerned about the current drawn by input which is held high or by an output which is driven high.

Unless you have some extremely specialised instruments, you won't be able to measure the input current because it is so small. The output current will only depend on what is connected to it. If there is nothing, it makes no difference if it is high or low.
 

kardzzz

New Member
thanks for your replies. I will use a resistor and feed.
*I just wanted to cut corners with wiring by excluding the high signal

thx
 

Dippy

Moderator
I was just starting to understand the question... when my comprehension disappeared in a cloud of silicon.

"I understand the idea of feeding a +ve current to a pin and to use a switch to turn the current off to activate a routine."
- just as jglenn alludes to.
Hold(force) the (input) pin high by connecting a resistor (10K, 50K, 100K whatever) to the positive supply. Then connect your switch from the same pin down to 0V.
So, if it were a push-button:-
1) Button released, input pin High.
2) Button pressed, input pin Ground.
This can then be 'sensed' in YOUR programme code as a 'button press'.


"My question is, can I keep a pin in the 'high' position without feeding a current and feed a negative signal to the same pin via switch to turn the signal off?"
- nearly the same question innit.
If you connect a resistor as described above to an input pin there will be very little current flowing. It would get the anoraks rustling to claim "without feeding a current", but the current would be mugger-all.
Please don't start using 'signal' as a phrase as it WILL confuse between voltages and currents.
When saying "feed a negative signal..." do you mean just connecting that same pin to Ground (usually the -ve battery terminal)?
If so then yes, like a push-button switch?


BUT WAIT, this is where the clouds of confusion come over and rain on my fireworks.
Are you now suggesting setting the pin HIGH in code and then use a push-button to ground it, in the vain hope of sensing it?
Don't. That could end up in an early bath and require your parents to shell out on a new PICAXE.

"I will probably build a circuit to test"
Well, er..um...yes.. ultimately there is no better way, BUT FIRST I would SUGGEST drawing your proposed circuit and posting it here. You sound like a novice and so may be getting it confused (I know I am).
And then just (in English) make a list of what you want your code to do.
Forget accurate sysntax for now (unless your BASIC is ok).
 

BeanieBots

Moderator
*I just wanted to cut corners with wiring by excluding the high signal
Oh you heathen:p
NEVER cut corners and expect reliable operation.
A very large percentage of the problems we see on this forum are a result of people trying to cut corners. Either from shear lazyness or trying to save a few pence. It ALWAYS ends in tears and always takes more effort, more time and more money to put it right later.

You've not actually described what you are trying to do.
A resistor might not be needed anyway. Depends what you're connecting.
 

Dippy

Moderator
"I just wanted to cut corners with wiring by excluding the high signal"

- eh?
Ah well, good luck, I'm sure you'll get a result.
 

westaust55

Moderator
Must be under the same cloud of silicon as Dippy.

Is the original question about an input or an output pin on the PICAXE?
 
Top