I am trying to interface an AT28C64 external parallel eeprom with an arduino board.
I realize that i need many pins soo sanguino it's my option, but on the software side i have no ideea. I only want to read it.
Anyone knows where to start?
Start at the data sheet. Look at the signals you need, write the software to make those signals happen.
However why not use a serial eeprom, those are much cheaper, have fewer pins, same or greater capacity and people have written libraries for you.
Datasheet(http://140.113.144.123/Creative/AT28C64.pdf) shows that are A0-A12 pins for adressing, and I/O0-I/O7 pins for data output.
Also there are CE OE WE pins that configre whatever the state is beetween read/write etc.
The first step would be to connect this pins to the board, not using shift registers in favor of the code simplicity.
Then setting those three pins to the read state.
But after that i don't have the understanding of what adresses really are and how to catch the data from the output pins, a shiftIn function will help as i saw in one example.
The other types of eeproms are heavily documented, but not this one, why is that? not a single page of demo code.
The other types of eeproms are heavily documented, but not this one, why is that?
Because they are not well suited for this sort of use. There main use is in a micro processor system with a full data and address bus. This is a micro controller.
of what adresses really are and how to catch the data from the output pins,
An address is the location of your data, to access an address you put the binary value of the address location on the address pins. Then the contents of that address pop out on the data pins, read them with a digital read for each pin and assemble them into a byte.
a shiftIn function will help as i saw in one example.
Shift in is of no use to you here.
Basically this is the wrong chip in the wrong place, you can use it if you want but it is expensive in terms of software and in it's use of hardware pins.
I don't want to use it as an external memory for my arduino, i just want to dump it.
And.. i don't have the coding skills to do that, it might be simple but it would help to see some example or something to begin with.
i just want to dump it.
But you said in your first post:-
I only want to read it.
are you mixing up read and write?
Yes to read it, dumping it would be better but i would be happy just to see the data comming out on the serial monitor and then save it, no problem.
But.. how to get there?
t it would help to see some example or something to begin with.
As I said no one in there right mind would do it with a parallel eeprom, do you have one that you want to know the contents of?
If so you will have to do what I said above.
That is output the address, set the control lines and read the data pins, send it to the serial port and then repeat for the next address and so on until you have read the whole of the eeprom.
After Mike helped me with some code i managed to make it work, i read the contents of the memory.
So here's the code:
byte outPins[] = {0,1,2,3,4,5,6,7, 10,11,12,13,14,15,16,17}; // 16 pins for address output
byte inPins[] = {24,25,26,27,28,29,30,31}; // 8 pins for data lines// Control state pins: OutputEnable, WriteEnable, ChipEnable
int oe = 23;
int we = 22;
int ce = 21;// These two set the reading range. It may also be like 0x1C000 to 0x1FFFF
int minadr = 0;
int maxadr = 10000;void addressOut(int address){
int mask = 1;
for(int i = 0; i<16; i++) { // i < number of outpins
if((mask & address) != 0) digitalWrite(outPins_, HIGH); else digitalWrite(outPins*,LOW);_
_ mask = mask << 1;_
_}_
_}_
byte readIn(){
byte input = 0;
byte mask = 1;
for(int i = 0; i<8; i++){ // i < number of inpins
_ if(digitalRead(inPins) == HIGH) input |= mask;
mask = mask << 1;
}
return(input);
}
void setup() {
// PIN MODES*
pinMode(oe, OUTPUT);
pinMode(we, OUTPUT);
pinMode(ce, OUTPUT);
for(int i = 0; i<16; i++){ // i < number of outpins
pinMode(outPins*, OUTPUT);
}
for(int i = 0; i<8; i++){ // i < number of outpins
pinMode(inPins, INPUT);
}*_// Initialize READ state
digitalWrite(oe, LOW);
digitalWrite(ce, LOW);
digitalWrite(we, HIGH);Serial.begin(9600);
}
void loop() {
* for(int i = minadr; i < maxadr; i++) {*
* addressOut(i);*
* delay(10);*
* Serial.print(readIn(), HEX); // You may have to change how the output it's interpreted: BYTE, HEX, BIN*
* }*
}
[/quote]
Why do you need 16 address pins for an 8K device?
Why do you need 16 address pins for an 8K device?
For expansion. ![]()