Skip to main content
Add polling algorithm; add citation on hardware protection
Source Link
the busybee
  • 3.6k
  • 12
  • 20

YouInitially you did not say which device exactly you are using, so I looked up this one by Microchip to try to help.

Well, you already mentioned it in your question, the data protection might be enabled. You can check this by comparing the values read from the device. If you cannot change a bit, and it reads a byte always the same, the device is protected. The sequence to disable the protection is in the data sheet.

You need to be aware of the "polling operation" during the write (D7 is inverted, D6 is alternating on each read, D5 to D0 are to be ignored). However, you can "jump over" it with some delay, as you try to do.

EDIT

The polling operation is described in the data sheet. In general, it works like this:

  • During the write cycle (maximum 10ms says the data sheet) you read the last byte written (the highest address on multi-byte page writes).
  • The bit value on D7 is inverted to the value to be written.
  • The bit value on D6 alternates between 0 and 1 on each read.
  • Ignore all other bits read.
  • Repeat as long as D7 is inverted.
  • As soon as you read the byte you wrote, the cycle has finished.

The data sheet also mentions the hardware protection:

Hardware features protect against inadvertent writes to the AT28C64B in the following ways:

  • (a) VCC sense – if VCC is below 3.8 V (typical), the write function is inhibited;
  • (b) VCC power-on delay – once VCC has reached 3.8 V, the device will automatically time out 5 ms (typical) before allowing a write;
  • (c) write inhibit – holding any one of OE low, CE high, or WE high inhibits write cycles; and
  • (d) noise filter – pulses of less than 15 ns (typical) on the WE or CE inputs will not initiate a write cycle.

You might like to check that you have considered all of these conditions.

Chapter 4.6.2 should be a must-read, too.

You did not say which device exactly you are using, so I looked up this one by Microchip to try to help.

Well, you already mentioned it in your question, the data protection might be enabled. You can check this by comparing the values read from the device. If you cannot change a bit, and it reads a byte always the same, the device is protected. The sequence to disable the protection is in the data sheet.

You need to be aware of the "polling operation" during the write (D7 is inverted, D6 is alternating on each read, D5 to D0 are to be ignored). However, you can "jump over" it with some delay, as you try to do.

Initially you did not say which device exactly you are using, so I looked up this one by Microchip to try to help.

Well, you already mentioned it in your question, the data protection might be enabled. You can check this by comparing the values read from the device. If you cannot change a bit, and it reads a byte always the same, the device is protected. The sequence to disable the protection is in the data sheet.

You need to be aware of the "polling operation" during the write (D7 is inverted, D6 is alternating on each read, D5 to D0 are to be ignored). However, you can "jump over" it with some delay, as you try to do.

EDIT

The polling operation is described in the data sheet. In general, it works like this:

  • During the write cycle (maximum 10ms says the data sheet) you read the last byte written (the highest address on multi-byte page writes).
  • The bit value on D7 is inverted to the value to be written.
  • The bit value on D6 alternates between 0 and 1 on each read.
  • Ignore all other bits read.
  • Repeat as long as D7 is inverted.
  • As soon as you read the byte you wrote, the cycle has finished.

The data sheet also mentions the hardware protection:

Hardware features protect against inadvertent writes to the AT28C64B in the following ways:

  • (a) VCC sense – if VCC is below 3.8 V (typical), the write function is inhibited;
  • (b) VCC power-on delay – once VCC has reached 3.8 V, the device will automatically time out 5 ms (typical) before allowing a write;
  • (c) write inhibit – holding any one of OE low, CE high, or WE high inhibits write cycles; and
  • (d) noise filter – pulses of less than 15 ns (typical) on the WE or CE inputs will not initiate a write cycle.

You might like to check that you have considered all of these conditions.

Chapter 4.6.2 should be a must-read, too.

Source Link
the busybee
  • 3.6k
  • 12
  • 20

You did not say which device exactly you are using, so I looked up this one by Microchip to try to help.

Well, you already mentioned it in your question, the data protection might be enabled. You can check this by comparing the values read from the device. If you cannot change a bit, and it reads a byte always the same, the device is protected. The sequence to disable the protection is in the data sheet.

You need to be aware of the "polling operation" during the write (D7 is inverted, D6 is alternating on each read, D5 to D0 are to be ignored). However, you can "jump over" it with some delay, as you try to do.