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();
}
}