??? 04/17/07 04:46 Read: times Msg Score: +1 +1 Good Answer/Helpful |
#137352 - It shows that you "experiment" instead of reading Responding to: ???'s previous message |
Mike Stegmaier said:
on many 8051 microprocessors (and even microcontrollers), Port 0 is normally float. Mike, it's time to get some facts straight. There are no 805x microprocessors. Since day 1, the 805x has been labelled a single-chip microcomputer, which, over time, has become popularly known as a microcontroller. In order to (1) support a means for using microprocessor-style system design as was popular in the late '70's, Intel provided a relatively simple way of expanding the system beyond what was on-chip, expanding on what they'd done with the 8051's precursor, the 8048. Keep in mind, if it has ports and on-chip memory, RAM or ROM or both (not counting registers or cache, though the 805x' registers are just on-board RAM), it's not just a microprocessor, it's a single-chip microcomputer. It is fine to use them as general purpose data pins, but they really should be tied to a pull-up (or a pull down) resistor as well. 100K for a cmos chip will work well.
The reason for the pullups is to ensure that voltage levels will go high enough, as the original 805x didn't have to drive the pins to CMOS levels (~3.6 volts), but, rather, needed only to drive TTL levels (~2.4 volts). If you fail to do this, then there is a good chance that port 0 will float when the program is not running and chances are that there may be a problem using your LCD. This doesn't make sense. Perhaps you should rephrase it. There's no need to be concerned with the P0 levels if there's no program running, since the power must be off at that time, or the MCU is being held in reset. If he wants to memory map his LCD, i.e. if he wants to read and write it as though it were memory, he can't do that except on P0. Now he didn't say he's doing that, but he probably could on a <12 MHz 12-clocker. Why not try ports 1 and 3 instead? You must not yet have thoroughly read the datasheet for any 805x of any sort. The P0 is not NORMALLY "floated" when an active BUS write cycle is in progress, i.e. when nWR is active. The datasheet shows when, before the rising edge of nWR, and for how long after the rising edge of nWR, data is held valid. If you try to sample data when there is no valid data, you will get what you deserve. Likewise, if you try to sample addresses when there are no valid addresses, as indicated on the datasheet, you will, again, get what you deserve. The P0 is never floating when a data bus write is supposed to occur. Here's what "the bible" says, "Port 0 differs in that its internal pullups are not active during normal port operation. The pullup FET in the P0 output driver (see Figure 4)is used only when the port is emitting 1s during external memory accesses. Otherwise the pullup FET is off. Consequently P0 lines that are being used as output port lines are open drain. Writing a 1 to the bit latch leaves both output FETs off, so the pin floats. In that condition it can be used as a high-impedance input." Normal port operation differs from normal BUS operation. If you use P0 as a port, you absolutely must provide pullups. Pullups are also advisable when driving a memory BUS-interfaced CMOS device such as an LCD, since there's some doubt as to which 805x variant one might use. Some of them can drive CMOS, while others may not. I certainly wouldn't expect an HMOS MCU to drive 5-volt CMOS devices without the aid of pullups. RE |