This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

P2 does not change

I am trying to interface a P89C662 with an LCD. I am using the example in Mazidi's book.
The RS, R/W, E pins of the LCD are attached to P2.0, P2.1, P2.2 respectively.
When I try to use the Keil Monitor-51 driver to do on chip debugging, P2 never changes so I cannot even initialize the LCD.
The P89C662 has 32K flash so I am not using any external memory. So I should be able to use P2 and P0 as I/O ports. But for some reason I can't!!!

Parents Reply Children
  • I am using Keil's MCBx51 evaluation board which comes with Mon51 on EEprom. So I guess I do have external memory then.
    So am I hosed, I cannot run Mon51 and use an LCD at the same time?

  • So am I hosed, I cannot run Mon51 and use an LCD at the same time?

    No. You missed the point. If you use external memory, P2 and P0 provide the address and data bus. If P2 is used for the address bus it can't very well be used for another purpose at the same time.

    Bus, you COULD use P1 and some pins of P3. You may want to refer to a datasheet to find out how the pins of those ports are used. Here's a hint (P3 provides the /RW and /WR lines to the external RAM).

    Jon

  • I tried using bits 0,1,3,4 in P3 on the Philips P89C662. These were the only one I could change. The other bits would not change.
    I encountered some funny behavior. Some bits in P1 would change upon clearing or setting some bits in P3.