8bit
Electronics & Computers
EEPROMwriter
2023.11.02 18:34:52 end HW Gilhad

See also http://8bit.gilhad.cz/6809/OMENkilo.html

1   EEPROMwriter

** For AT28C256 and compatible only !!! **

AT28C64 is 8kB EEPROM used in Omen Kilo.

AT28C128 is 16kB EEPROM.

AT28C256 is 32kB EEPROM, compatible with previous two.

Wraps occures, when max capacity is reached.

Serial Data Format for Arduino EEPROM Writing

This document outlines the data format to use with the Arduino program for writing to EEPROM via Serial communication.

  • Control Characters:
    • = Start of EEPROM Offset: Specifies the starting address for EEPROM.
    • @ Start of Data Offset: Specifies the offset for data adjustments.
    • : Start of IHEX Line: Denotes an Intel Hex (IHEX) data line to write to EEPROM.
    • anything else is ignored
  • Instructions:
    • EEPROM Offset (Start Address):
      • To set the EEPROM offset, send a line starting with = followed by an optional negative sign and 1 to 4 hexadecimal digits. For example, =C000 sets the EEPROM offset to 0xC000 (last 16kB on Omen Kilo).
    • Data Offset:
      • To set the data offset, send a line starting with @ followed by an optional negative sign and 1 to 4 hexadecimal digits. For example, @4000 sets the data offset to 0x4000 (second 16kB block in EEPROM).
    • IHEX Data Line:
      • To send data to be written to EEPROM, use a line starting with :. This line should contain the IHEX data in the format you require.
      • Line :0DF0100048656C6C6F20776F726C64210A8C 0D bytes, starts at F010,record type 00 (data), 'Hello world!'CR, checksum of the line 8C
      • will be placed at F010 + 4000 - C000 = D010 inside the EEPROM.
      • Consequently when the second 16k part (offset 4000) of the EEPROM is mounted on C000, then on F010 will be the string.
  • Writing Data:
    • The program will interpret the IHEX lines and perform the following actions:
      • Calculate the address based on the IHEX line, subtract the EEPROM offset, and add the data offset. The result is truncated to 16 bits.
      • Set the address pins based on the resulting value and the pins_addr array.
      • Set the data pins based on the IHEX data and the pins_data array.
      • Write LOW, then HIGH to the pin_write to save the data.
      • Increase address, the result is truncated to 16 bits.
        • if 64 bytes border crossed, read last used address, until 4 same readings occurs
      • repeat for all data in IHEX line

Example Data Format:

=C000  // Set EEPROM offset to 0xC000 (last 16kB)
@4000  // Set data offset to 0x4000 (second 16kb part of EEPROM)
:0DF0100048656C6C6F20776F726C64210A8C // An example IHEX line for writing data to EEPROM