8051

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?

Reply to
Brian Farmer
Loading thread data ...

snipped-for-privacy@nasa.gov (Brian Farmer) wrote in news: snipped-for-privacy@posting.google.com:

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.
--
Richard
Reply to
Richard

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"
speff@interlog.com             Info for manufacturers: http://www.trexon.com
 Click to see the full signature
Reply to
Spehro Pefhany

Richard wrote in news:Xns94468E72DD7C7richardrapiernetscap@130.133.1.4:

No. Nothing on the output for Port 1.

--
- Mark ->
--
Reply to
Mark A. Odell

snipped-for-privacy@nasa.gov (Brian Farmer) wrote in news: snipped-for-privacy@posting.google.com:

Write a 1 to the port SFR before reading it as input. For ouput, just write your value - done. The pseudo-bi-directional nature of the ports is both nice and a real pain. See Intel's scanned PDF copy of the MCS-51 User's Manual available on their website for a nice picture of the port structure. Note that P0 and P2 will require pullups but you don't have them on the 2051.

--
- Mark ->
--
Reply to
Mark A. Odell

plus, the two comparitor pins on the 2051 are open drain, so they will need pullups if used as outputs.

These are good, PDFs covering all the common-demoninator stuff, like ports and timers:

formatting link

formatting link

Reply to
Jim Granville

The Philips P89LPC922 Flash 80c51 core 20 pin Dip package micro can program the Ports as Inputs/output (push-pull) and Quasi-bidirectional. In push pull mode the max current is 20mA per pin (total 80mA).

The setup for the Port direction (config) is in one of the NEW (spare)

80c51 function registers.

formatting link

Regards JG

Reply to
Joseph Goldburg

This statement about push/pull being programabel is true for the whole range of the Philips LPC900 family. Philips has lauched approx. 15 new devices in that family within the last 12 months. What is missing are high memory devices (8k flash is max) and ADC at this time. I was told that ADC devices will be launched in Q1.

Cheers, Schwob

Reply to
Schwob

The first (prelim) data for the ADC's 933/934/935 is on Philips Web, & also info on the 14 pin devices. 14 Pins makes more sense than 8 pins, which quickly gets pin-bound, and 20 pins is too large physically. I see Microchip (&Fairchild) are also realising this, and releasing more 14 pin versions. ( one die that gives 8/14 pins, very like the 28/40 pin variants are done )

-jg

Reply to
Jim Granville

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.