Contributed by Maciek / Maciej Sees [e-mail | facebook]
I have had a CD32 since 1993, and am interested in any interesting facts about this console. Recently, I managed to modify nonvolatile.library
so that it supports 2 kB memory instead of 1 kB, and at the same time I discovered an error in this library causing problems in the use of currently-produced EEPROM memories. In fact, the original Atmel memory or the currently-produced Cypress FRAM memory compatible with I2C EEPROM memories working correctly.
There is only one quite important issue, in my opinion: All newer libraries, such as: 40.35 or 40.36, no longer support EEPROM memory, in my opinion, the I2C program protocol has been removed from these libraries and they only support writing to mass storage memory (FDD, HDD).
The only library that supports EEPROM memory is the library from Kickstart 40.60, i.e. nonvolatile.library
40.31.
As for the error that causes problems with writing to currently-produced EEPROM memories, it is a short waiting time for writing to the memory. By default, this time is about 5 ms, in the library this time is set to about 700 us, the library, if there is no confirmation with the ACK signal, tries to start another transmission twice, but only waits for about 500 us. By a strange coincidence, the Atmel E3 AT24C08N EEPROM from 1993 that was installed in CD32 is resistant to this error, although this is an undocumented feature. Currently-produced Atmel AT24C08N memory no longer works properly with CD32. However, remember that the save error does not occur in all games. Games that save data in one long block work correctly, but games such as Cannon Fodder cannot save at all; Subwar 2050 can only save the configuration, but does not save the pilots and their achievements. All games can read game states because there is no need to pause 5 ms at the end of the block when reading.
The way around this problem is to install FRAM memory, which has a write time of one clock cycle, which means that the write is practically instantaneous.
In the disassembled code of the nonvolatile.library
version 40.31 along with my notes and changes, not all notes may make sense :), but I am not a programmer; just an electronics technician and understanding the code in assembly language is very difficult for me.
The original memory in CD32 is EEPROM and for reasons unknown to me it works, I can only suspect that this memory, even though it enters the mode of storing information in memory cells, confirms the start of the next data transmission with an ACK signal, or after the first data block that should be persisted, it needs a longer time than 700us to enter the write mode and confirms the start of the next data block with ACK, and the data write/persist mode only enters after receiving the entire transmission.
Modern EEPROM memories from ATMEL or STMicroelectronics do not behave this way and the transmission process is interrupted.
The FRAM memory that fits one to one is FM24C16B from Cypress. It is 2 kB memory, but it can be used without problems in the CD32 with the original Kickstart supporting only 1 kB—the second page of the memory will not be used.
Since it is very difficult to modify the nonvolatile library to support more than 2 kB of memory, I made a switch for five 2 kB memories, this also has the advantage that we can allocate separate memory for the Cannon Fodder game, because this game can overwrite the saves of other games, even if they have "lock" tag.
FRAM memories are mounted on the board, one on top of the other, you can also see the DIL08 socket installed for testing purposes.
[Re: developer removal of support for EEPROM in nonvolatile.library] It's hard to say—maybe they wanted to move the I2C protocol support to another library? Maybe they decided that the future would be to move away from EEPROM memory and that CD32 would be expanded with a floppy drive/hard disk and then EEPROM would not be needed? It's hard for me to understand, but I think there were more ideas like this that I don't understand. :)