Type: Single-Chip Microcomputer
29 people read comments
Directory (?) [+]
Note:
Programming Software for ISP and STC single-chip microcomputer;
IAP, CTC Single-chip Computer-solidified burning software;
1. Guide code
ISP: 7f 7f 7f 7f 7f
The ISP keeps sending 0x7f until it receives the IAP Reply frame;
IAP: 68 00 39 00 09 7A 7A 09 7A
09 76 09 7A 09 09 7A 09 7A
38 43 FD F1 10 82 00 00 00
00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00
00 00 00 00 AC 16
IAP Reply frame: no frame header, 0x16 at the end of a frame, 0xac verification,
Verification Method: From 0x68 to 0 x AC, add a number plus 1 to reduce the length of 8 bits;
The IAP Reply frame varies according to the single-chip crystal oscillator, and the reply is also different. The above is a 11.0592 crystal oscillator;
2. Set the Communication Rate
ISP: 46 B9 6a 00 0C 8f FF 7d 00 Fe 78 80 77 16
IAP: 46 B9 68 00 0C 8f FF 7d 00 Fe 78 80 75 16
ISP: 46 B9 6a 00 0b 8e FF 7d 00 FF 78 F6 16
IAP: 46 B9 68 00 0b 8e FF 7d 00 FF 78 F4 16
Structure: Head (2) Sign (1) Reserve (1) length (1) frame (1) data (x) checksum (1) Trail (1)
Head (2) 0x46 0xb9
Sign (1) 0x6a PC-> MCU
0x68 MCu-> PC
Reserve (1) 0x00
Length (1) 0x0c = head + sign + reserve + Length + frame + Data
Frame (1) 0x8f and 0x8e indicate different operations
Data (X)
Checksum (1) 0x77 the addition of the first byte from head to checksum, plus 1, to take 8 bits;
Trail (1) 0x16
3. Communication Synchronization
ISP: 46 B9 6a 00 0C 80 02 00 36 01 F1 10 30 16
IAP: 46 B9 68 00 06 80 EE 16
Send and receive synchronization 5 times
ISP structure: Head (2) Sign (1) Reserve (1) length (1) frame (1) data (x) checksum (1) Trail (1)
IAP structure: Head (2) Sign (1) Reserve (1) length (1) frame (1) checksum (1) Trail (1)
Frame (1) 0x80
4. Erase commands
ISP: 46 B9 6a 00 0d 84 0b 33 33 33 33 38 16
IAP: 46 B9 68 00 06 80 EE 16
ISP structure: Head (2) Sign (1) Reserve (1) length (1) frame (1) data (x) checksum (1) Trail (1)
IAP structure: Head (2) Sign (1) Reserve (1) length (1) frame (1) checksum (1) Trail (1)
Frame (1) 0x84 erase command
0x80
5. Programming
ISP: 46 B9 6a 00 8C 00 00 00 00 00 80 02 0d 2f 12 13 ad 02 15 22 FF 02 12 B9 FF E4 33 Fe E4 2f F5 82 74 F0 3E F5 83 E0 fa 12 14 55 af 02 22 08 48 E4 90 00 B7 F0 90 00 B7 E0 C3 94 04 40 03 02 02 39 E0 FF 75 F0 07 A4 24 05 F5 82 E4 34 00 f5 83 E0 Fe EF 75 F0 07 A4 24 67 F5 82 E4 34 00 F5 83 E0 FF 6e 60 1f EF 24 C6 90 00 B8 F0 C3 94 00 40 10 E0 FD 94 20 50 0a 90 00 B7 E0 FF 12 13 65 80 03 7f 01 22 90 00 B7 E0 FF 75 46 16
IAP: 46 B9 68 00 07 80 D0 BF 16
Structure: Head (2) Sign (1) Reserve (1) length (1) frame (1) data (x) checksum (1) Trail (1)
Frame (1) 0x00 programming commands
Data Structure in ISP frames: ADDR (4) lenght (2) Programe (128)
ADDR (4) 0x00 0x00 0x00 0x00 address high position-> low position, this address is the initial address for writing MCU programming, the address of 1st frames is 0x00000000, the address of 2nd frames is 0x00000080, and the address of 3rd frames is 0x00000100, because the Programming Data Length of each frame is 0x80, + 0x80 for each frame;
Lenght (2) 0x00 0x80 the Programming Data Length of each frame is 0x0080;
Programe (128) programming data content
Data (1) 0xd0 in an IAP frame is the addition and value of data (x) In the ISP frame. The value is 8 bits low, and 1 is not required;
After all the content to be programmed is sent, if the program data sent is not enough to 0x80 bytes, it will be followed by 0x00, with 0x80 bytes missing;
6. Restart
ISP: Fe fe
46 B9 6a 00 06 82 F2 16
The ISP sends the preceding content twice.
No IAP reply
Structure: Head (2) Sign (1) Reserve (1) length (1) frame (1) checksum (1) Trail (1)
Frame (0x82) Restart command
Note:
Programming Software for ISP and STC single-chip microcomputer;
IAP, CTC Single-chip Computer-solidified burning software;
1. Guide code
ISP: 7f 7f 7f 7f 7f
The ISP keeps sending 0x7f until it receives the IAP Reply frame;
IAP: 68 00 39 00 09 7A 7A 09 7A
09 76 09 7A 09 09 7A 09 7A
38 43 FD F1 10 82 00 00 00
00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00
00 00 00 00 AC 16
IAP Reply frame: no frame header, 0x16 at the end of a frame, 0xac verification,
Verification Method: From 0x68 to 0 x AC, add a number plus 1 to reduce the length of 8 bits;
The IAP Reply frame varies according to the single-chip crystal oscillator, and the reply is also different. The above is a 11.0592 crystal oscillator;
2. Set the Communication Rate
ISP: 46 B9 6a 00 0C 8f FF 7d 00 Fe 78 80 77 16
IAP: 46 B9 68 00 0C 8f FF 7d 00 Fe 78 80 75 16
ISP: 46 B9 6a 00 0b 8e FF 7d 00 FF 78 F6 16
IAP: 46 B9 68 00 0b 8e FF 7d 00 FF 78 F4 16
Structure: Head (2) Sign (1) Reserve (1) length (1) frame (1) data (x) checksum (1) Trail (1)
Head (2) 0x46 0xb9
Sign (1) 0x6a PC-> MCU
0x68 MCu-> PC
Reserve (1) 0x00
Length (1) 0x0c = head + sign + reserve + Length + frame + Data
Frame (1) 0x8f and 0x8e indicate different operations
Data (X)
Checksum (1) 0x77 the addition of the first byte from head to checksum, plus 1, to take 8 bits;
Trail (1) 0x16
3. Communication Synchronization
ISP: 46 B9 6a 00 0C 80 02 00 36 01 F1 10 30 16
IAP: 46 B9 68 00 06 80 EE 16
Send and receive synchronization 5 times
ISP structure: Head (2) Sign (1) Reserve (1) length (1) frame (1) data (x) checksum (1) Trail (1)
IAP structure: Head (2) Sign (1) Reserve (1) length (1) frame (1) checksum (1) Trail (1)
Frame (1) 0x80
4. Erase commands
ISP: 46 B9 6a 00 0d 84 0b 33 33 33 33 38 16
IAP: 46 B9 68 00 06 80 EE 16
ISP structure: Head (2) Sign (1) Reserve (1) length (1) frame (1) data (x) checksum (1) Trail (1)
IAP structure: Head (2) Sign (1) Reserve (1) length (1) frame (1) checksum (1) Trail (1)
Frame (1) 0x84 erase command
0x80
5. Programming
ISP: 46 B9 6a 00 8C 00 00 00 00 00 80 02 0d 2f 12 13 ad 02 15 22 FF 02 12 B9 FF E4 33 Fe E4 2f F5 82 74 F0 3E F5 83 E0 fa 12 14 55 af 02 22 08 48 E4 90 00 B7 F0 90 00 B7 E0 C3 94 04 40 03 02 02 39 E0 FF 75 F0 07 A4 24 05 F5 82 E4 34 00 f5 83 E0 Fe EF 75 F0 07 A4 24 67 F5 82 E4 34 00 F5 83 E0 FF 6e 60 1f EF 24 C6 90 00 B8 F0 C3 94 00 40 10 E0 FD 94 20 50 0a 90 00 B7 E0 FF 12 13 65 80 03 7f 01 22 90 00 B7 E0 FF 75 46 16
IAP: 46 B9 68 00 07 80 D0 BF 16
Structure: Head (2) Sign (1) Reserve (1) length (1) frame (1) data (x) checksum (1) Trail (1)
Frame (1) 0x00 programming commands
Data Structure in ISP frames: ADDR (4) lenght (2) Programe (128)
ADDR (4) 0x00 0x00 0x00 0x00 address high position-> low position, this address is the initial address for writing MCU programming, the address of 1st frames is 0x00000000, the address of 2nd frames is 0x00000080, and the address of 3rd frames is 0x00000100, because the Programming Data Length of each frame is 0x80, + 0x80 for each frame;
Lenght (2) 0x00 0x80 the Programming Data Length of each frame is 0x0080;
Programe (128) programming data content
Data (1) 0xd0 in an IAP frame is the addition and value of data (x) In the ISP frame. The value is 8 bits low, and 1 is not required;
After all the content to be programmed is sent, if the program data sent is not enough to 0x80 bytes, it will be followed by 0x00, with 0x80 bytes missing;
6. Restart
ISP: Fe fe
46 B9 6a 00 06 82 F2 16
The ISP sends the preceding content twice.
No IAP reply
Structure: Head (2) Sign (1) Reserve (1) length (1) frame (1) checksum (1) Trail (1)
Frame (0x82) Restart command