mat079, sent to PM, please check.
unknown opcodes (0x01, 0x02, 0x06, 0x07)
0x01 - latch data to buffer
0x02 - start erase of selected area
0x06 - start write from buffer to selected area
0x07 - end write or erase (disable HV)
But it's much, much more complicated than just these opcodes.
For example, there is SFR read operation (some hi-level functions are made over SFR access):
function FMD_SEND_READ_SFR_Single(iclist: byte; Addr: word): byte; // +5.3.6.9
begin
//set page?
case iclist of
1..7,9..12,20..23,25..27,45,51,52,56,59,60,62,64..70,74,78,82:
begin
if Addr SHR 8 = 0
then FMD_SEND_A24_91A_OR_9FA_8R0_6(iclist,0)
else FMD_SEND_A24_91A_OR_9FA_8R0_6(iclist,$40);
end;
8,13..19,28..44,46,47,55,61,63,71:
FMD_SEND_A24_9FB_8R0_6(Addr SHR 7);
//NEW 13, 19,21
24,73,75,76, 79,81,83..85,87,88:
FMD_SEND_A24_91A_OR_9FA_8R0_6(iclist,Hi(Addr) SHL 6);
72,77,80,86:
FMD_SEND_A51_9R0_8R1_6($F3,Hi(Addr));
end;
//read SFR
FMD_op_write($A,$52);
FMD_op_write($9,Lo(Addr));
result := FMD_op_read($D);
end; protocol timing isn't ultra-critical
Time-critical is only enter programming mode part. For it must be used HW delay routine. Software delays on PC-side have not enough accuracy.
Communication speed I've tested from 20 to 500 kHz. Selectable in software.
package your findings into a simple Python script or an Arduino library
Was made ready-to-use application instead. Not open-sourced, but free.
Some people (from this thread too) test and use it.
Added some functions, that are not present in original FMDProgrammer (detect of unknown MCU, FCFG operations)
FMD MCU support was made for next HW: CH341, FT232H, FX2LP, PostalAVR, CH552 (EZP20xx/MinProI).
Change log, with FMD-related positions only:
v 0.9.3.0
- [CH341A]: add FMD 8-bit MCU support (Fremont Micro Devices, Origin-gd Tech)
v 0.9.4.1
- [FMD]: test support for F-18 Series (FT62F0Gx, FT62F0Cx)
- [FMD]: get Delays from MCU, other minor changes
v 0.9.4.2
- [FMD]: add new MCUs from FMDProgrammer 5.3.6.9 (need test)
- [FMD]: add one more byte for ICID check
v 0.9.6.3
- [FX2LP]: add support for FMD and S3F MCUs
v 0.9.6.7
- [PostalAVR]: add Nuvoton, FMD and S3F 8-bit MCU support
- add invert options for VDD and VPP control pins
v 0.9.6.8
- [FT232H]: add AVR, Nuvoton, FMD and S3F 8-bit MCU support
- [FMD]: add 'Locked' warning at UCFG read
- fixed bug with Blank Check in auto-write mode
v 0.9.7.1
- [CH55x]: new FW, added all supported functions
- [FMD]: speed up and clock selection (PICWriteRead rework)
- [FMD]: add Read/Erase/Write of FCFG area (service)
- [FMD]: add FCFG CheckSumm check and update
- [FMD]: add manual Fosc calibration
- [FMD]: FCFG backup/verify/restore at Erase/Write
v 0.9.7.2
- [FMD]: fixed bug in UCFG area read for FT61F08x/FT62F08x