Apparently, Grigori lost interest in stcgal beginning of 2021.
The problem is that we can't use stcgal with recent MCU (STC8G & STC8H).

CreativeLau has submitted a pull request solving this issue in July 
2021, but it still hasn't been merged as of June 2022.
Instead, Grigori blacklisted the SCT8G to avoid bricking them. :(

It's a pity since merging CreativeLau's pull request would solve issues
related to STC8G and STC8H, which use the same protocol as the 
STCA8K64D4.

IOSetting created a new utility in December 2021, stc8prog, but it's 
also a pity since it loses a lot of functionalities available in stcgal.

This is why I decided to patch stcgal with CreativeLau's changes and 
make it available here, in the hope it could help other STC fans.

For what it's worth, I've successfully (and repeatedly) tested this 
patched stcgal with the following MCU:

    STC90C58RD+-40C-PDIP40  (with 11.0952 MHz crystal)
    
    STC12C5A56S2-35I-PDIP40 (with 11.0952 MHz crystal)
    
    STC15W408AS-35I-DIP16
    STC15W408AS-35I-SKDIP28
    STC15W4K32S4-30I-PDIP40
    
    STC8A8K64S4A12-28I-LQFP48
    STC8A8K64D4-45I-LQFP48
    
    STC8G1K08-38I-TSSOP20
    STC8G1K17-38I-DIP16
    STC8G1K08A-36I-DIP8
    STC8G2K64S4-36I-LQFP48
    
    STC8H1K08-36I-TSSOP20
    STC8H1K28-36I-TSSOP20
    STC8H3K64S2-45I-TSSOP20
    STC8H3K64S4-45I-LQFP32
    STC8H4K64TL-45I-TSSOP20
    STC8H4K64TL-45I-LQFP32
    STC8H8K64U-45I-PDIP40

    STC32G12K128-Beta-PDIP40

I also tested the STC16F40K128-36I-LQFP64 and found it uses a different
protocol, so it is NOT supported yet.

While I was at it, I also made a few improvements:

- a new command line option to use either DTR or RTS for automatic
power cycling (allows for instance to use an 8-pin CH340N to build 
an automatic programmer)

- an update using the MCU list from stc-isp-v6.89G.exe, which includes 
nice chips such as the STC16 and STC32

- I replaced dump-mcu.py with a more reverse-engineering beginner-friendly
dump-mcu.c which handles everything for you. Just provide the path to 
the executable of STC-ISP as command-line argument and it will spit out
all the MCUModel definitions on its standard output.

- I found the meaning of a few STC-ISP flags, so I added them to the
MCUModel collection. One of them indicates if the MCU has a configurable
EEPROM start address, convenienty replacing the old "IAP" MCU name list.

- Because all tested MCU - STC12 to STC32G! - support dowloading at 
115200 Baud, I changed default values of -l and -b to use this 
transmission rate. When programming older MCU (e.g. STC90), you'll 
have to add the following options to the command line: -l 2400 -b 19200

I can be reached at: vincent -DOT- defert -AT- posteo -DOT- net.

Note: I've rename the original README.md to README.md.stcgal so that 
github displays up-to-date information when accessing the repository.

References:

    https://github.com/grigorig/stcgal/pull/71
    https://github.com/grigorig/stcgal/issues/63
    https://github.com/grigorig/stcgal/issues/67
    https://github.com/IOsetting/stc8prog

>>> For Linux users
------------------------------------------------------------------------

Linux users who have already installed stcgal can upgrade it by cloning 
this repository and issuing the following commands as root:

cp stcgal-patched/stcgal/*.py /usr/lib/python3.XX/site-packages/stcgal/
rm -rf /usr/lib/python3.XX/site-packages/stcgal/__pycache__

Note: replace XX in python3.XX with the minor version number given by
python --version


>>> Below is the comment in CreativeLau's pull request
------------------------------------------------------------------------

The calibrate process of new serial STC8A8K64D4 is different. 
In version 1.6 the MCU frequency could be adjusted up to 4 MHz only.

Have done:

1.  Add 'stc8d' in option -P for STC8A8K64D4.

2.  Add subclass Stc8dProtocol(Stc8Protocol).

3.  Add override methods, choose_range, choose_trim, calibrate and 
    build_options.
    
4.  The download baud up to 460800 (should add the 460800 to the 
    definition of BAUDRATES in serial lib which is always in the 
    local disk)
    
    To use:
    
    Set stc8d for option -P. The frequency could be adjusted from 
    1 to 45 MHz. Pay attention to the unit of frequency is kHz.

To do:

The program_mcu method did not consider that the EEPROM in some serial 
could be adjusted. The EEPROM content could not be downloaded correctly, 
when user set the option program_eeprom_split, and give a EEPROM larger 
than 512 Bytes.
