We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
i am using keil uvision 2. plss tell me why we use printf in embedded c? if its 4 debugging,HOW? if its 4 serial commn/transmit characters to serial port,HOW? plsssssssssssssss some1 help.........i searched everywere but i dint get answer..
In a PC, printf() prints to the command line console.
In an embedded project, the compiler kit is delivered with a library with the "front end" of printf(). You as developer will then have to look a the "back end" - where the characters will go if you do use printf().
You might decide to send the characters on a UART connected to a MAX232 or similar, so you could connect a PC directly for viewing the data.
Or you might decide to route the characters to an embedded module (such as a GSM modem) connected directly to the processor.
Or you might decide to route the characters through a SPI interface.
Or you might decide to route the characters to a large ring-buffer implemented in an EEPROM memory, to allow you to allow you to later connect to a device out in the field and pick up any error messages printed to this buffer during the months the device was working stand-alone somewhere.
Or you might decide to not route the characters anywhere at all, in which case it would be pointless to call printf() at all.
In _some_ environments, the debugger/processor may implement a virtual serial port that allows an embedded device without any physical serial ports to print data directly to a log window in the debugger.
But why don't you put down some own time on this school assignment? Do you feel that your own time is much to valuable for doing own work - that you are of special "pure" blood that makes it your birthright to have other people serve you with all the information you need so you yourself can reserve your time for rest and relaxation?