home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / sci / electron / 13658 < prev    next >
Encoding:
Internet Message Format  |  1992-07-30  |  1.3 KB

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