Port direction of 4051

Do you have a question? Post it now! No Registration Necessary

Translate This Thread From English to

Threaded View
Hi,

In the following code sequence:

mov    P1,#00     ;set port direction out
mov    P1,#0Ah    ;output #00001010h to port 1

How does the uC know whether it should output the byte #0A to port 1 OR it
should be setting P1.1 & P1.3 to input?  I could understand how the 6821 PIA
works since it has a Port Direction Register.


Allen




------
The next war will determine NOT who is right  BUT what is left.




Re: Port direction of 4051

Quoted text here. Click to load it
PIA

The I/O ports in the 8051 architecture behave pretty much like open-drain
ports: output '1' and input states are the same inside the port. The
difference to pure open-drain is thet the ports output short pull-up current
pulses when writing an one to charge the load capacitances more quickly than
plain open-drain.

The port structure also demands that the output load does not sink current
from the port, but an input must be able to sink some current.

You do not need to output the zeroes before writing the output pattern.

HTH

Tauno Voipio
tauno voipio @ iki fi



Re: Rotten architecture, was: Port direction of 4051

Quoted text here. Click to load it

My rotten architecture vote to the mini-paged architecture of PICs and 8048
(like the old PDP-8).

Tauno Voipio
tauno voipio @ iki fi



Re: Port direction of 4051

Quoted text here. Click to load it
it

Thanks, gentlemen.  Now I have a clearer picture on how to interface to this
"crude & rotten" architecture.

Allen.




Re: Port direction of 4051

Quoted text here. Click to load it

Yeah.  As someone so aptly put it, the 8051 family is very much like
cockroaches: hardly anybody _wants_ to have them around, they're
blatantly ugly; but they're numerous, they're everywhere, and odds are
they'll survive all of us.
--
Hans-Bernhard Broeker ( snipped-for-privacy@physik.rwth-aachen.de)
Even if all the snow were burnt, ashes would remain.

Re: Port direction of 4051

Quoted text here. Click to load it


I use it sometimes too, despite the fact that it's crap and guzzles
current, for precisely the reasons you mention.

Quoted text here. Click to load it

Current teacher's pet is MSP430 series, with gcc. At 2.5V, with a 32kHz
crystal, it doesn't consume power, it produces it. I wish they'd do a 5V
tolerant IO version with an external bus though.

The XAG49 is nice to use, though support is expensive now Raisonance
seem to have given up the cheap deal they used to do. It's like an 8051
with better IO and 16 bit core. Why didn't they make it pin compatible
with 8051s though?


Paul Burke


Site Timeline