Adding DS1996 support to Flipper seems to be a good idea and should not take much effort. Emulation is also suggested.
Quick overview of DS1996 (header 0x0C) and it’s uses:
DS1996 is an iButton with 64kbits (8KBytes) of EEPROM storage (256 pages, each 32 bytes). One of the primary uses for DS1996 (in Russia) is for data transfer between systems. In the case of a system being replaced, moving data to a DS1996 is available in the case of the memory chip on the PCB not being readable (example: ELTIS DP-3/4XX, EEPROM fuse bits are locked from factory). Having the ability to read (or even have) a DS1996 chip is unlikely due to the rarity and high prices compared to other iButton devices (on average $15-$25 compared to $0.5 (DS1990A)).
Adding the format:
This message contains a datasheet for the DS1996 chip: DS1996.pdf (466.4 KB). The main point is the command 0xF0 (Read memory) which takes 2 arguments: offset and address to read from.
An example memory read will look like:
TX R //reset pulse
RX P //device responds
TX CC //0xCC command means “Skip ROM (serial number)”
TX F0 //0xF0 as stated is Read Memory
TX 00 //0x00 - Page offset is 0/F (one offset is 2 bytes long)
TX 00 //0x00 - Page number is 0/FF
RX [MEM, 8KB]
The read memory can be then either be sent to a PC in the form of a .bin or saved on the SD for later use.
Emulation of DS1996, while possible, is difficult. DS1996 has a “scratchpad”, which can be referred to as “RAM” of its kind. Data that will be written to the EEPROM must be first written to the scratchpad, and only then from the scratchpad to the memory. Scratchpad interaction has 3 commands: 0F (write scratchpad); AA (read scratchpad); 55 (copy scratchpad to memory).
An example write to the 167/256th page, bytes 3 and 4 should look like (addr 14C1/1FEF):
TX C1 //Offset 1/F. I did not understand this part in the datasheet, someone please correct me
TX 14 //Page 166/255 (0-255).
TX 3A44 //Send data, 2 bytes
TX AA //Obtain the necessary end+flag data to run 0x55 command
RX 02 //This should be right. This is the end and flags information that the DS1996 chip sends which we have to use later.
RX 3A44 //The AA command can also be used for verification.
TX 55 //Copy scratchpad to memory
TX C1 //Transmit offset
TX 14 //Transmit page offset
TX 02 //Transmit end+flags
Memory can be read for verification with the F0 command: F0 C1 14.
Waiting to hear your opinion on this idea.