Hello! I wanted to use printf() function for debugging my project. I read the description about it but couldn't understand it, can u guys help me use it? i know that it prints the data in the "printf() viewer" btw i am using keil c uvison 4 and 89252.
p.s - please reply soon, it is for my competition and i am stuck with the coding.
sorry the micro controller's number is 89S52!
What, exactly, do you not understand? It's quite simple really!
Have you looked at the examples that Keil provide?
"please reply soon"
www.catb.org/.../smart-questions.html
"it is for my (sic) competition and i am stuck with the coding"
But, if you can't do "the coding", then it's not your competition entry - is it?
I trust your submission will be giving full credit for all assistance...?
I meant with "stuck with the code" means my code is not working so i want to debug it with the printf() function by printing some characters for each function which makes me sure that everything is going alright. I am doing "lift control system" and i am only stuck with the "key accepting function"
I just wanted to know how i can use THE printf(); function
Thank you,
Please read the manual: http://www.keil.com/support/man/docs/c51/c51_printf.htm
It is often better to use a couple of I/O pins to drive LEDs.
The advantage with that is that you can toggle a LED while running your program in real-time speed. Serial data means the processor have to do lots of extra work to handle your printf().
In this case, you have problems with keyboard scanning - but keyboard scanning requires debounce handling, something that is very much affected by the execution speed.
Much problems can be handled with just 2-4 LED and a digital oscilloscope.
Indeed.
Although still intrusive, it is far less intrusive.
Other possibilities include:
1. Use a device with on-chip debug. (presumably, not an option here?)
2. Use the Simulator to investigate.
Thank you for your replies, i will try to use LED :)
Good idea.
However, when/if you do come to need printf (whether for debugging or other purposes), you now know where to look - don't you?
I think i will study harder to get to know more about my friend "printf()" , by the way can u still give me some links where i can understand more about our friend? Cause call the links above.. I am still in confusion
Thanks! :)
The standard usage of printf() is described in any and every 'C' textbook.
The specific details of Keil's C51 implementation are, as previously mentioned, here:
http://www.keil.com/support/man/docs/c51/c51_printf.htm (and linked pages)
All of Keil's documentation, examples, application notes, etc, are here: http://www.keil.com/support/
What information do you require beyond that?
The C51 documentation & example projects will also be on your PC as part of the Keil installation.