home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!zephyr.ens.tek.com!tekig7!tekig1!brianr
- From: brianr@tekig1.PEN.TEK.COM (Brian E Rhodefer)
- Newsgroups: sci.electronics
- Subject: Re: 8051 help needed urgently!
- Message-ID: <6363@tekig7.PEN.TEK.COM>
- Date: 30 Jul 92 22:12:47 GMT
- Sender: news@tekig7.PEN.TEK.COM
- Reply-To: brianr@tekig1.pen.tek.com
- Followup-To: poster
- Distribution: na
- Organization: Tektronix, Inc., Beaverton, OR.
- Lines: 22
-
- In article <1992Jul30.165112.10990@ole.cdac.com> ssave@ole.cdac.com (Shailendra Save) writes:
-
- (describing his inaccurate mental model of an 8051 microcontroller)
- >
- > When you clear a port pin, it is pulled to a tristate 1. It does not
- >put a 0 onto the pin. I would think you want to write a "0" onto the
- >port to turn the led off.
- >
-
- Rubbish. Clearing (i.e., using the CLR <bitnumber> instruction)
- port pins of an 8051 family processor emphatically *does* set them
- to 0; to the best of their current-sinking ability, anyway.
- Nothing tristate about it.
-
- There are complications if the Port pin is one of the Port 0 or Port 2
- pins that's implementing an external memory bus. Any external memory
- or code access will rewrite the Port 0 data output latch to all 1s,
- and temporarily replace the state on Port 2 pins with the upper 8 bits
- of external address (for code fetches, or data-pointer indirect reads only;
- R0 or R1 indirection leave P2 alone).
-
- Brian Rhodefer
-