mirror of
https://github.com/dougg3/mac-rom-simm-programmer.git
synced 2024-12-27 06:29:22 +00:00
Fixed the problem that caused no chip present to verify OK after a write
The problem was that the data bus would "remember" the last data I wrote to it if a chip was not driving the data bus on a read, so it would think that the chip had returned the correct data. I fixed it by writing the opposite data to the data bus before a verification read.
This commit is contained in:
parent
667c2c5a2d
commit
2c8e7e7184
@ -346,6 +346,15 @@ uint8_t ExternalMem_Write(uint32_t startAddress, uint32_t *buf, uint32_t len, ui
|
||||
ExternalMem_WriteByteToChips(startAddress, *buf, chipsMask);
|
||||
if (doVerify)
|
||||
{
|
||||
// Write the opposite data to the data bus before attempting to read
|
||||
// the chips for verification. At this point, the OE and WE lines
|
||||
// will be deasserted (due to WriteByteToChips()) so writing a value
|
||||
// to the data bus won't do anything. But if there's no chip on
|
||||
// a data line, reading back seems to "remember" the last value
|
||||
// written. So writing the opposite of what we expect will ensure
|
||||
// that the readback will fail if a chip isn't responding.
|
||||
ExternalMem_SetData(~(*buf));
|
||||
|
||||
#define VERIFY_EXTRA_READ_TRIES 2
|
||||
|
||||
// Read back the word we just wrote to make sure it's OK...
|
||||
|
Loading…
Reference in New Issue
Block a user