EPROM testing code

// 1k bit prom tester 82s129
// sends a pulse to a 4040 binary ripple counter and checks the output
// if output is low, conitnues
// if output is high, sets badled high
// when complete, sets okread high
// then halts mcu requiring a manual reset

byte datapin[] = {8, 9, 10, 11}; // check for high on these pins. for 8 bits use pins 6-12
int pulsepin = 3 ;
int resetpin = 4;
int badled = 5;
int okread = 2;
int buffer;

void setup() {
pinMode(pulsepin, OUTPUT);
pinMode(resetpin, OUTPUT);
digitalWrite(pulsepin, LOW);
digitalWrite(resetpin, HIGH);
delay(10);
digitalWrite(resetpin, LOW);

digitalWrite(okread, LOW);
//Serial.begin(9600);
//Serial.flush();
//delay(1000);
//Serial.println("Starting Now");
}

void loop() {
digitalWrite(resetpin, HIGH);
delay(2);
digitalWrite(resetpin, LOW);
delay(2);
for (int x=0; x<255; x++) { // change maxval to the max number of addresses
digitalWrite(pulsepin, HIGH);
delay(2);
readchip();
digitalWrite(pulsepin, LOW);
delay(10);
}
digitalWrite(okread, HIGH);
while(1) { }
}

void readchip() {
for (int x=0; x<4; x++) { //change maxval to number of data pins
//buffer = digitalRead(datapin[x]);
if (digitalRead(datapin[x]) != 0) { badchip(); }
//Serial.print("data read: ");
//Serial.println(buffer);
}
}

void badchip() {
digitalWrite(pulsepin, LOW);
digitalWrite(badled, HIGH);
while(1) { }
}

One thought on “EPROM testing code

  1. Pingback: Simple PROM tester | Elmars Tinkering Again

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s