Hi,
I've purchased a vintage DRAM tester from eBay recently, and while I was waiting, I decided to buy an Arduino and try making some basic tester.
Here is how I came across this forum thread.
I had some free time, made some 'google research', and made some software updates over the iss's ino code that I would like to share with you.
Major updates:
- fillx() accepts custom 8-bit test patterns
- first fills the entire DRAM with the test pattern, then reads back and verifies (readx() func) in a second pass
- stops after MAX_ERRORS count of errors, not after first error
- added Auto-find 4164/41256. The jumper is no longer required, but if closed, will force a 4164 test. This is not the best auto-find solution though, as it writes/reads only one bit.
- readAddress and writeAddress routines rewritten for direct port manipulation - significant speed increase
Other updates that I have on my mind would require hardware changes (such as 4116 12V -5V DRAM support)
It was real fun to see how the Arduino tester catches single-bit errors while the 50-euro ebay tester didn't:
DRAMARDUINO - Dram tester with Arduino
Re: DRAMARDUINO - Dram tester with Arduino
- Attachments
-
- dramarduino_new.zip
- (2.43 KiB) Downloaded 116 times
Re: DRAMARDUINO - Dram tester with Arduino
@Stan: Cool! I like the pattern test, 64/256 detection and MAX_ERRORS improvements.
Not sure about new 'blink' mode (IMO the speed-up comes mainly because no in-test blinking).
I'll test asap and make the changes 'official'
Not sure about new 'blink' mode (IMO the speed-up comes mainly because no in-test blinking).
I'll test asap and make the changes 'official'

Re: DRAMARDUINO - Dram tester with Arduino
I also do not like the blinking
I'm leaving it you or anybody who has something in mind about it.
>>>(IMO the speed-up comes mainly because no in-test blinking).
Not only. Looks like every arduino's digitalWrite(); digitalRead(); does a bunch of operations that can last several microseconds and we have a lot of them for every DRAM read or write.
https://roboticsbackend.com/arduino-fast-digitalwrite/
Whereas a direct read from a port even needs a delay because DRAM is not so fast:
/* column */
setBus(c);
PORTB &= ~(1 << PORTB_CAS);
/* bit read value */
__asm__("nop\n\t"); //62.5ns
__asm__("nop\n\t"); //62.5ns
__asm__("nop\n\t"); //62.5ns
__asm__("nop\n\t"); //62.5ns
ret = PINB & (1 << PINB_DO);

>>>(IMO the speed-up comes mainly because no in-test blinking).
Not only. Looks like every arduino's digitalWrite(); digitalRead(); does a bunch of operations that can last several microseconds and we have a lot of them for every DRAM read or write.
https://roboticsbackend.com/arduino-fast-digitalwrite/
Whereas a direct read from a port even needs a delay because DRAM is not so fast:
/* column */
setBus(c);
PORTB &= ~(1 << PORTB_CAS);
/* bit read value */
__asm__("nop\n\t"); //62.5ns
__asm__("nop\n\t"); //62.5ns
__asm__("nop\n\t"); //62.5ns
__asm__("nop\n\t"); //62.5ns
ret = PINB & (1 << PINB_DO);
Re: DRAMARDUINO - Dram tester with Arduino
Good. Just saying that skipping the LED blinks is not the real reason for the speed up.
Re: DRAMARDUINO - Dram tester with Arduino
Hi all,
The sketch I've uploaded has a bug or a feature depending on what one expects.
As you already know, DRAMs need their content to be refreshed within some time period.
In 4164/41256 this is done by just toggling every row once in the specified period which is ~4 microseconds.
Look at this code:
Because rows are advancing in the outer loop, a row is accessed only after max_r x max_c times.
This is a way too slow - tens and hundreds times slower than the spec depending on memory size - 64 or 256.
Nevertheless, most of DRAMs I've tested pass the tests. Only a few fail with a screenshot similar to one I've posted.
In short:
IF: <you want a very slow refresh test> THEN: <leave code as is>
ELSE IF: <you want normal refresh test> THEN: <switch places of r and c variables as shown below>
Similar loops can be found in the following functions:
void fill(byte v)
void fillx(byte pattern)
void readx(byte pattern)
The sketch I've uploaded has a bug or a feature depending on what one expects.
As you already know, DRAMs need their content to be refreshed within some time period.
In 4164/41256 this is done by just toggling every row once in the specified period which is ~4 microseconds.
Look at this code:
Code: Select all
for (r = 0; r < max_r; r++) {
for (c = 0; c < max_c; c++) {
writeAddress(r, c, v);
if (readAddress(r, c) != v)
if (error(r, c))
return;
}
This is a way too slow - tens and hundreds times slower than the spec depending on memory size - 64 or 256.
Nevertheless, most of DRAMs I've tested pass the tests. Only a few fail with a screenshot similar to one I've posted.
In short:
IF: <you want a very slow refresh test> THEN: <leave code as is>
ELSE IF: <you want normal refresh test> THEN: <switch places of r and c variables as shown below>
Code: Select all
for (c = 0; c < max_c; c++) {
for (r = 0; r < max_r; r++) {
writeAddress(r, c, v);
if (readAddress(r, c) != v)
if (error(r, c))
return;
}
void fill(byte v)
void fillx(byte pattern)
void readx(byte pattern)
Re: DRAMARDUINO - Dram tester with Arduino
Nice research, thanks
.
