In fact, I don't know If the flash are empty or not, because I found a weird behavior: when I try to send a command sequence to the flash, the data is put too no problem here, however when I try to read data, is always equal the data puted before even if i changed the pins in the input mode.
When reading the flash you do not issue any special command sequence - you just read the flash with for example:
// read a single byte from flash
byte flash_read(unsigned long address)
{
byte data = 0x00; //try to change to 0xFF to see the difference
flash_ctrl_deselect();
flash_change_data_pins_mode(IN);
flash_addr_set(address);
flash_ctrl_rd(); // rd/oe goes LOW
delayMicroseconds(1); // 1usec is ok when reading the flash (70ns is min)
data = flash_data_get();
flash_ctrl_deselect(); // rd/oe goes HIGH, cs goes HIGH
return data;
}
Pito - with your programs - how are you feeding the data to the programmer?
Frankly, last time I built my pc controlled eeprom programmer was in '87 where I did it by wiring a 8255A to Atari520ST' ACSI bus (an SCSI HDD bus), wrote a driver in asm, and the main program in gfbasic (or something called like that). I opened a file on the diskette, read binary and flashed a 27C512 EEPROM (Atari TOS upgrade,, six eeproms). That is all I can say to this topic..
Based on my experience with this stuff, it works fine when:
- you carefully check the wiring (many times..)
- you build the sw routines step by step, testing each function carefully
- you do not try to speedup/optimize the sw - do it slow and simple, ie connect LEDs to cs, oe, we (such it lits when active), add delays so you can see the sequence, when it works properly remove the delays.
- mind that by wiring error swapped data or address lines will write/read the flash properly (against the binary), but it will not work in your final hardware (unless you swap the lines there in the same way too)..
Feeding the data: that is the last issue I would mess with at this stage. First, try to flash several bytes (ie 4) to 4 addresses somewhere. Verify. Erase, and do it again (different data, different addresses). Repeat many times. When it works fine, then start to think how to pass the data (via serial, from an sdcard, etc).
@kf2qd: Your schematics: I would use 74HC or HCT 595 shifters, and do care about all its input pins (10.11.12.13.14) somehow..
PS: I would put pullups (ie an 8x10k sip module) on the data bus, thus I will read 0xFF even the memory is deselected.