Hello,
some days ago I had an idea how to add support for writing PDK files (from padauk IDE).
The padauk IDE inserts code that makes a call to almost the end of the IC code memory (e.g. call 0x7FE on PFS154).
If the returned value is 0xFF (ret 0xFF), the calibration code for IHRC is executed.
After WRITER completes the IHRC calibration, it overwrites the return value 0xFF with the calibration value.
The next time IC is started, the same call returns the calibration value, which is then written to IHRCR.
The idea that simplifies PDK support for easypdkprog is that instead of running the complex padauk calibration code, the default easypdk calibration code is embedded and instead of the instruction returning the calibration value, a GOTO to the easypdk calibration code is inserted. This only requires space for 13 additional instructions, which most projects can afford.
The development branch contains an initial implementation that already works very well for all ICs I have tested. The "write" command supports IHX and PDK files now. Even serial numbers (32 bit only) can be set.
For the other direction SDCC .IHX file => usable with padauk IDE I will try a different approach. Instead of converting the .IHX to .PDK, I plan to convert the .IHX to padauk IDE .ASM code (with embedded comments containing original SDCC .C source lines). This converted .ASM code can then be used in padauk IDE to generate PDK files and is also usable with the padauk ICE (padauk emulator).
JS