First of all, you will have to assemble your program using our TMCL-IDE and save the result as a binary file. To do that, choose "Options" in the menu named "TMCL" of the TMCL Creator. There, enable the option "Write output to binary file". Now, assemble your program, and the result will be saved in a binary file. This file will have the same name as your TMCL file, but with the extension ".BIN".
This binary file contains all the TMCL commands of your program in binary format. Each command saved is eight bytes: It is the command without the module address.
Once you have this file with the commands needed for your application, proceed as following:
- Send command 132 (enter download mode), with type, motor/bank and value set to 0.
- Open the binary file.
- Read 8 bytes from the file.
- Add the module address of your module (in most cases 1) to the 8 bytes (so that the check sum is correct).
- Send the module address (in most cases 1) and the 8 bytes to the module.
- You will get a reply (9 bytes) with the status set to 101 (which means that the command has been stored in the EEPROM).
- If you are not at the end of the file, go to step (3).
- Send a command opcode 0 to the module (with module address 1 this would be 0x01 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x01). This is just an end marker for the disassembler in the TMCL-IDE.
- Send command 133 (exit download mode), with type, motor/bank and value set to 0.
That's all. You can check if it works by using the "Disassemble" function of the TMCL-IDE.