stcdude 0.1-rc1 is here.

Well, that was fun, and I can now finally show off with the first release of the stcdude.
stcdude is an opensource ISP programmer for the STC microcontrollers designed to run under linux from commandline. A long awaited sane replacement for the retarted STC ISP Tool written in VB6.
Finally you can get on with the development using the tools you like: sdcc and make.


Don’t expect too much, since the implementation is pretty raw right now. So, what’s inside?

The good:

  • Lua-scripted xfer scenarios with a simple API. Easy to extend.
  • Detection of the mcu and matching it against the MCU database is working.
  • For supported series you’ll instantly get information like iram/xram/irom sizes, description, mcu clock frequency and bootloader version. Just like the stock ISP tool.

The bad:

    Since the baudrate switching involved is still somewhat a mystery right now, it ONLY works with a 12 Mhz quartz. Well, not a complete mystery, but it’s hardcoded right now. Sorry.
    Implemented in trunk. 3 bytes are still unknown, so not all baudrate/frequency combinations work

  • Setting the MCU options is NOT supported yet. You’ll still need the stock ISP software to do so.
  • The last ‘encrypt’ step is omitted. I’ve got no clue what it does (lock the flash?), but it works without it.

The ugly:

  • A lot of warnings that need to be nuked later.
  • Hacky in places

TODO:

  • Proper baudrate settings.
  • More mcudb files
  • Test other series

Compilation & installation:

git clone git://github.com/nekromant/stcdude.git
cd stcdude
autoreconf --install --force 
./configure 
make
sudo make install

Obligatory cmdline output:

[necromant@ilwyn stcmake]$ sudo make stcdude 
stcdude -p "/dev/ttyUSB0" 
-b 1200:57600 
-a wflash -f main.bin
STC ISP Tool. (c) Necromant 2012
lines 66
columns 271
Loading lua script: /usr/local/share/stcdude/lua/init.lua
Using /dev/ttyUSB0 @ 1200
fd is 3
Running sequence wflash
Trying mcudb stc10fx.lua
Trying mcudb stc12x.lua
MCU DB information
Part name:       STC12C5A60S2
Magic bytes:     D17E
IRAM size:       256 (0x100) bytes
XRAM size:       1024 (0x400) bytes
IROM size:       61440 (0xf000) bytes
Tested ops: FixMe: implement reading of tested ops
Description:
        8051-based microcontroller with 1T(1-clock) High-Speed Core,
        Dual DPTR, 36-44 I/O Lines, 2 Timers/Counters, 2 PCA Timers,
        Alternative build-in oscillator,
        Independent Baud Rate Generator, Programmable Clock-Out,
        60K bytes flash ROM, 1280 bytes data RAM,
        On-chip EEPROM, 2 UARTs, WDT, ISP/IAP, A/D, CCP/PWMl
MCU Options information:
MCU Clock: 12.039340 Mhz (5827.375000 raw)
Bootloader version: 6.2I
Performing baudswitch dance
Baudrate switch to 57600
Baudrate switch to 1200
Baudrate switch to 57600
Erasing mcu flash...
Downloading main.bin (1889 bytes)
 100 % done | #####################################################| 1 K

And now, even more goodies. I’ve got 2 pills for you:
The blue pill: The Makefile blinky temple
The red pill: Antares Project example for STC

17 thoughts on “stcdude 0.1-rc1 is here.

  1. —QUOTE——
    Since the baudrate switching involved is still somewhat a mystery right now, it ONLY works with a 12 Mhz quartz. Well, not a complete mystery, but it’s hardcoded right now. Sorry.
    Implemented in trunk. 3 bytes are still unknown, so not all baudrate/frequency combinations work

    Setting the MCU options is NOT supported yet. You’ll still need the stock ISP software to do so.
    The last ‘encrypt’ step is omitted. I’ve got no clue what it does (lock the flash?), but it works without it.
    ——QUOTE————-
    发送数据 8F xx yy zz aa dd ee

    xx= ab00 0000
    a=T1x12
    b=Double baudrate

    yy is Reload value for BRT

    zz is Setting check sum.(zz=~xx)

    aa is Reload check sum ,aa=2 * (0×100 -yy)

    dd is Delay value.to change MCU ;’s delay time

    ee is IAP timer.In fact,use 0x83.
    Wan Zhi Yuan

  2. By the way.
    MCU model number(magic number) format:
    I write a program on BASIC to parse the model:
    PUBLIC FUNCTION GetMCUType(Model AS Byte, Size AS Byte) AS String
    DIM tempStr AS String
    DIM v AS Byte
    DIM iapF AS Boolean
    iapF = FALSE
    IF BTst(Size, 0) THEN
    tempStr = “IAP”
    iapF = TRUE
    ELSE
    tempStr = “STC”
    END IF
    SELECT CASE (Model)
    CASE &HD1 ‘0xD1
    tempStr = tempStr & “12”
    END SELECT

    IF BTst(Size, 7) THEN
    tempStr = tempStr & “LE5A”
    ELSE
    tempStr = tempStr & “C5A”
    END IF
    v = Lsr(&H1E AND Size, 1)
    IF iapF THEN
    tempStr = tempStr & “62”
    ELSE
    IF V > 9 THEN
    tempStr = tempStr & Str(v * 4)
    ELSE
    tempStr = tempStr & “0” & Str(v * 4)
    END IF
    END IF
    IF BTst(Size, 6) AND BTst(Size, 5) THEN
    tempStr = tempStr & “S2” ‘S2
    ELSE IF BTst(Size, 6) = TRUE AND BTst(Size, 5) = FALSE THEN
    tempStr = tempStr & “AD” ‘AD
    ELSE IF BTst(Size, 6) = FALSE AND BTst(Size, 5) = FALSE THEN
    tempStr = tempStr & “X” ‘X
    ELSE
    tempStr = tempStr & “CCP” ‘CCP
    END IF
    RETURN tempStr
    END

  3. oh by the way.STC hasn’t encode…
    because ISP protocol is DISABLE to read.

  4. I decode the STC protocol is using Virtual Box and USB to RS232 bridge PL-2303.and a Saleae Logic Analyzer

  5. typical payload: 8F C0F3 3F1A 2883

    8F – packet type?
    C0 – PCON value, sets SMOD bits.
    F3 – Sets the actual new baudrate
    3F – checksum of PCON and AUXR value(=~0xC0)
    28 – Switch to new baudrate ‘s delay time
    83 – IAP Timer

    By the way,0x68/0x6A,0x00 it is means IDENT.Length is only 1 byte long.
    I think STC frame format is :
    |46 B9|68/6A 00|length|command|checksum|0x16

  6. I want to tell you I have been to build kSTC-ISP on GUI.using GAMBAS.
    Here is my software UART message:
    调试区域 如果有BUG可以从这里提取信息
    反馈给我:dv.xw@qq.com OR
    562467068 OR rwzy.co.cc
    端口打开,波特率:2400,1,COM1
    —-开始发送开启帧—–
    —–开启帧停止——-
    接收:46 B9 68 00 31 50 0A 6F 0A 83 0A 6E 0A 83 0A 6F 0A 83 0A 6F 0A 82 62 49 00 D1 7E 8C FF 7F F7 FF FF FF 00 00 00 03 00 9A 04 79 1A 00 AD FF 00 00 0F D7 16
    MCU特征字:D1 7E
    发送:46 B9 6A 00 0D 50 07 00 36 01 D1 7E 02 54 16
    接收:46 B9 68 00 07 8F 00 FE 16
    错误率:0.04%,重载值:0xFD
    IAP定时值:83
    发送:46 B9 6A 00 0D 8F C0 FD 3F 06 AA 83 04 35 16
    COM1关闭
    端口打开,波特率:230400,1 COM2
    接收:46 B9 68 00 0E 8F C0 FD 3F 06 AA 83 04 04 38 16
    COM2关闭
    端口打开,波特率:2400,1,COM1
    发送:46 B9 6A 00 0D 8E C0 FD 3F 06 AA 83 04 34 16
    COM1关闭
    端口打开,波特率:230400,1 COM2
    接收:46 B9 68 00 0E 84 C0 FD 3F 06 AA 83 04 04 2D 16
    发送:46 B9 6A 00 8C 84 FF 00 F0 00 00 F0 00 00 00 00 00 00 00 00 00 00 00 00 80 7F 7E 7D 7C 7B 7A 79 78 77 76 75 74 73 72 71 70 6F 6E 6D 6C 6B 6A 69 68 67 66 65 64 63 62 61 60 5F 5E 5D 5C 5B 5A 59 58 57 56 55 54 53 52 51 50 4F 4E 4D 4C 4B 4A 49 48 47 46 45 44 43 42 41 40 3F 3E 3D 3C 3B 3A 39 38 37 36 35 34 33 32 31 30 2F 2E 2D 2C 2B 2A 29 28 27 26 25 24 23 22 21 20 1F 1E 1D 1C 1B 1A 19 18 17 16 15 14 13 12 11 10 0F 0E 24 3E 16
    接收:46 B9 68 00 07 00 00 6F 16
    发送:46 B9 6A 00 8D 00 00 00 00 00 00 80 02 00 0B 12 02 B1 02 00 06 E4 73 75 81 7E 02 00 11 E4 78 FF F6 D8 FD E4 75 0C 00 02 00 03 E5 82 FF 24 FA 40 32 EF 2F 2F 90 00 2C 73 02 00 3E 02 00 57 02 00 43 02 00 48 02 00 4D 02 00 52 12 0E F0 80 1A 12 07 5B 80 15 12 11 5A 80 10 12 13 61 80 0B 12 14 4F 80 06 75 23 FF 02 04 5B 02 04 5B AE 59 AF 5A C0 07 C0 06 8E 82 8F 83 12 00 09 D0 06 D0 07 75 22 AB 12 04 5B E4 F5 53 F5 54 F5 55 2A 1A 16
    接收:46 B9 68 00 08 00 A3 01 13 16
    发送:46 B9 6A 00 8D 00 00 00 00 80 00 80 F5 56 12 04 05 40 03 02 01 3A E5 22 C4 54 0F F5 68 70 03 02 01 12 7E 00 C3 EE 95 68 50 74 AC 5F AD 60 EE C4 54 F0 24 02 24 21 FA 7B 00 7F 40 C0 06 C0 05 C0 04 74 C8 C0 E0 74 00 C0 E0 C0 04 C0 05 8A 82 8B 83 8F F0 22 D0 04 D0 05 D0 06 92 00 40 27 AD 65 AF 66 C0 07 C0 06 C0 05 8D 82 8F 83 12 00 09 D0 05 D0 06 D0 07 75 21 FF 75 22 00 75 23 00 C0 06 12 04 5B D0 06 74 10 25 53 F5 53 E4 34 B8 16
    接收:46 B9 68 00 08 00 C1 01 31 16
    发送:46 B9 6A 00 8D 00 00 00 01 00 00 80 35 54 F5 54 E4 35 55 F5 55 E4 35 56 F5 56 0E 02 00 98 74 FD 25 68 40 19 AE 65 AF 66 C0 07 C0 06 8E 82 8F 83 12 00 09 D0 06 D0 07 75 23 FA 02 04 5B 75 23 00 12 04 5B 02 00 82 AE 65 AF 66 C0 07 C0 06 8E 82 8F 83 12 00 09 D0 06 D0 07 75 21 FF 75 22 00 75 23 00 02 04 5B E4 F5 53 F5 54 F5 55 F5 56 AE 59 AF 5A C0 07 C0 06 8E 82 8F 83 12 00 09 D0 06 D0 07 12 04 5B 12 03 BD 40 03 02 02 56 31 0F 16
    接收:46 B9 68 00 08 00 97 01 07 16
    发送:46 B9 6A 00 8D 00 00 00 01 80 00 80 AF 21 BF FF 03 02 02 56 BF 55 18 E5 53 24 D0 F5 53 E5 54 34 FF F5 54 E5 55 34 FF F5 55 E5 56 34 FF F5 56 AE 61 AF 62 C0 07 C0 06 74 BE C0 E0 74 01 C0 E0 C0 06 C0 07 90 00 23 75 F0 40 22 D0 06 D0 07 74 10 25 53 F5 53 E4 35 54 F5 54 E4 35 55 F5 55 E4 35 56 F5 56 7F 10 E5 22 60 71 AD 61 AE 62 C0 06 C0 05 74 F8 C0 E0 74 01 C0 E0 C0 05 C0 06 90 00 33 75 F0 40 22 D0 05 D0 06 74 10 25 53 3F 49 16
    接收:46 B9 68 00 08 00 51 00 C1 16
    发送:46 B9 6A 00 8D 00 00 00 02 00 00 80 F5 53 E4 35 54 F5 54 E4 35 55 F5 55 E4 35 56 F5 56 7F 20 74 02 B5 22 36 AD 61 AE 62 C0 06 C0 05 74 33 C0 E0 74 02 C0 E0 C0 05 C0 06 90 00 43 75 F0 40 22 D0 05 D0 06 74 10 25 53 F5 53 E4 35 54 F5 54 E4 35 55 F5 55 E4 35 56 F5 56 7F 30 8F 22 12 04 6D 02 01 78 AE 65 AF 66 C0 07 C0 06 8E 82 8F 83 12 00 09 D0 06 D0 07 75 21 7F 02 04 5B AE 5D AF 5E C0 07 C0 06 8E 82 8F 83 12 00 09 D0 06 37 78 16
    接收:46 B9 68 00 08 00 FF 01 6F 16
    发送:46 B9 6A 00 8D 00 00 00 02 80 00 80 D0 07 02 04 5B AE 5B AF 5C C0 07 C0 06 8E 82 8F 83 12 00 09 D0 06 D0 07 02 04 6D AE 63 AF 64 C0 07 C0 06 8E 82 8F 83 12 00 09 D0 06 D0 07 02 04 5B 90 07 D0 12 03 96 12 03 71 12 03 79 75 98 50 75 A8 00 75 89 21 75 8E 40 75 8D FD 75 8B FD D2 8E 43 87 80 75 80 FF D2 B4 C2 B4 75 21 7F 75 22 00 75 23 00 12 04 5B 75 82 00 12 00 1E 12 03 BD 92 01 E4 33 FF BF 01 F5 AF 21 BF 00 02 80 28 BF 32 C7 16
    接收:46 B9 68 00 08 00 CE 01 3E 16
    发送:46 B9 6A 00 8D 00 00 00 03 00 00 80 01 02 80 2B BF 02 02 80 2B BF 03 02 80 2B BF 04 02 80 2B BF 05 02 80 2B BF 06 02 80 2B BF 7F 02 80 2E BF 89 3B 80 2E 85 22 82 12 00 1E 80 BE 12 00 60 80 B9 12 01 59 80 B4 12 02 6F 80 AF 12 02 85 80 AA 12 02 9B 80 A5 12 04 5B 12 04 87 80 9D 12 04 5B 80 98 75 22 00 75 23 06 12 04 5B 80 8D 75 22 FF 75 23 FF 12 04 5B 02 02 ED D2 80 C2 B7 22 D2 B7 22 C2 B2 D2 B3 22 D2 B2 D2 B3 22 D2 B2 2F FA 16
    接收:46 B9 68 00 08 00 80 00 F0 16
    发送:46 B9 6A 00 8D 00 00 00 03 80 00 80 C2 B3 22 AF 82 75 8C 00 75 8A 00 D2 8C C3 E5 8A 9F 40 FA C2 8C 22 AE 82 AF 83 D2 8C 7C 00 7D 00 C3 EC 9E ED 9F 50 13 75 8C 00 75 8A 14 74 FC 25 8C 50 FA 0C BC 00 E9 0D 80 E6 C2 8C 22 C2 98 30 98 FD 85 99 21 C2 98 7F 01 EF 24 FD 40 35 E4 F5 57 F5 58 20 98 22 05 57 E4 B5 57 02 05 58 AB 57 AC 58 7D 00 7E 00 C3 EB 94 60 EC 94 EA ED 94 00 EE 64 80 94 80 40 DC 22 EF 24 21 F8 A6 99 C2 98 42 D9 16
    接收:46 B9 68 00 08 00 DF 01 4F 16
    发送:46 B9 6A 00 8D 00 00 00 04 00 00 80 0F 80 C6 D3 22 C2 93 7F 00 EF 24 CE 40 41 E4 F5 57 F5 58 20 98 2E 05 57 E4 B5 57 02 05 58 C0 07 12 04 85 D0 07 AB 57 AC 58 7D 00 7E 00 C3 74 60 9B 74 EA 9C E4 9D E4 64 80 8E F0 63 F0 80 95 F0 50 D1 C3 22 EF 24 21 F8 A6 99 C2 98 0F 80 BA D3 22 AF 82 C2 99 8F 99 30 99 FD 22 85 21 82 12 04 51 85 22 82 12 04 51 85 23 82 02 04 51 7F 00 EF 24 CE 40 10 EF 24 21 F9 87 82 C0 07 12 04 51 D0 3B B7 16
    接收:46 B9 68 00 08 00 3C 00 AC 16
    发送:46 B9 6A 00 8D 00 00 00 04 80 00 80 07 0F 80 EB 22 00 22 12 03 BD 50 FB 74 06 B5 21 02 80 08 75 22 FF 12 04 5B 80 EC AF 22 BF 00 02 80 44 BF 01 02 80 4A BF 02 02 80 50 BF 03 02 80 5B BF 04 02 80 62 BF 05 02 80 66 BF 06 02 80 6A BF 07 02 80 6E BF 08 02 80 72 BF 09 02 80 76 BF 7F 03 02 05 5E BF FF 02 80 03 02 05 67 75 21 7F 75 22 00 02 04 5B 85 23 90 75 23 00 12 04 5B 80 96 85 23 80 75 23 00 12 04 5B 80 8B D2 B4 85 23 2B 98 16
    接收:46 B9 68 00 08 00 9D 01 0D 16
    发送:46 B9 6A 00 8D 00 00 00 05 00 00 80 80 C2 B4 75 23 00 12 04 5B 02 04 87 85 23 A0 75 23 00 12 04 5B 02 04 87 12 03 6C 12 04 5B 02 04 87 12 03 71 12 04 5B 02 04 87 12 03 74 12 04 5B 02 04 87 12 03 79 12 04 5B 02 04 87 12 03 7E 12 04 5B 02 04 87 E5 23 23 54 01 24 FF 92 B5 E5 23 23 23 54 01 24 FF 92 B6 12 04 5B 02 04 87 75 23 FF 12 04 5B 02 04 87 75 22 FF 75 23 FF 12 04 5B 02 04 87 12 03 79 C2 B5 75 80 FF 75 90 FF 75 A0 26 55 16
    接收:46 B9 68 00 08 00 D9 01 49 16
    发送:46 B9 6A 00 8D 00 00 00 05 80 00 80 FF 90 00 0A 12 03 96 C2 85 D2 86 D2 87 D2 B5 90 00 0A 12 03 96 E4 F5 53 F5 54 F5 55 F5 56 75 69 AC 75 6A 53 75 6B 00 75 6C 00 75 82 04 02 11 86 12 03 79 75 80 FF 75 90 FF 75 A0 FF C2 B5 22 AE 82 AF 83 75 69 20 8F 05 8D 04 8C 6A 8E 6B 75 82 04 12 11 86 85 71 82 22 AD 82 AE 83 AF F0 A9 53 AA 54 7C 10 89 03 8B 82 8A 83 C0 07 C0 06 C0 05 C0 04 C0 03 C0 02 12 05 BF A9 82 D0 02 D0 03 D0 3B 40 16
    接收:46 B9 68 00 08 00 44 00 B4 16
    发送:46 B9 6A 00 8D 00 00 00 06 00 00 80 04 D0 05 D0 06 D0 07 8D 82 8E 83 8F F0 E9 12 14 7E A3 AD 82 AE 83 0B BB 00 01 0A 8C 01 19 89 04 EC 70 C3 22 12 05 73 75 69 28 75 6A 00 75 6B 00 75 6C 00 75 82 04 12 11 86 85 71 23 75 6A 01 75 82 04 12 11 86 85 71 24 75 6A 02 75 82 04 12 11 86 85 71 25 02 05 B0 12 05 73 75 69 AC 75 6A 80 75 82 04 12 11 86 90 01 F4 12 03 96 02 05 B0 AD 82 AE 83 AF F0 AB 53 AC 54 8D 09 8E 0A 8F 0B 75 2F 91 16
    接收:46 B9 68 00 08 00 14 00 84 16
    发送:46 B9 6A 00 8D 00 00 00 06 80 00 80 08 00 74 F0 25 08 50 03 02 07 06 75 69 40 8C 07 8F 02 8A 6A 8B 06 8E 6B 85 09 82 85 0A 83 85 0B F0 12 14 97 FF 8F 6C 75 82 04 C0 04 C0 03 12 11 86 D0 03 D0 04 E4 F5 57 F5 58 8B 82 8C 83 C0 04 C0 03 12 05 BF AF 82 D0 03 D0 04 85 09 82 85 0A 83 85 0B F0 12 14 97 FE EF B5 06 02 80 16 C3 E5 57 94 30 E5 58 94 75 40 01 22 05 57 E4 B5 57 CA 05 58 80 C6 0B BB 00 01 0C 05 09 E4 B5 09 02 05 32 FF 16
    接收:46 B9 68 00 08 00 02 00 72 16
    发送:46 B9 6A 00 8D 00 00 00 07 00 00 80 0A 05 08 02 06 82 D3 22 74 FF 25 23 50 15 12 05 73 75 69 AC 75 6A E1 75 82 04 12 11 86 90 00 01 12 03 96 74 FE 25 23 50 15 12 05 73 75 69 AC 75 6A E2 75 82 04 12 11 86 90 00 01 12 03 96 74 03 B5 23 15 12 05 73 75 69 AC 75 6A E3 75 82 04 12 11 86 90 00 01 12 03 96 02 05 B0 75 59 73 75 5A 05 75 5B 24 75 5C 06 75 5D 57 75 5E 06 78 5F 76 6F 08 76 06 75 61 D8 75 62 05 75 63 08 75 64 07 29 F9 16
    接收:46 B9 68 00 08 00 7B 00 EB 16
    发送:46 B9 6A 00 8D 00 00 00 07 80 00 80 75 65 B0 75 66 05 22 7F 04 DF FE 22 D2 92 D2 91 12 07 87 C2 92 12 07 87 C2 91 02 07 87 C2 91 C2 92 12 07 87 D2 91 12 07 87 D2 92 02 07 87 C2 92 D2 91 12 07 87 C2 91 22 D2 92 D2 91 12 07 87 C2 91 22 D2 92 D2 91 12 07 87 A2 92 92 D5 12 07 87 C2 91 12 07 87 30 D5 04 75 82 00 22 75 82 01 22 AF 82 7E 00 BE 08 00 50 32 8F 04 7D 00 8E F0 05 F0 80 06 EC 2C FC ED 33 FD D5 F0 F7 EC 30 E7 0D 3A FE 16
    接收:46 B9 68 00 08 00 00 00 70 16
    发送:46 B9 6A 00 8D 00 00 00 08 00 00 80 C0 07 C0 06 12 07 B8 D0 06 D0 07 80 0B C0 07 C0 06 12 07 AE D0 06 D0 07 0E 80 C9 22 7F 00 7E 00 BE 08 00 50 1E EF 2F FF D2 92 D2 91 7D 04 DD FE A2 92 92 D5 7D 04 DD FE C2 91 30 D5 03 43 07 01 0E 80 DD 8F 82 22 AF 82 C0 07 12 07 8C D0 07 74 FE 5F F5 82 C0 07 12 07 E0 12 07 C2 E5 82 D0 07 70 05 12 07 9D C3 22 20 02 0C 85 0D 82 C0 07 12 07 E0 D0 07 80 22 AE 0E 8E 82 C0 07 12 07 E0 12 34 F9 16
    接收:46 B9 68 00 08 00 7A 00 EA 16
    发送:46 B9 6A 00 8D 00 00 00 08 80 00 80 07 C2 E5 82 D0 07 70 05 12 07 9D C3 22 AD 0D 8D 82 C0 07 12 07 E0 D0 07 C0 07 12 07 C2 E5 82 D0 07 70 05 12 07 9D C3 22 74 01 5F FE BE 01 02 80 03 02 09 5B AC 0F AD 10 AE 11 8C 82 8D 83 8E F0 74 FF 12 14 7E C0 07 C0 06 C0 05 C0 04 12 07 8C D0 04 D0 05 D0 06 D0 07 8F 82 C0 06 C0 05 C0 04 12 07 E0 12 07 C2 E5 82 D0 04 D0 05 D0 06 70 05 12 07 9D C3 22 C0 06 C0 05 C0 04 12 08 1C AF 82 32 BD 16
    接收:46 B9 68 00 08 00 BE 01 2E 16
    发送:46 B9 6A 00 8D 00 00 00 09 00 00 80 D0 04 D0 05 D0 06 8C 82 8D 83 8E F0 EF 12 14 7E 74 01 2C F5 0F E4 3D F5 10 8E 11 AD 0F AE 10 AF 11 7C 01 C3 EC 95 12 50 2A C0 07 C0 06 C0 05 C0 04 12 07 AE 12 08 1C AB 82 D0 04 D0 05 D0 06 D0 07 8D 82 8E 83 8F F0 EB 12 14 7E A3 AD 82 AE 83 0C 80 D0 12 07 B8 12 07 9D D3 22 AD 0F AE 10 AF 11 7C 00 C3 EC 95 12 50 32 8D 82 8E 83 8F F0 12 14 97 F5 82 C0 07 C0 06 C0 05 C0 04 12 07 E0 12 37 40 16
    接收:46 B9 68 00 08 00 C0 01 30 16
    发送:46 B9 6A 00 8D 00 00 00 09 80 00 80 07 C2 E5 82 D0 04 D0 05 D0 06 D0 07 70 05 12 07 9D C3 22 0D BD 00 01 0E 0C 80 C8 12 07 9D 90 00 04 12 03 96 D3 22 AF 82 75 0F 13 75 10 00 75 11 40 E4 F5 0D F5 0E C2 02 75 12 01 75 82 A1 C0 07 12 08 46 D0 07 74 A1 4F F5 82 75 0F 14 75 10 00 75 11 40 E4 F5 0D F5 0E C2 02 75 12 01 C0 07 12 08 46 75 0F 00 75 10 15 75 11 80 E4 F5 0D F5 0E C2 02 75 12 01 75 82 A0 12 08 46 D0 07 74 A0 4F 2E 2F 16
    接收:46 B9 68 00 08 00 2F 00 9F 16
    发送:46 B9 6A 00 8D 00 00 00 0A 00 00 80 F5 82 75 0F FF 75 10 14 75 11 80 E4 F5 0D F5 0E C2 02 75 12 01 C0 07 12 08 46 75 0F 15 75 10 00 75 11 40 E4 F5 0D F5 0E C2 02 75 12 01 75 82 A1 12 08 46 75 0F 13 75 10 00 75 11 40 E4 F5 0D F5 0E C2 02 75 12 01 75 82 A0 12 08 46 D0 07 74 AA B5 15 02 D3 22 74 A0 4F F5 82 75 0F 14 75 10 00 75 11 40 E4 F5 0D F5 0E C2 02 75 12 01 12 08 46 C3 22 AE 82 AF 83 75 0F 16 75 10 00 75 11 40 E4 2E AD 16
    接收:46 B9 68 00 08 00 2C 00 9C 16
    发送:46 B9 6A 00 8D 00 00 00 0A 80 00 80 F5 0D F5 0E A2 03 92 02 75 12 01 75 82 A1 C0 07 C0 06 12 08 46 D0 06 D0 07 75 0F 17 75 10 00 75 11 40 8E 0D 8F 0E A2 03 92 02 75 12 01 75 82 A1 C0 07 C0 06 12 08 46 75 0F 00 75 10 15 75 11 80 E4 F5 0D F5 0E A2 03 92 02 75 12 01 75 82 A0 12 08 46 D0 06 D0 07 75 0F FF 75 10 14 75 11 80 8E 0D 8F 0E A2 03 92 02 75 12 01 75 82 A0 C0 07 C0 06 12 08 46 75 0F 18 75 10 00 75 11 40 E4 F5 0D 2B 3B 16
    接收:46 B9 68 00 08 00 3A 00 AA 16
    发送:46 B9 6A 00 8D 00 00 00 0B 00 00 80 F5 0E A2 03 92 02 75 12 01 75 82 A1 12 08 46 75 0F 16 75 10 00 75 11 40 E4 F5 0D F5 0E A2 03 92 02 75 12 01 75 82 A0 12 08 46 D0 06 D0 07 74 AA B5 18 02 D3 22 75 0F 17 75 10 00 75 11 40 8E 0D 8F 0E A2 03 92 02 75 12 01 75 82 A0 12 08 46 C3 22 75 19 FF 75 0F 19 75 10 00 75 11 40 E4 F5 0D F5 0E C2 02 75 12 01 75 82 A1 12 08 46 92 04 E4 33 FF BF 01 02 80 03 02 0C 5C 75 0F 00 75 10 15 2A 29 16
    接收:46 B9 68 00 08 00 A7 01 17 16
    发送:46 B9 6A 00 8D 00 00 00 0B 80 00 80 75 11 80 E4 F5 0D F5 0E C2 02 75 12 01 75 82 A0 12 08 46 75 0F 1A 75 10 00 75 11 40 E4 F5 0D F5 0E C2 02 75 12 01 75 82 A1 12 08 46 74 BB B5 1A 4F 75 0F 19 75 10 00 75 11 40 E4 F5 0D F5 0E C2 02 75 12 01 75 82 A0 12 08 46 C2 03 90 00 80 12 0A 72 50 04 75 82 00 22 75 82 02 12 09 A6 50 04 75 82 01 22 75 82 06 12 09 A6 50 04 75 82 02 22 75 82 0E 12 09 A6 50 04 75 82 03 22 75 82 04 22 2A 23 16
    接收:46 B9 68 00 08 00 21 00 91 16
    发送:46 B9 6A 00 8D 00 00 00 0C 00 00 80 75 0F 19 75 10 00 75 11 40 75 0D FF 75 0E FF D2 02 75 12 01 75 82 A3 12 08 46 50 04 75 82 0A 22 D2 03 90 10 00 12 0A 72 50 04 75 82 05 22 D2 03 90 20 00 12 0A 72 50 04 75 82 06 22 D2 03 90 40 00 12 0A 72 50 04 75 82 07 22 D2 03 90 80 00 12 0A 72 50 04 75 82 05 22 75 82 09 22 75 82 FF 22 12 03 71 12 03 79 75 80 F0 C2 90 12 0B 51 85 82 0C 22 12 03 79 75 80 FF D2 90 22 12 0C 60 85 0C 27 FF 16
    接收:46 B9 68 00 08 00 7C 00 EC 16
    发送:46 B9 6A 00 8D 00 00 00 0C 80 00 80 23 02 0C 72 12 0C 60 75 67 20 74 FC 25 0C 40 03 75 67 10 E5 0C 24 FE 40 03 75 67 08 E5 0C 25 0C 25 E0 FF F5 F0 90 14 D3 93 F5 1C A3 E5 F0 93 F5 1D A3 E5 F0 93 F5 1E A3 E5 F0 93 F5 1F E4 F5 53 F5 54 F5 55 F5 56 C3 E5 1C 95 53 E5 1D 95 54 E5 1E 95 55 E5 1F 95 56 40 2B 90 14 B3 75 F0 80 12 0D 07 40 04 75 23 FF 22 AA 67 E4 FB FE FF EA 25 53 F5 53 EB 35 54 F5 54 EE 35 55 F5 55 EF 35 56 41 81 16
    接收:46 B9 68 00 08 00 7E 00 EE 16
    发送:46 B9 6A 00 8D 00 00 00 0D 00 00 80 F5 56 80 C2 02 0C 72 AD 82 AE 83 AF F0 74 FB 25 0C 50 03 02 0D C7 79 00 AA 54 E4 FB FC EA A2 E7 C9 33 C9 33 C9 54 01 FA EB 2B 4A FA EC A2 E7 CB 33 CB 33 CB 54 01 FC E5 0C 24 FE 40 66 74 A0 49 F5 82 85 53 0D 85 54 0E C2 02 8D 0F 8E 10 8F 11 85 67 12 C0 07 C0 06 C0 05 C0 01 12 08 46 D0 01 D0 05 D0 06 D0 07 40 01 22 E5 67 24 F7 40 03 02 0E 0E 74 A0 49 F5 82 74 08 25 53 F8 E4 35 54 FA 3B 22 16
    接收:46 B9 68 00 08 00 9E 01 0E 16
    发送:46 B9 6A 00 8D 00 00 00 0D 80 00 80 E4 35 55 E4 35 56 88 0D 8A 0E 74 08 2D F5 0F E4 3E F5 10 8F 11 E5 67 24 F8 F5 12 C2 02 12 08 46 40 6C 22 E5 67 24 EF 50 02 C3 22 74 A0 49 F5 82 85 53 0D 85 54 0E C2 02 8D 0F 8E 10 8F 11 85 67 12 12 08 46 40 48 22 E5 0C 24 F5 40 41 E5 0C 24 FB 50 3B 7B 00 AC 56 8B 00 EC A2 E7 C8 33 C8 33 C8 54 01 FA 7B 00 7C 00 88 01 E5 67 24 DF 50 02 C3 22 74 A0 49 F5 82 85 53 0D 85 54 0E D2 02 8D 35 76 16
    接收:46 B9 68 00 08 00 72 00 E2 16
    发送:46 B9 6A 00 8D 00 00 00 0E 00 00 80 0F 8E 10 8F 11 85 67 12 12 08 46 40 01 22 D3 22 AD 82 AE 83 AF F0 74 FB 25 0C 50 03 02 0E AE 79 00 AA 54 E4 FB FC EA A2 E7 C9 33 C9 33 C9 54 01 FA EB 2B 4A FA EC A2 E7 CB 33 CB 33 CB 54 01 FC E5 0C 24 FE 40 4F 74 A1 49 F5 82 85 53 0D 85 54 0E C2 02 8D 0F 8E 10 8F 11 75 12 08 C0 07 C0 06 C0 05 C0 01 12 08 46 D0 01 D0 05 D0 06 D0 07 74 A1 49 F5 82 74 08 25 53 F8 E4 35 54 FA E4 35 55 39 C0 16
    接收:46 B9 68 00 08 00 3B 00 AB 16
    发送:46 B9 6A 00 8D 00 00 00 0E 80 00 80 E4 35 56 88 0D 8A 0E C2 02 8D 0F 8E 10 8F 11 75 12 08 02 08 46 74 A1 49 F5 82 85 53 0D 85 54 0E C2 02 8D 0F 8E 10 8F 11 75 12 10 02 08 46 E5 0C 24 F5 40 31 E5 0C 24 FB 50 2B 7B 00 AC 56 8B 00 EC A2 E7 C8 33 C8 33 C8 54 01 88 01 74 A1 49 F5 82 85 53 0D 85 54 0E D2 02 8D 0F 8E 10 8F 11 75 12 10 02 08 46 22 12 0C 60 12 0C 72 75 23 FF 22 75 59 60 75 5A 0C 75 5B 7B 75 5C 0C 75 61 10 75 2E 0E 16
    接收:46 B9 68 00 08 00 09 00 79 16
    发送:46 B9 6A 00 8D 00 00 00 0F 00 00 80 62 0E 75 5D 84 75 5E 0C 78 5F 76 07 08 76 0D 75 63 E6 75 64 0E 75 65 72 75 66 0C 22 12 03 74 12 03 6C 90 00 02 12 03 96 D2 91 D2 92 D2 93 75 80 FF 75 90 FF D2 B5 C2 94 90 00 14 12 03 96 E4 F5 53 F5 54 F5 55 F5 56 C2 A0 02 03 79 12 03 79 75 80 FF 75 90 FF D2 B5 D2 94 D2 A0 22 A2 87 92 F0 A2 86 92 F1 A2 85 92 F2 A2 84 92 F3 A2 83 92 F4 A2 82 92 F5 A2 81 92 F6 A2 80 92 F7 85 F0 82 22 41 FD 16
    接收:46 B9 68 00 08 00 77 00 E7 16
    发送:46 B9 6A 00 8D 00 00 00 0F 80 00 80 85 82 F0 A2 F7 92 80 A2 F6 92 81 A2 F5 92 82 A2 F4 92 83 A2 F3 92 84 A2 F2 92 85 A2 F1 92 86 A2 F0 92 87 22 12 0F 1C 90 00 01 12 03 96 C2 96 C2 97 C2 B5 C2 90 90 00 14 12 03 96 12 0F 5C E5 82 F5 23 D2 94 C2 94 75 82 14 12 03 83 12 0F 5C E5 82 F5 24 75 25 FF 02 0F 4C 12 0F 1C D2 96 C2 97 C2 B5 C2 90 90 00 01 12 03 96 12 03 7E 90 00 01 12 03 96 C2 95 90 00 0A 12 03 96 D2 95 90 00 01 3B 6D 16
    接收:46 B9 68 00 08 00 67 00 D7 16
    发送:46 B9 6A 00 8D 00 00 00 10 00 00 80 12 03 96 02 0F 4C AD 82 AE 83 AF F0 7C 00 C3 EC 95 67 40 03 02 10 B1 C2 96 D2 97 D2 B5 D2 90 8D 82 8E 83 8F F0 12 14 97 F5 82 C0 07 C0 06 C0 05 C0 04 12 0F 80 12 03 7E 75 82 14 12 03 83 C2 95 75 82 14 12 03 83 D2 95 75 82 14 12 03 83 12 03 79 75 82 14 12 03 83 C2 97 90 00 02 12 03 96 D0 04 D0 05 D0 06 D0 07 75 80 FF E4 F5 57 F5 58 C0 07 C0 06 C0 05 C0 04 12 0F 5C AB 82 D0 04 D0 05 36 20 16
    接收:46 B9 68 00 08 00 99 01 09 16
    发送:46 B9 6A 00 8D 00 00 00 10 80 00 80 D0 06 D0 07 8D 82 8E 83 8F F0 12 14 97 FA EB B5 02 02 80 15 05 57 E4 B5 57 02 05 58 C3 74 E8 95 57 74 03 95 58 50 C8 C3 22 D2 94 C2 94 0C 02 10 0E D3 22 AD 82 AE 83 AF F0 7C 02 EC 24 ED 40 33 C2 96 C2 97 D2 B5 D2 90 C0 07 C0 06 C0 05 C0 04 12 0F 5C AB 82 D0 04 D0 05 D0 06 D0 07 8D 82 8E 83 8F F0 EB 12 14 7E A3 AD 82 AE 83 D2 94 C2 94 0C 80 C8 22 12 0F 1C 74 FF 25 23 50 2A D2 96 D2 3D E3 16
    接收:46 B9 68 00 08 00 DC 01 4C 16
    发送:46 B9 6A 00 8D 00 00 00 11 00 00 80 97 D2 B5 D2 90 75 82 14 12 03 83 12 03 7E 75 82 14 12 03 83 C2 95 75 82 14 12 03 83 D2 95 75 82 14 12 03 83 12 03 79 74 FE 25 23 50 2A D2 96 D2 97 C2 B5 C2 90 75 82 14 12 03 83 12 03 7E 75 82 14 12 03 83 C2 95 75 82 14 12 03 83 D2 95 75 82 14 12 03 83 12 03 79 02 0F 4C 75 59 1C 75 5A 0F 75 5B A4 75 5C 0F 75 5D D9 75 5E 0F 78 5F 76 06 08 76 10 75 61 B3 75 62 10 75 63 F4 75 64 10 75 30 2D 16
    接收:46 B9 68 00 08 00 A5 01 15 16
    发送:46 B9 6A 00 8D 00 00 00 11 80 00 80 65 4C 75 66 0F 22 AF 82 7E 00 C3 EE 9F 50 71 EE 24 69 F9 87 E0 C2 87 A2 E7 92 85 D2 87 A2 86 92 F7 C2 87 A2 E6 92 85 D2 87 A2 86 92 F6 C2 87 A2 E5 92 85 D2 87 A2 86 92 F5 C2 87 A2 E4 92 85 D2 87 A2 86 92 F4 C2 87 A2 E3 92 85 D2 87 A2 86 92 F3 C2 87 A2 E2 92 85 D2 87 A2 86 92 F2 C2 87 A2 E1 92 85 D2 87 A2 86 92 F1 C2 87 A2 E0 92 85 D2 87 A2 86 92 F0 C2 87 EE 24 6E F8 A6 F0 0E 80 8A 52 2F 16
    接收:46 B9 68 00 08 00 27 00 97 16
    发送:46 B9 6A 00 8D 00 00 00 12 00 00 80 22 C2 B5 C2 87 D2 B5 D2 86 22 C2 B5 D2 86 D2 87 22 12 12 01 75 69 AC 75 6A 53 75 82 02 12 11 86 90 00 23 12 03 96 02 12 0A AD 82 AE 83 AF F0 AB 53 AC 54 75 73 00 74 F0 25 73 50 03 02 12 CF 8C 75 75 74 00 75 69 C2 75 6A 3D 85 75 6B 8B 02 8A 6C 8D 82 8E 83 8F F0 12 14 97 FA 8A 6D 75 82 05 C0 07 C0 06 C0 05 C0 04 C0 03 12 11 86 75 69 38 75 6A 86 75 6B FF 75 82 03 12 11 86 75 69 95 75 37 0A 16
    接收:46 B9 68 00 08 00 81 00 F1 16
    发送:46 B9 6A 00 8D 00 00 00 12 80 00 80 6A D7 75 82 02 12 11 86 D0 03 D0 04 D0 05 D0 06 D0 07 AA 70 C0 03 C0 04 8D 82 8E 83 8F F0 12 14 97 FC EA B5 04 06 D0 04 D0 03 80 14 D0 04 D0 03 BA FF 0B 74 02 B5 74 02 80 04 05 74 80 86 C3 22 0D BD 00 01 0E 0B BB 00 01 0C 05 73 02 12 36 D3 22 AD 82 AE 83 AF F0 85 53 76 85 54 77 7A 00 BA 10 00 40 01 22 7C 00 85 76 78 85 77 79 75 69 C2 75 6A 3D AB 79 8B 6B AB 78 8B 6C 75 6D FF 75 82 35 B9 16
    接收:46 B9 68 00 08 00 B0 01 20 16
    发送:46 B9 6A 00 8D 00 00 00 13 00 00 80 05 C0 07 C0 06 C0 05 C0 04 C0 02 12 11 86 75 69 38 75 6A 86 75 6B FF 75 82 03 12 11 86 75 69 95 75 6A D7 75 82 02 12 11 86 D0 02 D0 04 D0 05 D0 06 D0 07 05 78 E4 B5 78 02 05 79 AB 70 BB FF 08 BC 02 02 80 03 0C 80 A5 85 78 76 85 79 77 8D 82 8E 83 8F F0 EB 12 14 7E A3 AD 82 AE 83 0A 02 12 DF 12 12 0A 75 59 01 75 5A 12 75 5B 85 75 5C 04 75 5D 11 75 5E 12 78 5F 76 29 08 76 12 75 61 D1 32 F2 16
    接收:46 B9 68 00 08 00 68 00 D8 16
    发送:46 B9 6A 00 8D 00 00 00 13 80 00 80 75 62 12 75 63 85 75 64 04 75 65 0A 75 66 12 22 C2 B5 C2 87 D2 B5 D2 86 90 00 0A 02 03 96 C2 B5 D2 86 D2 87 D2 85 22 12 13 90 75 69 AA 75 6A 8A 75 82 02 12 11 86 90 00 23 12 03 96 02 13 9E AD 82 AE 83 AF F0 AB 53 AC 54 8D 7B 8E 7C 8F 7D 75 7A 00 74 F0 25 7A 40 54 75 69 AA 75 6A 50 8B 02 EC A2 E7 CA 33 CA 33 A2 E7 CA 33 CA 33 CA 54 03 8A 6B 74 3F 5B FE 8E 6C 85 7B 82 85 7C 83 85 7D 3B E9 16
    接收:46 B9 68 00 08 00 DF 01 4F 16
    发送:46 B9 6A 00 8D 00 00 00 14 00 00 80 F0 12 14 97 FF 8F 6D 75 82 05 C0 04 C0 03 12 11 86 D0 03 D0 04 E5 72 60 02 C3 22 05 7B E4 B5 7B 02 05 7C 0B BB 00 01 0C 05 7A 80 A6 D3 22 AD 82 AE 83 AF F0 7C 10 8D 82 8E 83 8F F0 74 FF 12 14 7E A3 AD 82 AE 83 8C 03 1B 8B 04 EC 70 E8 22 12 13 9E 75 59 90 75 5A 13 75 5B 85 75 5C 04 75 5D A7 75 5E 13 78 5F 76 BF 08 76 13 75 61 2E 75 62 14 75 63 85 75 64 04 75 65 9E 75 66 13 22 20 F7 35 FC 16
    接收:46 B9 68 00 08 00 71 00 E1 16
    发送:46 B9 6A 00 8D 00 00 00 14 80 00 80 10 30 F6 11 88 83 A8 82 20 F5 07 F6 A8 83 75 83 00 22 F2 80 F7 F0 22 20 F7 14 30 F6 14 88 83 A8 82 20 F5 07 E6 A8 83 75 83 00 22 E2 80 F7 E4 93 22 E0 22 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 7F 00 00 00 FF 00 00 00 FF 01 00 00 FF 03 00 00 FF 0F 00 00 FF 07 00 00 FF 1F 00 00 FF 3F 00 00 FF 7F 00 00 FF FF 00 00 FF 1F 00 00 AA 48 42 16
    接收:46 B9 68 00 08 00 37 00 A7 16
    发送:46 B9 6A 00 8D 00 00 00 15 00 00 80 BB FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 80 C8 16
    接收:46 B9 68 00 08 00 3C 00 AC 16
    发送:46 B9 6A 00 0D 69 07 00 36 01 D1 7E 02 6D 16
    接收:46 B9 68 00 07 8D 00 FC 16
    FF 7F F7 FF FF FF FF FF FF
    and HERE is Options frame.underlined byte is option byte.
    if you want to more.please open my website.search STC12.and you ‘ll got it .
    发送:46 B9 6A 00 1A 8D FF 7F F7 FF FF FF FF FF FF FF FF FF FF FF FF 00 A9 0A A6 10 D3 16
    接收:46 B9 68 00 24 50 FF 7F F7 FF FF 03 FF 62 49 FF 7F F7 FF FF FF 00 A9 00 03 00 9A 04 79 1A 00 AD FF 00 FF 10 F6 16
    ——————————————————————–
    发送:46 B9 6A 00 08 82 00 00 F4 16
    COM2关闭
    写入成功!

  7. @万致远:
    > I want to tell you I have been to build kSTC-ISP on GUI.using GAMBAS.
    My point was avoiding any GUI, and doing a commandline tool to use from Makefiles.

    Thanks for the info, just don’t post such long messages in comments, some pastebin or email would do. It’s pain to read otherwise.
    I have figured out most of the baudswitching stuff and it’s pretty reliable right now. Thanks for the tip regarding the checksumming of the settings (although, it looks like mcu doesn’t care much about it, I’ll implement it some time soon). EEPROM writing will be in trunk some time soon.
    I don’t think parsing the magic bytes like that is a good idea, since:
    a). I got a good mcudb right here right now: https://github.com/nekromant/stcdude/tree/master/src/lua/mcudb obtained from original ISP tool
    b). The point of mcudb is to merge it with info from Keil CDB file, which was done up there.

  8. EEPROM ‘s address is after FLASH ‘s address.
    so you can only use a BINARY FILE to write the STC EEPROM.

  9. By the way,STC15 series and STC89 series writing Protocol is not the same .
    such as Parity…checksum….

  10. By the way…. I want to say.STC MCU is a shit…..
    Please open the AD-manual,and search OP table.
    you can find 1T complete OP is only just 12.and it include NOP!
    And for wider working voltage……I think it is not called wider.
    ISP speed is too slow.Handshake is waste a lot of time.
    And IAP module has been malfunction..such as Earse all Flash memory.
    I think some chip.Such as AVR-compat chip.like LGT8F08A,it is cheap than STC.
    and can get higher performance than STC.
    I ‘m reverse engineering LGT SPI ISP protocol now.It writing very fast.could use 10S write all of the FLASH(SPI Speed 1.4Mbps).Earse just 20mS.it just like ATmega168.I think it is a great chip.
    Here is LGT ‘s website.http://www.mcugreen.com

  11. Hello
    I was wondering if you could help me
    I want a device like signal sweep generator But in a frequency range of 10 GHz to 13 GHz
    With the option to spend 5 frequencies I choose
    If you can help me then thanks
    How much is each unit
    To use the component hmc-735 its analog device
    and you need pll and microcontroller
    For this to work independently without a computer
    Hopefully done business together
    thanks

Leave a Reply

Your email address will not be published. Required fields are marked *