AT24C256 TinyCLR Driver and Storage Responsibilities in THE Radio Receiver

I have published a TinyCLR driver for the AT24C256 serial EEPROM:

Repository:
Implicate-X/ImplicateX.TinyCLR.Drivers.Memory.At24c256

The driver provides:

  • 16-bit memory addressing
  • 64-byte page write handling
  • Automatic page-boundary splitting
  • Read and write operations across the full 32 KiB address range
  • Device verification through read/write/read-back testing
  • Proper disposal and range validation

Typical usage:

  • Application settings
  • Configuration storage
  • Small persistent data structures
  • Embedded devices requiring non-volatile storage

What makes this driver particularly relevant in my current project is the architectural separation of storage responsibilities.

In the Embedded Architecture ā€œBack to the Futureā€ project THE Radio Receiver, different storage technologies are assigned to different responsibilities:

Responsibility Storage
Device settings AT24C256 EEPROM
FM station presets FeRAM
Web station presets FeRAM

This separation reflects the actual usage characteristics of the data.
Settings are written relatively infrequently and therefore fit well into EEPROM.
Station memories are updated much more often. FeRAM is therefore a better choice because it combines non-volatility with virtually unlimited write endurance and no write-cycle delays.

An interesting consequence of this architecture is that device availability is no longer validated globally at startup.

Earlier versions simply scanned the entire I²C bus and failed if any expected device was missing.
The current direction is different: each functional subsystem becomes responsible for validating the storage or hardware resources it actually needs.

For example, a user can still listen to the radio even if station storage is not available. Only the station memory functionality becomes unavailable.

As a result, hardware validation moves from bus-level responsibility to feature-level responsibility.

For me, this is one more example that Embedded Development and Architecture are not opposites. In larger systems they eventually become the same discussion…

1 Like

More about the upcoming persistance architecture in THE Radio Receiver

One aspect of THE Radio Receiver that emerged while developing the AT24C256 and FRAM drivers is the separation of responsibilities.

At first glance it may appear that Settings, FM Stations and Web Stations are directly connected to specific memory devices. In reality, none of these subsystems know anything about EEPROMs, FRAMs, I²C addresses or even whether data is persisted at all.

For example:

  • FM Radio knows its stations.
  • Web Radio knows its stations.
  • Settings know their settings.

Nothing more.

Likewise, the device drivers know only themselves:

  • AT24C256V knows the AT24C256.
  • MB85RC256V knows the MB85RC256V.

They do not know why they exist, what data is stored, or which subsystem uses them.

The chassis contains a Storage section organized as physical storage locations:

  • Storage.North
  • Storage.West
  • Storage.East

During system design, each location receives an interchangeable storage driver instance. Today this may be an AT24C256V or an MB85RC256V. Tomorrow it could be a different FRAM, EEPROM, PSRAM, SD card, or another storage technology entirely.

Outside of the storage location itself, nobody needs to know.

The storage locations expose persistence services such as Save() and Load(), but they do not know what is being stored. Likewise, FM Radio, Web Radio and Settings do not know where their data is physically persisted.

As a result, functionality, storage locations and storage technologies remain independent of each other.

Changing a storage technology becomes a local design decision rather than a system-wide change.

One additional aspect of the design is that persistence itself is considered optional.

FM Radio, Web Radio and Settings remain functional even if no physical storage device is available.

For example, WebRadio.Stations does not know whether its data is currently loaded from FRAM, EEPROM, PSRAM, an SD card, or from a built-in default list deployed with the application.

When a load operation is requested, the storage subsystem may attempt to load persisted data from a physical storage resource. If no suitable storage device is available, the operation can transparently fall back to default stations included in the deployment.

As a result, responsibility remains with the feature itself.

WebRadio knows about stations. FM Radio knows about stations. Settings know about settings.

Storage only provides persistence services such as Load() and Save().

The physical storage devices know only themselves.

This allows the system to degrade gracefully. Missing persistence does not mean that radio functionality disappears. It only means that persistence becomes unavailable while the feature itself continues to operate…