| View previous topic :: View next topic |
| Author |
Message |
rxraine
Joined: 31 Dec 2023 Posts: 1
|
Posted: Sun Dec 31, 2023 11:49 am Post subject: 8031... can P0 and/or P2 actually be used as ports? |
|
|
Hi,
I'm having some holiday fun teaching myself MCU history with an 8031. It brings me to a question that Google can't answer for me though, and perhaps someone here would be kind enough to help me.
As the 8031 has no ROM, it appears it must always use P0 and P2 for data and address buses. I've seen it written that this is true for P2, but not explicitly for P0. So...
- can !ALE control a latch on P0 (or P2) to use it for output?
- if 256 bytes is enough ROM, can P2 be used as a normal port? |
|
| Back to top |
|
 |
yy2013
Joined: 12 Sep 2009 Posts: 739 Location: Nagoya, Japan
|
Posted: Thu Jan 04, 2024 11:50 pm Post subject: |
|
|
Thank you for an interesting question.
Please see Figure 16 on page 25 of MCS-51 Users' Manual:
http://web.mit.edu/6.115/www/document/8051.pdf
Here, the timing of external ROM/RAM access is displayed.
During instruction fetch, P2 outputs the higher byte of the program counter throughout the cycle. So, it cannot be used as an I/O port.
However, during external data memory access (that is, when !PSEN is high), the content of P2 is either "DPH out" or "P2 out". So, it should be possible to use it as an I/O port.
Also, Figure 5 (page 14) displays the case where part of P2 is used as an address bus for external RAM, while the remaining part is used as I/O ports. |
|
| Back to top |
|
 |
Guest
|
Posted: Mon Jan 08, 2024 8:47 am Post subject: |
|
|
| Thank you for your answer, and the link to the very useful user manual. |
|
| Back to top |
|
 |
|
|
|
|
|
You can post new topics in this forum You can reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You cannot download files in this forum
|
|
Powered by phpBB © 2001 phpBB Group
|