/* This is the source file for the EPROM Programmer! The pin declarations in this file are specifically setup
* for the Arduino Micro, however you can modify the pins to fit your own Arduino Board. This code is paired with$
* script that sends the hex file byte by byte to the Arduino, which will then put it into the correct address of$
*
* The hardware for this programmer is two 74HC595 Shift Registers driving the address BUS, with the data BUS and$
* pins directly connected to the Arduino Pins.
*
* This is the version of the code used to READ from memory!
*
* For more information please visit my website at: [url=http://www.RCtalesofarookie.weebly.com]www.RCtalesofarookie.weebly.com[/url]
*
* Created by Sam Maxwell
* FEB 2016
*/
// Constant Variables that hold the pin values, please change these for your specific Arduino Board
// Variables for the 595 Shift Registers driving the address BUS
const int SRClock = 12;
const int Enable = 11;
const int RClock = 10;
const int SRIn = 9;
// Variables for control pins on the ROM
const int write_pin = 0;
const int mem_enable = 1;
const int mem_output = 14;
// Variables for Storing the current character, current byte and current address
int current_char;
int current_addr = 0;
// Main Code
// Setup
void setup(){
// Setting up the Serial Connection for debugging purposes, as well as programming status.
Serial.begin(9600);
Serial.println("Programmer Initialising!");
// Setting Pin Modes
for(int x = 14; x > -1; x--){
pinMode(x, OUTPUT);
}
digitalWrite(Enable, LOW);
digitalWrite(write_pin, HIGH);
digitalWrite(mem_output, HIGH);
digitalWrite(mem_enable, HIGH);
// Programmer Initialised
Serial.println("Programmer Initialised");
}
// Loop
void loop(){
// Setting Address on Address BUS
digitalWrite(RClock, LOW);
shiftOut(SRIn, SRClock, MSBFIRST, (current_addr >> 8));
shiftOut(SRIn, SRClock, MSBFIRST, current_addr);
digitalWrite(RClock, HIGH);
// Reading Values from Memory
digitalWrite(mem_enable, LOW);
digitalWrite(mem_output, LOW);
int a = digitalRead(13);
int b = digitalRead(8);
int c = digitalRead(7);
int d = digitalRead(6);
int e = digitalRead(5);
int f = digitalRead(4);
int g = digitalRead(3);
int h = digitalRead(2);
current_char = (a << 7) + (b << 6) + (c << 5) + (d << 4) + (e << 3) + (f << 2) + (g << 1) + h;
digitalWrite(mem_enable, HIGH);
digitalWrite(mem_output, HIGH);
// Printing Current Values
Serial.print("Current Byte:");
Serial.println(current_char);
Serial.print("Current Address:");
Serial.print(current_addr);
delay(40);
// Increasing Address Value
current_addr = current_addr + 1;
}
/* This is the source file for the EPROM Programmer! The pin declarations in this file are specifically setup
* for the Arduino Micro, however you can modify the pins to fit your own Arduino Board. This code is paired with$
* script that sends the hex file byte by byte to the Arduino, which will then put it into the correct address of$
*
* The hardware for this programmer is two 74HC595 Shift Registers driving the address BUS, with the data BUS and$
* pins directly connected to the Arduino Pins.
*
* This is the version of the code used for WRITING to memory!
*
* For more information please visit my website at: [url=http://www.RCtalesofarookie.weebly.com]www.RCtalesofarookie.weebly.com[/url]
*
* Created by Sam Maxwell
* FEB 2016
*/
// Constant Variables that hold the pin values, please change these for your specific Arduino Board
// Variables for the 595 Shift Registers driving the address BUS
const int SRClock = 12;
const int Enable = 11;
const int RClock = 10;
const int SRIn = 9;
// Variables for control pins on the ROM
const int write_pin = 0;
const int mem_enable = 1;
const int mem_output = 14;
// Variables for Storing the current character, current byte and current address
char current_char;
int current_addr = 0;
// Main Code
// Setup
void setup(){
// Setting up the Serial Connection for debugging purposes, as well as programming status.
Serial.begin(9600);
Serial.println("Programmer Initialising!");
// Setting Pin Modes
for(int x = 14; x > -1; x--){
pinMode(x, OUTPUT);
}
digitalWrite(Enable, LOW);
digitalWrite(write_pin, LOW);
digitalWrite(mem_output, HIGH);
digitalWrite(mem_enable, HIGH);
// Programmer Initialised
Serial.println("Programmer Initialised");
}
// Loop
void loop(){
if(Serial.available() > 0){
// Reading the Character from the Serial Port
current_char = Serial.read();
// Printing Character to Serial Terminal
Serial.print("Current Byte:");
Serial.println(current_char);
Serial.println(current_char, BIN);
Serial.print("Current Address:");
Serial.println(current_addr, BIN);
// Setting Address on Address BUS
digitalWrite(RClock, LOW);
shiftOut(SRIn, SRClock, MSBFIRST, (current_addr >> 8));
shiftOut(SRIn, SRClock, MSBFIRST, current_addr);
digitalWrite(RClock, HIGH);
// Setting the values on the data bus
digitalWrite(13, bitRead(current_char, 7));
digitalWrite(8, bitRead(current_char, 6));
digitalWrite(7, bitRead(current_char, 5));
digitalWrite(6, bitRead(current_char, 4));
digitalWrite(5, bitRead(current_char, 3));
digitalWrite(4, bitRead(current_char, 2));
digitalWrite(3, bitRead(current_char, 1));
digitalWrite(2, bitRead(current_char, 0));
// Writing Values into Memory
digitalWrite(mem_enable, LOW);
delay(100);
digitalWrite(mem_enable, HIGH);
// Increasing Address Value
current_addr = current_addr + 1;
}
}
I linked to a static RAM datasheet as I am using it to test before I program my actual OTPEPROMs.
For write put data on inputs then wr and wait
Ok, my mind really escapes me, been working on this all day. It's an OTPROM, here's the datasheet: http://www.atmel.com/images/doc0014.pdf
No, but if you would post an actual schematic or at the very least a picture of the PCB, we might have a better guess at what's going on. Otherwise, its still a guessing game at best.
Apologies again, Im not great at this.
Decoupling cap's. Where are they?
Do you want to post your latest code as we know the code in post #1 is buggy as pointed out by me and C
/* This is the source file for the EPROM Programmer! The pin declarations in this file are specifically setup
* for the Arduino Micro, however you can modify the pins to fit your own Arduino Board. This code is paired with$
* script that sends the hex file byte by byte to the Arduino, which will then put it into the correct address of$
*
* The hardware for this programmer is two 74HC595 Shift Registers driving the address BUS, with the data BUS and$
* pins directly connected to the Arduino Pins.
*
* This is the version of the code used to READ from memory!
*
* For more information please visit my website at: [url=http://www.RCtalesofarookie.weebly.com]www.RCtalesofarookie.weebly.com[/url]
*
* Created by Sam Maxwell
* FEB 2016
*/
// Constant Variables that hold the pin values, please change these for your specific Arduino Board
// Variables for the 595 Shift Registers driving the address BUS
const int SRClock = 12;
const int Enable = 11;
const int RClock = 10;
const int SRIn = 9;
// Variables for control pins on the ROM
const int write_pin = 0;
const int mem_enable = 1;
const int mem_output = 14;
// Variables for Storing the current character, current byte and current address
char current_char;
int current_addr = 0;
// Main Code
// Setup
void setup(){
// Setting up the Serial Connection for debugging purposes, as well as programming status.
Serial.begin(9600);
Serial.println("Programmer Initialising!");
// Setting Pin Modes
pinMode(0, OUTPUT);
pinMode(1, OUTPUT);
pinMode(14, OUTPUT);
for(int x = 12; x > 8; x--){
pinMode(x, OUTPUT);
}
pinMode(13, INPUT);
for(int y = 8; y > 1; y--){
pinMode(y, INPUT);
}
digitalWrite(Enable, LOW);
digitalWrite(write_pin, HIGH);
digitalWrite(mem_output, HIGH);
digitalWrite(mem_enable, HIGH);
// Programmer Initialised
Serial.println("Programmer Initialised");
}
// Loop
void loop(){
// Setting Address on Address BUS
digitalWrite(RClock, LOW);
shiftOut(SRIn, SRClock, MSBFIRST, (current_addr >> 8));
shiftOut(SRIn, SRClock, MSBFIRST, current_addr);
digitalWrite(RClock, HIGH);
// Reading Values from Memory
digitalWrite(mem_enable, LOW);
digitalWrite(mem_output, LOW);
int a = digitalRead(13);
int b = digitalRead(8);
int c = digitalRead(7);
int d = digitalRead(6);
int e = digitalRead(5);
int f = digitalRead(4);
int g = digitalRead(3);
int h = digitalRead(2);
delay(2);
current_char = (a << 7) + (b << 6) + (c << 5) + (d << 4) + (e << 3) + (f << 2) + (g << 1) + h;
digitalWrite(mem_enable, HIGH);
digitalWrite(mem_output, HIGH);
// Printing Current Values
Serial.print("Current Byte:");
Serial.println(current_char);
Serial.print("Current Address:");
Serial.println(current_addr);
delay(1);
// Increasing Address Value
current_addr = current_addr + 1;
}
/* This is the source file for the EPROM Programmer! The pin declarations in this file are specifically setup
* for the Arduino Micro, however you can modify the pins to fit your own Arduino Board. This code is paired with$
* script that sends the hex file byte by byte to the Arduino, which will then put it into the correct address of$
*
* The hardware for this programmer is two 74HC595 Shift Registers driving the address BUS, with the data BUS and$
* pins directly connected to the Arduino Pins.
*
* This is the version of the code used for WRITING to memory!
*
* For more information please visit my website at: [url=http://www.RCtalesofarookie.weebly.com]www.RCtalesofarookie.weebly.com[/url]
*
* Created by Sam Maxwell
* FEB 2016
*/
// Constant Variables that hold the pin values, please change these for your specific Arduino Board
// Variables for the 595 Shift Registers driving the address BUS
const int SRClock = 12;
const int Enable = 11;
const int RClock = 10;
const int SRIn = 9;
// Variables for control pins on the ROM
const int write_pin = 0;
const int mem_enable = 1;
const int mem_output = 14;
// Variables for Storing the current character, current byte and current address
char current_char;
int current_addr = 0;
// Main Code
// Setup
void setup(){
// Setting up the Serial Connection for debugging purposes, as well as programming status.
Serial.begin(9600);
Serial.println("Programmer Initialising!");
// Setting Pin Modes
for(int x = 14; x > -1; x--){
pinMode(x, OUTPUT);
}
digitalWrite(Enable, LOW);
digitalWrite(write_pin, HIGH);
digitalWrite(mem_output, HIGH);
digitalWrite(mem_enable, HIGH);
// Programmer Initialised
Serial.println("Programmer Initialised");
}
// Loop
void loop(){
if(Serial.available() > 0){
// Reading the Character from the Serial Port
current_char = Serial.read();
// Printing Character to Serial Terminal
Serial.print("Current Byte:");
Serial.println(current_char);
Serial.println(current_char, BIN);
Serial.print("Current Address:");
Serial.println(current_addr, BIN);
// Setting Address on Address BUS
digitalWrite(RClock, LOW);
shiftOut(SRIn, SRClock, MSBFIRST, (current_addr >> 8));
shiftOut(SRIn, SRClock, MSBFIRST, current_addr);
digitalWrite(RClock, HIGH);
// Writing Values into Memory
digitalWrite(13, bitRead(current_char, 7));
digitalWrite(8, bitRead(current_char, 6));
digitalWrite(7, bitRead(current_char, 5));
digitalWrite(6, bitRead(current_char, 4));
digitalWrite(5, bitRead(current_char, 3));
digitalWrite(4, bitRead(current_char, 2));
digitalWrite(3, bitRead(current_char, 1));
digitalWrite(2, bitRead(current_char, 0));
digitalWrite(mem_enable, LOW);
digitalWrite(write_pin, LOW);
delay(4);
digitalWrite(write_pin, HIGH);
digitalWrite(mem_enable, HIGH);
// Increasing Address Value
current_addr = current_addr + 1;
}
}
Hmmmm, I don't know what's wrong with me this week. I'll add one now. Do you think that's what could be causing the instability in the data that I am reading?