HARSFEN0602
HP;
XQ##TASK2;
6.4.3 Automatic program running with power up
If the user program includes the autoexec function, the next program line after function declaration will be
performed with powering up.
6.4.4 Save to Flash
Since a program is downloaded to a non-volatile memory, it is always saved. Information isn’t lost in cases
of power down.
6.4.4.1 Clear user program from Flash
The CP command clears the entire user area in the serial flash. The running program must be killed (not
halted) before.
This procedure may take a significant time.
6.5 Debugging
This method allows a debug the user program that is downloaded to the Harmonica’s flash. This may be
useful during development the user program and examination the program flow.
6.5.1 Running, breaking, and resuming
The XQ command starts program execution from a label, or executes a function.
XQ##MYFUNCTION(a,b,c) runs the function MYFUNCTION(a,b,c).
XQ cannot return values from a function.
XQ##LABEL runs from ##LABEL
XQ## runs from the starting of the user program code.
The XQ command without a parameter is illegal.
XQ does not return value.
Note: XQ## without label or function name is designed for running the program written in the
Saxophone/Clarinet style, i.e. without function definitions, local variables, etc. The virtual machine executes
virtual assembly commands according to their order in the compiled code. If the program contains function
definition, it enters inside function and executes function body. It is problematic, so we try to prevent it. If
the program starts from a function definition, the XQ command without label or function name causes to the
error: NO_SUCH_FUNCTION. If the function starts from label, the dummy start label will be inserted to the
function symbol table and running will be from the start of the program.
KL=0 kills all the virtual machines, if it is running.
KL stops the motor.
HP halts all the virtual machines. They can be continued later by the XC command.
If HP halts inside a wait statement, the wait time stops to run while the program is halted.
XC continues all the virtual machines.
6.5.2 DB command
The DB command is designed to help analyze the user program. It allows the following functionalities: