2019-06-15 04:15:30 +10:00
|
|
|
# Writing to a AT28 from Collapse OS
|
|
|
|
|
|
|
|
## Goal
|
|
|
|
|
|
|
|
Write in an AT28 EEPROM from within Collapse OS so that you can have it update
|
|
|
|
itself.
|
|
|
|
|
|
|
|
## Gathering parts
|
|
|
|
|
2020-04-14 04:41:02 +10:00
|
|
|
* A RC2014 Classic
|
2019-06-15 04:15:30 +10:00
|
|
|
* An extra AT28C64B
|
|
|
|
* 1x 40106 inverter gates
|
|
|
|
* Proto board, RC2014 header pins, wires, IC sockets, etc.
|
|
|
|
|
|
|
|
## Building the EEPROM holder
|
|
|
|
|
|
|
|
The AT28 is SRAM compatible so you could use a RAM module for it. However,
|
|
|
|
there is only one RAM module with the Classic version of the RC2014 and we
|
|
|
|
need it to run Collapse OS.
|
|
|
|
|
|
|
|
You could probably use the 64K RAM module for this purpose, but I don't have one
|
|
|
|
and I haven't tried it. For this recipe, I built my own module which is the same
|
|
|
|
as the regular ROM module but with `WR` wired and geared for address range
|
|
|
|
`0x2000-0x3fff`.
|
|
|
|
|
|
|
|
If you're tempted by the idea of hacking your existing RC2014 ROM module by
|
|
|
|
wiring `WR` and write directly to the range `0x0000-0x1fff` while running it,
|
|
|
|
be aware that it's not that easy. I was also tempted by this idea, tried it,
|
|
|
|
but on bootup, it seems that some random `WR` triggers happen and it corrupts
|
2019-11-05 06:45:10 +11:00
|
|
|
the EEPROM contents. Theoretically, we could go around that by putting the AT28
|
2019-06-15 04:15:30 +10:00
|
|
|
in write protection mode, but I preferred building my own module.
|
|
|
|
|
|
|
|
I don't think you need a schematic. It's really simple.
|
|
|
|
|
2020-05-15 01:32:51 +10:00
|
|
|
### Building the binary
|
2019-06-15 04:15:30 +10:00
|
|
|
|
2020-05-23 10:35:01 +10:00
|
|
|
The binary from the base recipe has almost all it needs to write to EEPROM. The
|
2020-08-16 23:31:02 +10:00
|
|
|
only thing it needs is the AT28 driver from B592. You could add it to the
|
2020-05-23 10:35:01 +10:00
|
|
|
`xcomp` unit and rebuild, but the driver is so tiny, you're probably better off
|
|
|
|
loading it at runtime.
|
2020-04-27 04:52:55 +10:00
|
|
|
|
2020-05-23 10:35:01 +10:00
|
|
|
If your system has mass storage, it's as easy as a LOAD. If it doesn't, you
|
2020-08-16 23:31:02 +10:00
|
|
|
can use `/tools/exec` to send `blk/593` to the RC2014.
|
2019-06-15 04:15:30 +10:00
|
|
|
|
|
|
|
## Writing contents to the AT28
|
|
|
|
|
2020-09-18 03:27:12 +10:00
|
|
|
The driver provides `AT28!` which can be plugged in adev's `A!*`. You can do so
|
|
|
|
with `' AT28! A!* !`.
|
2019-06-15 04:15:30 +10:00
|
|
|
|
2020-09-18 03:27:12 +10:00
|
|
|
Then, upload your binary to EEPROM with:
|
2019-06-15 04:15:30 +10:00
|
|
|
|
2020-09-18 03:27:12 +10:00
|
|
|
./upload <tty device> 2000 <filename>
|