??? 06/08/04 14:37 Read: times Msg Score: +1 +1 Good Answer/Helpful |
#72076 - RE: Using P0 for LCD along with 64K Ext. RAM Responding to: ???'s previous message |
hi,
If I use 1 pin of A8 - A15 for LCD then I will end up using less ram, As I have mentioned I need 64K RAM. No! For example, we use P2.0 (A8) and P2.1 (A9) for RS and R/W of LCD. Note that these pins are still used as address lines for RAM! When you access RAM via MOVX then they are used as A8/A9 with hardware. When you access LCD then you should set them up manually in your program (setb/clr P2.0 and P2.1) before make Strobe. So it may be called "shared" usage of the same pins for RAM/LCD. See: when you access RAM then Strobe is inactive and so the states of these pins do not affect LCD, when you access LCD then RAMs /CS are not active and so the states of these pins have not effect on RAMs. As about additional latch: connect one more D-latch on port 0. Load signal of this latch should be driven with a pin of MCU. So, before access RAM you need to put high byte address on port 0 then make load signal to the latch (set/clr it). As result, byte of port 0 will be loaded into the latch as A8...A15 and provided to RAMs. Then you just do MOVX with @R0/@R1. This command latches low byte of address via ALE and so complete A15...A0 will be produced. Regards, Oleg |