Hi friends,
I am using timer 0 & timer 2 interrupts for functionality and printf functions also am using to display the status .... (for printf statement Timer 1 using)some times that printf function skipped....but the fuctionality working fine.... why this is happening???? plz help me...
That depends on what you mean by "efficient"...
printf almost certainly does what it does pretty effeciently. The thing is that it does a really vast amount - so, if all you want is trivial text output, it is a very poor choice.
But I have seen projects where they dismissed printf as "ineffecient" and, instead, wrote a "simple" routine to just output text. Then they had to add a "simple" routine to just output a number in hex. Then they had to add a "simple" routine to just output a number in decimal. Then they had to add a "simple" routine to just output a number from xdata in hex. etc, etc, etc,...
In the end, I'm not convinced that they gained much over just using printf in the first place!
Jack Sprat has already had a post about a year ago about the increase in size when adding printf().
The thing to rememeber if sending data from an interrupt is to try to limit the output to a single character, and making sure that the interrupt load is less than the capacity of the serial port. With a bit of careful planning, you could have the majority of interrupts able to emit a character with zero wait.
Quite.
However, common sense can't be allowed to interfere with philosophy in ''51 ain't no PC' country. You just gotta get off your horse, throw away the programming manuals and fire up the ICE if you're gonna be a true '51 man.