Reading Flash and EPROM chips and visualizing their contents

This post can be seen as a follow up to my recent post ((My first impression of the Genius G540 universal programmer)) adressing the G540 universal programmer. The reason why I bought this programmer was that I have collected many old memory chips. I was always curious what kind of interesting data they might contain. A EPROM reader was needed and since my urge to build an Arduino shield for that purpose lapsed soon after sourcing some MCP23S17 ((Microchip product page of the MCP23S17)) SPI port expander chips.  So I bought the G540 I mentioned before. 

I dumped the memory of an Texas Instruments  TMS27C020 ((TMS27C020 product page)) EPROM of unknown origin and an Eon Semi EN29F002NT containing an 1998 Award BIOS I pulled from an old mainboard. Both chips have a capacity of 2 megabit or 262144 bytes. I saved the memory content of the chips in a binary format.

Two memory chips

To make use of the data I wrote a shady processing program that generates an image from these files. It simply maps every bit to a black (1) or white (0) pixel.

// Open a file and read its binary data
byte b[] = loadBytes("ti.bin");

int w=2048;
int h=1024;

//check if dimensions fit and if not adjust
if (w*h != b.length*8)
h=(b.length*8) / w ;

//define byte cont var
int count = 0;

//define colors
color black = color(0);
color white = color(255);

// set size of display pane
size(w, h);

// create image
PImage img = createImage(w , h, RGB);
img.loadPixels();

//row
for (int i=0; i<h; i++) {

//columns, increment by 8 because bytes
for (int j=0; j<w; j = j+8) {

// 8 bits each byte
for(int k=0; k<8; k++) {
if( (b[count] & (1 << k)) > 0 )
img.set(j+k,i, color(black));
else
img.set(j+k,i, color(white));
}
count++; //increment by 1 each 8 bits
}
}
// the documentation says to do that
img.updatePixels();

//display image
image(img, 0, 0, w, h);

//save image
save("bitmap.png");

which results in this image

bitmap
Open this image in a new tab to view its full patterny beauty

For me this is just a proof of concept. I know the code is nasty but it is my first time using processing and the first time in years of me “programming” more than my phones alarm. I will continue to work on this topic and post further progress.

 

Leave a Reply

Your email address will not be published. Required fields are marked *


8 − ЅЕVЕN =

This site uses Akismet to reduce spam. Learn how your comment data is processed.