Reading Flash and EPROM chips and visualizing their contents

This post can be seen as a follow up to my recent post[1] 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[2] SPI port expander chips.  So I bought the G540 I mentioned before. 

I dumped the memory of an Texas Instruments  TMS27C020[3] 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);

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));
img.set(j+k,i, color(white));
count++; //increment by 1 each 8 bits
// the documentation says to do that

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

//save image

which results in this image

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.


  1. My first impression of the Genius G540 universal programmer 
  2. Microchip product page of the MCP23S17 
  3. TMS27C020 product page 

Leave a Reply

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

ТWО × = 2

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