Hi,
We are developing motor control project using CodeWorrior IDE based on mc9s12vr64 chip. Can we trigger a HC12 Debugger command running from C source code? e.g. If running a command “ fprintf(“my.text”, “some text..”), how to trigger it from C code implementation? ( I can only trigger it from HC12 debugger IDE but not from C source code).
Thanks and best regards
He Wei
Hi He Wei
printf()/fprintf() is not possible since there is NO "standard output" in embedded system. User has to implement their own "pseudo" prinf() function, i.e. to format the output in memory and then print out through SCI or SPI
HI-WAVE supports a command FPRINTF which can be used in that case.
Syntax is pretty similar to ANSI C fprintf.
You can have a command as follows:
FPRINTF (MyLog.txt, "temp1 = %d temp2= %d temp3= %d\n", temp1, temp2, temp3)
If you are using tabs between the different items, you should be able to read the file in a .xls spreadsheet without trouble.
Have a nice day,
Jun Zhang
Dear Jennie,
Thanks a lot for the reply. So can we trigger a HI-WAVE cmd or execute a HI-WAVE.cmd file from C code?
Thanks and best regards
He Wei
No. you can't trigger it from C code. You can only execute PRINTF from hiwave command window.