??? 01/27/06 06:43 Read: times |
#108462 - yes and no Responding to: ???'s previous message |
hi,
Kai Klaas said:
By the way, the "Bible" itself supports the idea of "input mode" and "output mode", when they write:
"Each I/O line can be independently used as an input or an output. ... To be used as an input, the port bit latch must contain a 1, which turns off the output driver FET." Phrase "To be used as input" does not mean "set to input mode". Even you write a '1' to latch nevertheless I/O line is still used as output one as well. Erik pointer right (but emotionaly, yes) that classic 8051 has no port "modes" and some novice people are confused due this term. Just look at original post: Mohit Gupta said:
I have to initialise the port P1 of the 89C51 as output port with all port lines initialised to a high state i.e. 1.
Now for initialising the port P1 as output, I have to give the instruction P1 = 0x00 To make all the lines of this port as High, can I give the instruction: P1 = 0xff; Will it not make the port P1 as input port? And so what? Using terms "input and output modes" we should answer: "yes, writing '1's to the port P1 makes it as input port". Then he asks: "whatta hell, I need to have it as output with '1's!!!". And only after this we start to explain that "in fact, 8051 has no separate input or output port modes, etc...". So Erik just pointed on this fact. And he might not say better: Erik Malund said:
mov a,Px will read the voltage on a port pin which, if the port latch is set high can be pulled low by external forces due to the port being quasi-bidirectional. If the pin is set low, the "strength" of the force (see the architecture) holding it low is so that, if an external force try to pull it high, destruction will result
Kai Klaas said:
So, what's so wrong to distinguish between "input mode" and "output mode"? If this is misleading, then the phrase "quasi-bidirectional" also is. It all depends on what you actually mean by these phrases.
I agree; nevertheless Erik doesn`t only name port "quasi-bidirectional" - he also explained what it means. Kai Klaas said:
By the way, you should think about your relationship to the other forum members. I would never ask you to stop "babbling"!
Well, I think this is just emotions due this question appears often and often. Regards, Oleg |