beneater / eeprom-programmer Goto Github PK
View Code? Open in Web Editor NEWArduino EEPROM programmer
Arduino EEPROM programmer
Hi,
Would it work with 2764 EPROM?
Hi,
I've received several EEPROMs from Ebay, but I'm only able to program one of seven AT28C256.
Of course these are weird fakes or old dead ones, but I have tried to software erase those or disable protection. No luck yet. Am I doing it right?
Docs:
CHIP erase - http://ww1.microchip.com/downloads/en/Appnotes/doc0544.pdf
Protection - http://ww1.microchip.com/downloads/en/Appnotes/DOC0543.PDF
unsigned long time;
void setup() {
pinMode(SHIFT_DATA, OUTPUT);
pinMode(SHIFT_CLK, OUTPUT);
pinMode(SHIFT_LATCH, OUTPUT);
digitalWrite(WRITE_EN, HIGH);
pinMode(WRITE_EN, OUTPUT);
Serial.begin(230400);
Serial.print("\nUnlocking EEPROM... ");
time = millis();
writeEEPROM(21845, 0xaa);
writeEEPROM(10922, 0x55);
writeEEPROM(21845, 0x80);
writeEEPROM(21845, 0xaa);
writeEEPROM(10922, 0x55);
writeEEPROM(21845, 0x10);
writeEEPROM(1, 0x55);
writeEEPROM(2, 0xaa);
writeEEPROM(32767, 0x55);
time = millis() - time;
Serial.print("...done in ");
Serial.println(time);
printContents();
writeEEPROM(1, 0x55);
}
It finished in 12 ms as I have reduced WRITE_EN cycle:
digitalWrite(WRITE_EN, LOW);
delayMicroseconds(1);
digitalWrite(WRITE_EN, HIGH);
delay(1);
Any thoughts?
hi. i have a problem to program the at28c256 eeprom. with the at28c16 works perfectly . I have read in its datasheet that there is a write protection to unlock with a sequence of byte in some registers.
I have tried to write this sequence with the library write function, but it did't work
I'm not totally sure but my AT28C256 seems damaged. Adresses 0x7FE0 and 0x7FF0 returns 00 and when writting to them, the value is written to the next byte (respectively 0x7FE1 and 0x7FF1), and the same for 0x7FE2-0x7FEE and 0x7FF2-0x7FFE. Write 0x7FEF and 0x7FFF does nothing. I first though my wiring had an issue but everything seems fine when I read/write in 0X0000-0x7FDF so I guess my eeprom is damaged.
I guess that I damaged it trying to write at adresses > 0x7FFF because the Output Enable pin is then true whatever the outputEnable parameter is (I did that by mistake with a copy/paste of a write loop with base<=xxx
where I replaced xxx by 32768). I think a simple address&=0x7FFF;
at the beginning of the setAddress
function would be more secure.
But again, not sure it was the problem but the fix is safe...
I modified the code so that it would overwrite the whole chip with 0xea. Turns out when i change the break condition in the erase loop to 32767 to match the size of the eeprom it goes into a seemingly infinite loop. My guess is that the 16 bit signed INT of the arduino overflows so that the break condition of the erase loop will never be met. Changing this to an unsigned INT solved the problem for me. But because of my inexperience with arduinos i could also be wrong.
Hello,
Can NV RAM with built-in RTC model DS1642 be supported by this programmer?
As I understand it, this is an NV RAM that has RTC built in, but the operation is similar to a regular parallel NV RAM.
Parallel EEPROM memory has similar read and write commands.
Datasheet: https://datasheets.maximintegrated.com/en/ds/DS1642.pdf
Thank you.
In the video where you go through how to build an EEPROM programmer with the Arduino Uno you ended up using delay(10);
at the end of the writeEEPROM()
function. Did you come to any understanding why this was the case?
What if you want to write all the 2048 bytes, then it would take almost 20 seconds and it would be even worse for an EEPROM with 128 or 256 kbits.
Would it be possible to optimize the writeEEPROM()
function to let it take an array of bytes and put the delay(10)
at the end of writing all the bytes?
This is not actually an issue, but a question.
If we use Arduino Mega for this project, do we still need the 2 shift registers?
As I understand, Arduino Mega has enough pins to directly control all the lines of the EEPROM.
Thanks,
Panagiotis.
I'm having some difficulty with writing to the 256 eeprom. If I link pin 8 of the 74HC595 to GND the eeprom erases but won't write the test data. When I remove these the correct number of test bytes are written but they are all set to the value of the last byte of the test string. Any help would be appreciated.
Pin 13 on the 74HC595 chips (the output enable pin, OE) is labeled as "G", and pin 8 (the ground pin, GND) is not labeled.
Both Pin 8 (GND) and Pin 13 (OE) need to be tied to ground for this design to work properly.
I saw "G" tied to ground and assumed that was referring to ground, and didn't give it a second thought. a couple hours later with the oscilloscope I finally figured out why it wasn't working for me- my OE pins were floating because I wasn't paying attention.
It's my own fault for not paying attention, but I'm submitting this just incase someone else has the same issue.
Sorry if this issue is in wrong place. I cannot find a project about 8-bit computer. But it is still about the data that are written to EEPROM.
With current microcode, the memory address register can be set only by address hard-coded in instruction operand. It is now difficult* to write code that access an array element:
*) by difficult i mean that you have to use self-modifying code, which is non-standard construction
C example:
uint8_t array[4] = {10, 11, 12, 13};
uint8_t index = 2;
uint8_t c;
c = array[index];
Assembly representation:
0: LDA 0xE ; load variable index to register A
1: ADD 0x9 ; add op-code of instruction which loads first element of an array
2: STA 0x3 ; modify next instruction so it will load data from array[index] instead of array[0]
3: LDA 0xA ; this is modified to LDA 0xC (A <-- array[index]) before running
4: STA 0xF ; save result to variable c
5: HLT;
6:
7:
8:
9: LDA 0xA ; instruction which would load array[0], used for indirect access
A: 10 ; array[0]
B: 11 ; array[1]
C: 12 ; array[2]
D: 13 ; array[3]
E: 2 ; index
F: 0 ; c (the result)
"Usual" instruction sets would be Turing-complete even if we disallow self-modifying code (e. g. forbid writes to code segment of memory). In fact, this is quite common: In "normal" computers, the program is run from RAM. But it is usually in write-protected segments and data segments are protected from execution. It is not that common for code to self-modify itself. Same applies also to theoretical models. Neither Turing Machine nor Random Access Machine can modify its own code. But both are Turing-complete.
On the other hand, the Turing completeness of your 8-bit computer instruction set relies on ability of code to self-modify. Without self-modifying code, it can access only constant size of memory. So it cannot do anything like loop through an input array. In that case this 8-bit computer would not be Turing-complete anymore.
It basically means, that it is Turing-complete, but in different way than "normal" computers. I know, that you want to keep your 8-bit computer as simple as possible, but for educational purpose this difference should be at least noted somewhere.
If i may use analogy with Turing Machine from your video "Making a computer Turing complete". Turing machine's new state depends on data, so we need conditional jump. And same apply to memory address: Turing machine's next memory address (head position) also depends on data, so we need to set memory register based on data and not just to position fixed by a code.
And yes, current implementation overcomes lack of indirect access with self-modifying code. That is something that Turing Machine or Random Access Machine cannot do -- both models cannot modify their code, so they both need some kind of indirect access.
I suggest to add a pair of instructions which would do indirect load/store operations. Load is quite simple to implement: we can define LDAX instruction which will load data from address stored in register A:
{ MI|CO, RO|II|CE, AO|MI, RO|AI, 0, 0, 0, 0 }, // 1001 - LDAX
But there are few issues with store. There is no instruction to manipulate with B register directly, so instruction that would save A to address stored in B would be useless. (Unless something like MOV A -> B
is also added.)
So second option is to have indirect instructions LDAI/STAI load/store from/to address stored in memory address specified with operand.
{ MI|CO, RO|II|CE, IO|MI, RO|BI, BO|MI, RO|AI, 0, 0 }, // 1001 - LDAI
{ MI|CO, RO|II|CE, IO|MI, RO|BI, BO|MI, AO|RI, 0, 0 }, // 1001 - STAI
Only problem is, that these instructions are too long: 6 steps. But maybe it is possible to write directly from RAM register to Memory register (i am not sure about buffering there):
{ MI|CO, RO|II|CE, IO|MI, RO|MI, RO|AI, 0, 0, 0 }, // 1001 - LDAI
{ MI|CO, RO|II|CE, IO|MI, RO|MI, AO|RI, 0, 0, 0 }, // 1001 - STAI
After that, the example from beginning can be written without code modification:
0: LDA 0xE ; load variable index to register A
1: ADD 0xA ; add address of first element of an array
2: STA 0x9 ; save pointer *array[index] to temporary variable
3: LDAI 0x9 ; indirect load
4: STA 0xF ; save result to variable c
5: HLT;
6:
7:
8:
9: 0 ; temporary variable used to overcame lack of address registers
A: 10 ; array[0]
B: 11 ; array[1]
C: 12 ; array[2]
D: 13 ; array[3]
E: 2 ; index
F: 0 ; c (the result)
Well. What i just wrote is not entirely true. Turing Machine may be still simulated even if we do not have indirect access and we forbid self modifications of code. But we would need to extend word size to incredible lengths and store whole array in just one word. Than something as indirect access can be simulated using bit shifts and masking. So it can be computed with current instructions without self-modification. But that would be even bigger hack, which is usually forbidden even in theoretical models like Random Access machine.
Hi Ben and everyone. I am enjoying this fun project, on my way to build the 65 bread board computer. This issue is
Your code will erase the EEPROM, but it will not touch the first 16 bytes. My EEPROM is a AT28C64B
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.