Usenet.com

www.Usenet.com

Group Index

Comp Thread Archive from Usenet.com

<-- __Chronological__ --> <-- __Thread__ -->

Re: 8051



On 3 Dec 2003 21:00:11 GMT, the renowned Richard
<[EMAIL PROTECTED]> wrote:

>[EMAIL PROTECTED] (Brian Farmer) wrote in 
>news:[EMAIL PROTECTED]:
>
>> I am using Atmel's 20-pin 8051. My question is how do I assign Port 1
>> as an output, becuause once I program the chip I have to reset it once
>> to get it to not have P1 floating. After the reset it works fine. I
>> don't assign the P1 direction one way or the other for now.
>> 
>> On the Motorola 68HC11 I would use the data direction register, but
>> with the 8051 what do I do?
>> 
>
>8051s in general do not have any way of programming the port direction per 
>se.  I believe that you need pull down resistors externally in order to use 
>them as output pins, I am sure others here will be able to be more helpful.

Many 8051s have "pseudo-bidirectional" port pins. You write ones to
the pins you want to use as inputs- the port pin circuit looks like an
input connected to an n-channel output transistor drain with a
p-channel weak pullup* to Vdd. You pull them down externally toward
Vss to get a 0. Some pins may lack the weak pullup (just the n-channel
transistor and input), so you have to drive them high and low or add
an external pullup resistor.  

* The standard 8051 port design parallels a strong pullup with the
weak pullup. The strong pullup is switched on briefly when the pin is
driven high to quickly charge external capacitance. 

Ugly, indeed, but that's the way many of them work. Take special care
of what happens on outputs that control real-world stuff while reset
is asserted. 

Best regards, 
Spehro Pefhany
-- 
"it's the network..."                          "The Journey is the reward"
[EMAIL PROTECTED]             Info for manufacturers: http://www.trexon.com
Embedded software/hardware/analog  Info for designers:  http://www.speff.com



<-- __Chronological__ --> <-- __Thread__ -->


Usenet.com



Please check out one of the premium Usenet Newsgroup Service Providers below for access to Usenet.