What is a tri state output?

BrendanP

Senior Member
Im continuing on with this gsm module. The manual speaks of a tri state output. What does this mean? I understand a output can be high or low but what is the third state?

 
 

hippy

Technical Support
Staff member
The third state is neither high nor low. Think of a PICAXE output like this ...<code><pre><font size=2 face='Courier'>+V ----------.------.
| .|.
.-| O | | R
`-| O |_|
| |
`------{
|
}-------O Output
|
.------{
| .|.
.-| O | | R
`-| O |_|
| |
0V ----------^------' </font></pre></code> The PICAXE can either push the top button and make the output High, push the bottom button and make the output Low, or push no buttons at all, the third-state, tri-state, high impedance.

The fourth state is the 'release the magic smoke' situation, so the PICAXE has hardware to limit it to only those three states :)

Edited by - hippy on 11/08/2007 06:20:50
 

BrendanP

Senior Member
Thanks Hippy, Im enormously gratefull for the advice you given me here on the forum
If you ever come to Australia you're welcome at my place.

If I understood your explanation correctly, I would use 2 ouputs and two transistors to create a tri state output?


&#160;

Edited by - BrendanP on 11/08/2007 07:01:31
 

womai

Senior Member
Well, more precisely you need a pin that can be switched between being an input and being an output. On 28X, 28X1, 40X and 40X1 these are the pins on port C; set them with &quot;let dirs = ...&quot;. When they are set to input, they will be in tristate (high impedance) mode. 08/08M can do that, too, on some of their pins. I believe the Picaxe 14 can do it with tricks. You are out of luck on 18/18A/18X.

Wolfgang
 

Dippy

Moderator
Brendan, have a look at the Microchip data sheets on the PICs in question.

You will see that in most cases the diagram shown by hippy is a summary of the actual port block diagram. You will also see the logic block associated with the push-pull config and how it can switch to 'input' mode thus producing the tri.

It's amazing how educational a look at the Data Sheets can be - I mean this seriously not sarcastically.
 

BrendanP

Senior Member
Thanks guys.
I realise what you say re. the data sheets is 100% true Dippy. I get a little over whelmed by it all sometimes, I haven't ever looked at the pic data sheets but I will do so. Ive got litteraly 21 ring binders on my shelf here that have data sheets in them, everything from volt regs to CCD cameras to H bridge drivers. The GSM module has around 500 pages alone.

Im trying to figure out why the thing wont power up properly. Ive read through the manuals many times over the last couple of months, Im going through it all again and clarifying anything/terms I'm not completely sure about ie. tri state outputs.

It could just be a fault with my pcb design. I want to pin down the problem before I spend another 360$ at the pcb makers on more prototype boards.

So sometimes its easier to come here ask a question, it isnt laziness, just simply that there are limits to what I can research and assimilate.

 
 

Dippy

Moderator
Yes, some are very big and daunting :-(

I must admit I certainly wouldn't sit down and try and read it one. I'd be in the loo for weeks!

It's handy to get to grips with the basic hardware config as it can help you with subsequent programming, I'm certain you know that already.

But digging in, a few pages at a time , now and then, really helps. And even if you can't remember it all (who can?) you will still know where to find stuff.

The 'upside'? Once you've learnt the jargon and buzz-words people will think you're really clever. I haven't obviously ....

My tri-state flange orbitter has wirgled my LATB.3 register interositer causing a stack error in my Interrupt Vector Table.

Anyway, glad you're sorted.
 

Rookie

Member
Sorry for ask (again) but how you can achieve the 3rd state?
high=1
low=0
3rd=???
or I must say... how can you switch to 3rd state after any of
the other previously established????
 

Dippy

Moderator
It's much simpler than the 4th Dimension.

3rd = &quot;High Impedance&quot; / Floating / neither high nor low.

On a PIC if you set that port.pin to input mode then it is high impedance.

Doubtless someone will be really PICky so I'll leave them to it.
 

Rookie

Member
(*_*)
So if you put some bicolour led attached to one pin
you can &quot;shut off&quot; both by switching the pin into a
input state?
 

hippy

Technical Support
Staff member
Yes, that's correct.

For a single I/O controlled bi-colour LED, the R's within the PICAXE are very high when not shorted out by the 'buttons' so not enough current flows to light either LED ( and with the voltage at both ends of the LED being around the same - nominally floating at V/2 - there would be no current flow because of that either ).
 

hippy

Technical Support
Staff member
In this context &quot;stacks&quot; are probably, &quot;protocol stacks&quot;, which are are modules of code which take in and process one type of data ( often data packet ) and deliver out another. There will often be a number of these which take the raw input data and deliver something to the end equipment and vice-versa.

If one considers initial input at the top and final output at the bottom ( or the other way up ) you can see these as layers of processing and have probably earned the name &quot;stack&quot; because of the way they stack on top of each other.

I personally dislike the term because it conflicts with traditional &quot;data stack&quot; usage which is a last-in/first-out buffer.
 
Top