??? 05/03/08 20:27 Read: times |
#154354 - P0 is multiplexed for input/output; P2 is not Responding to: ???'s previous message |
Avinash R K said:
But P0 is also use for accessing external address.. right..? Then P2 is also used for accessing an external address... There is nothing like "accessing and external address". The port pins have to act as outputs, to output address and data; and as inputs, to input data. Avinash R K said:
For accessing external memory locations only very small current is required, so Port 0 does not have internal pull up resistors... right?... No. To [b]output[/b] address and data during an external memory cycle (i.e. when reading code from external code memory, or when performing MOVC or MOVX to/from external memories), relatively high current is required, as the external buses' and the attached memories' input buffers' parasitic capacitances have to be charged or discharged as quickly as possible (that determines the maximum attainable speed, i.e. maximum clock). The internal circuitry of Port0 and Port2 are designed so, that when they emit the address, and when in a write cycle Port0 emits data, they switch on additional transistors and behave as a push-pull (totem-pole) output, both sourcing and sinking a relatively large current. To [b]input[/b] data, the smallest possible load shall be exerted upon the memory's output (minimum current shall be drawn from it), that's why at those moments P0 behaves as a pure input, no pullup, no pulldown. Avinash R K said:
I have a doubt that even P2 is also used for External mem accessing.... But why P2 has got internal pullup resistors...????? As mentioned, in the moments when P2 emits the high part of address, it behaves as a push/pull output. And, after that, it is NOT used as input, so it can "return" to its "normal" function, which is a general purpose I/O port. And, for that, the quasibidirectional arrangement, such as P1 and P3 have, is the simplest "multipurpose" option (see above for the historical background). And, in fact, the "pullup" is NOT a resistor, it's a combination of two transistors and a feedback, with a quite peculiar I/V characteristics. Avinash R K said:
If we are using P0 for data transfer we have to use a external pull up resistors.... to drive the current through Port 0 to the device...... correct???? This depends on your definition of "data transfer". If you want to use it as a general purpose output, then, yes, you need to use external pull up resistor. Just your description is not quite correct - you would need the pullup not "to drive current through P0", but to source current to the external device while the output sinking transistor in P0 is closed (i.e. "1" written to that port pin's output register). All this said is valid, if the attached device needs some input current to be sourced externally, which is not always the case. For example, if you would attach to a P0 pin a PNP transistor's base (via a resistor of course), and that transistor's emitter connected to VCC, and a load (against ground) e.g. a relay's coil in the transistor's collector; there is no need for a pullup resistor, as the transistor is closed simply if there is no sink current i.e. if the P0's pin is in the high-impedance state. JW |
Topic | Author | Date |
P0 pull up resistors | 01/01/70 00:00 | |
ports structure | 01/01/70 00:00 | |
More Port 0 history | 01/01/70 00:00 | |
Of course, there is a reason for it... | 01/01/70 00:00 | |
Port 0 Pullups WHY??? | 01/01/70 00:00 | |
P0 is multiplexed for input/output; P2 is not | 01/01/70 00:00 | |
This would all be perfectly obvious if only you\'d | 01/01/70 00:00 | |
See this thread | 01/01/70 00:00 | |
Scary Bible | 01/01/70 00:00 | |
Only In Some Cases.... | 01/01/70 00:00 | |
Directly connecting the base will hardly work! | 01/01/70 00:00 | |
Hardly is correct.... | 01/01/70 00:00 | |
what about a darlington? | 01/01/70 00:00 | |
Will also turn off the weak pull-up... | 01/01/70 00:00 | |
The high state is adequate for some things | 01/01/70 00:00 | |
OH![]() | 01/01/70 00:00 |