Send TMCL program to module

First of all, you will have to assemble your program using the TMCL-IDE and save the result as a binary file. To do that, choose "Options" in the menu "TMCL" of the TMCL Creator. There, switch on the option "Write output to binary file". Now, assemble your program, and the result will be saved in a binary file. The file will have the same name as your TMCL file, but with the extension ".BIN".

This file contains all the TMCL commands of your program in binary format. Each command is saved is eight bytes: It is the command without the module address.

In your application, do the following things:

  1. Send command 132 (enter download mode), with type, motor/bank and value set to 0.
  2. Open the binary file.
  3. Read eight bytes from the file.
  4. Add the module address of your module (in most cases 1) to the eighth byte (so that the check sum is correct).
  5. Send the module address (in most cases 1) and the eight bytes to the module.
  6. You will get a reply with (9 bytes) with the status set to 101 (which means that command has been stored in the EEPROM).
  7. If you are not at the end of the file then go to step (3).
  8. 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.
  9. Send command 133 (exit download mode), with type, motor/bank and value set to 0.

This is all. You can check if it works by using the Disassemble function of the TMCL-IDE.

Still need help? Contact Us Contact Us