Electronic – Using 16bit SDRAM with 8bit bus

bussdram

I have a design with an 8bit SDRAM which I want to replace with a 16bit one,the problem is I don't have much pins left to connect all 16bit data bus, is it possible to access the whole memory using an 8bit data bus ?

The ram (IS42S16800E) is organized as 4096 rows x512 columns x16 bits per bank, using 9 bits column, I'm only able to access half the ram, this is acceptable if I have to, however, I tried using 10 bits for column address, and it worked, ran a memory test and I can read/write to every location, but I'm not sure how/why this works, if I understand correctly, it should only use 9 bits for the column address ? so does this depend on the organization of this specific ram ? or is this how all SDRAM work internally ?

Update:

I fixed my ram test (Thanks Dave Tweed) and this time it fails, writing to address base+0 overlaps with base+512 which means the 10th bit is ignored and it wraps around to 0. If I use 9 bits for the column address I can still access half the ram.

Here's my ram test:

uint8_t pattern = 0xAA;
uint8_t antipattern = 0x55;
uint32_t mem_size = (16*1024*1024);
uint8_t * const mem_base = (uint8_t*)0xC0000000;

/* Test data bus */
for (uint8_t i=1; i; i<<=1) {
    *mem_base = i;
    if (*mem_base != i) {
        BREAK();
    }
}

/* Test address bus */
for (uint32_t i=1; i<mem_size; i<<=1) {
    mem_base[i] = pattern;
    if (mem_base[i] != pattern) {
        BREAK();
    }
}

/* Check for aliasing (overlaping addresses) */
mem_base[0] = antipattern;
for (uint32_t i=1; i<mem_size; i<<=1) {
    if (mem_base[i] != pattern) {
        printf("address bus overlap %p\n", &mem_base[i]);
        BREAK();
    }
}

/* Test all ram locations */
for (uint32_t i=0; i<mem_size; i++) {
    mem_base[i] = pattern;
    if (mem_base[i] != pattern) {
        BREAK();
    }
}

Best Answer

If you have a device which puts out 16 bits, and you want to use all of its storage, then in theory what you can is:

  • in the reading direction, take the 16 bit output obtained from your address lines A1..AN and pass it through a bank of 2x1 multiplexers, to go from 16 to 8 lines. Your A0 line to drive these multiplexers, so that in effect your A0 line selects which of the two 8 bit halves of the 16 bits are passed to your data bus.

  • in the writing direction, you need some buffers which drive each of your 8 lines to one of two possible data pins on the ROM based on address A0.

These two directions can be combined into one using bidirectional multiplexers. For instance, the ON Semiconductor 74FST3257 mux/demux/bus switch provides four 2x1 bidirectional muxes. With a pair of these, you could route 8 points on one side into a choice of two different sets of 8 points on the opposite side, based on the A0 line.

This is complicated enough that it should send you looking for an 8 bit memory part in the first place.