
www.Usenet.com
| <-- __Chronological__ --> | <-- __Thread__ --> |
"Mark A. Odell" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > [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. > > 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. 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: http://www.atmel.com/dyn/resources/prod_documents/DOC0497.PDF http://www.atmel.com/dyn/resources/prod_documents/DOC0499.PDF
| <-- __Chronological__ --> | <-- __Thread__ --> |