View Single Post
  #7   Report Post  
Posted to comp.home.automation,sci.electronics.repair
Bob F Bob F is offline
external usenet poster
 
Posts: 8,803
Default 8051 memory access hardware question


"Franc Zabkar" wrote in message
...
On Mon, 10 Nov 2008 21:15:43 -0800, "Bob F" put
finger to keyboard and composed:

I have a homebuilt home control system based on an 80c51FA processor. I
recently
had a memory failure on it. It currently uses 32K x 8 bit mmemories, sharing
the
space for code and variables. I would like to replace the 2 memories with one
128k x 8 bit memory.

It has been a long time since I did much hardware design. I am trying to
figure
out how I can connect one 128k byte memory to map to 64 KB of program and 64
KB
of data memory, which would mean I need to select half the chip depending on
whether I am reading program code or data. Looking at the hardware manual, I
don't see an easy way to do this, as it seems that the RD\ or PSEN\ are
normally
used to access data or program memory, and I need a high address bit to
differentiate them.

The chip only handles a 64 KB address space. I would jumper the program memory
to be data memory while I loaded the program, then switch the jumper back.

Can anyone offer me any suggestions of how to do this? I would really like to
increase the available space in both memories. I have one 32 pin memory socket
and one 28 pin socket available with a fair amount of flexibility of signals
to
the high address and chip select bits.


I suspect that you need only look at the problem from the perspective
of the RAMs, not the CPU.

I don't remember much about the 8051, but I would think that your two
RAMs would have OE*, CS*, and WE* pins.

If the WE* pins are wired together, then wire them to your 128KB RAM.

The other two pins could be wired as follows:

|----
OE1* ----| \ |\
| |o---| |o--- OE*
OE2* ----| / |/
|---/

|----
CS1* ----| \ |\
| |o---| |o--- CS*
CS2* ----| / |/
----/

Address lines A0 and A15 of your 128KB RAM would be wired to your CPU,
and A16 could be wired to either CS1* or CS2*.

The inverters could be constructed from the remaining two NAND gates
in a quad package.


As I look at this from the memory point of view, I begin to think it will indeed
work. I was worried that the address setup time requirement would prevent it,
but that may not be the case.

If anyone has actually done this, I'd love to hear about your success.