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...
You can not use printf() in an interrupt unless you only use it in one priority level and not in main(). And then it would be a bad idea. So leave printf() in the main loop
Instead of printf Shall i use SBUF????? That is efficiecnt way or not????
... if by Shall i use SBUF you mean use a "simple' interrupt driven serial routine instead of printf, it is about 1000 times more efficient.
printf, being a "jack of all trades" take up an inordinate amount of space and time to be able to handle things you do not and do need in one routine.
one mans opinion is that printf has no place in limited memory applications.
Erik
Yes it is more Efficient. But if you are printing form different levels of interrupts or main you will have issues. All one level and not from main Loop is OK. But printing from the timer interrupt will slow it down especially at slower baud rates.
one mans opinion is that printf has no place in limited memory applications
In one man's opinion how much memory would one need to have for it to be an unlimited memory application?
640K ought to be enough for anybody.
View all questions in Keil forum