In TI CCS for texas instrument's DSPs...it is used to display some information on the PCs monitor (e.g. value of some variable in the dsp's RAM) which is acquired using the JTAG port. If you're using the proceessor without connecting it to a PC, it just does nothing.
In TI CCS for texas instrument's DSPs...it is used to display some information on the PCs monitor (e.g. value of some variable in the dsp's RAM) which is acquired using the JTAG port. If you're using the proceessor without connecting it to a PC, it just does nothing.
Hi CMOS,
It is used the same as on the desktop environments. It depends on the compiler, but with most it just outputs a formated string to standard out, which may be an LCD, or serial port. In some compilers (HiTech, and perhaps C180 you have to write your own putc function for this to work. In others, like CCS, it outputs to which ever stream you define.
Hope this helps, but your question was not that specific, so...
Regards,
Robert
I think the printf is only used for debugging in embedded C.
The compiler will compile printf , fopen etc into low level action , not as in PC's hello world .
The low level action will not print string for there is no screen.
It will be replaced by a debug instruction such as breakpoint. So when grogram runs at it , the debugger will know it and do the print job insteadly.
Maybe another way to use printf is that the printf will do special job according to special device .
A concrete example for debugging using Docklight. Printf function is taking a lot of rom space from the mcu so it may not be good for end-product. However, it is good for program debug when there is no DSO or logic analyser.
For AVR C compilers, - I know Codevision - printf sends the formated string to the serial port RS232. It can be used mainly for debugging along with scanf - if you start hyperterminal, you can send and receive info with the uC, even if you dont have a keyboard or LCD connected to it. In CV AVR, there are some degrees of implementation for printf - short int, long int, float... printf takes about 1kwords of prog memory.