I've hooked my Arduino up to a Lantronix MatchPort which has a reset pin. This pin is normally left floating and taken to ground when a reset is required. If I hook the reset to an Arduino pin I could set pinMode to output, take it high, and then take it low when I want to reset. However, this means that it will normally always be high. I don't know if this is a problem or not, but it seems a waste, (of something, I'm just not sure of what!). What I'd like to do however is simply return it to a floating state, i.e. as it is before you set pinMode. Is this possible? Worth it? Am I crazy? :D
Set it back to an input with
pinMode(). The ATmega's inputs are hi-Z (unless you enable pullups).
Thanks! I was just wondering if that was the answer. :) But what's hi-Z?
Sorry, that's a common abbreviation for high impedance. Think of it as very high resistance, like an open circuit (e.g. disconnected).
"But what's hi-Z"
Logical (like in software) digital outputs are defined as always being either a 1 (or 0) or high (or low). In the real world of electronic devices some, but not all, can also have a third condition called "hi-Z". It means that the output assumes a disconnected state (high impedenace) where it has no impact on the circuit it is wired to. However it's not a truely disconnected state in that if you were to hook 120vac to the hi-z pin it would still let the magic smoke out of the chip ;)
Singular post in order to ask DaveAK a question. Sorry guys - but my post count is zero and I have questions about Dave's use of the Matchport.
Is it possible to set one of the PWM-Pins to Z while it is high or low?
I want to drive a P-Fet in PWM-Mode using the Pin as current sink, so the Pin has to be Z in one state, either high or low, and sinking in the other state...
Greetings from Germany,
so the Pin has to be Z in one state
No that is not the way you drive a P channel FET. It needs to be driven high or low at low impedance. What makes you think it needs high impedance?
I´m sorry, i think i should write my question in another way.
What i was trying to ask if it is possible to set the pin to Z when the programm says “high”, and to low when the programm says low. Or vice versa, the pin is set to low when the programm says high, and to Z when the programm says low.
I´m using the circuit at 12V, so the gate has to be pulled up to 12V in order to “close” the transistor completely. Then the pin has to be Z, otherwise will it fix the gate-voltage at 5V.
To “open” the transistor the gate has to be pulled down, so the pin has to be low.
so the gate has to be pulled up to 12V
That's well beyond the spec for an AVR pin. Even if they're in high-z mode they can't have 12V applied, and they shouldn't sink current from a 12V source (even a pullup resistor) when LOW either...
Sorry about my bad english, i´l try it with a Picture:
This is the plan:
The voltage source named Atmega_Pin represents the pin, which is set to Z at the Moment (1Meg Rser), so the gate voltage is 14V.
To switch the Mosfet on i would like to pull the gate down to 0V, by sinking 14mA. (Edit: Rser=~0 or "low")
I hope this is possible, otherwise i need some additional circuitry in order to drive the FET...
Puh, hoped i could drive the Fet without adittional parts, there is not much space left on my PCB...
But thanks a lot for the Answers, also for being so patient!
Could you give me an example, please?
I only know logic-level N-Fets, but i can´t use those because nearly all my loads are installed with negative on ground. Some N-Fets i have to use, too, but most of the loads have to be switched highside.