This may be be a silly question, but its baffling me. If I set up a receive interrupt, process the data and clear the flag. All works well. The problem is I need to use printf. I realize that this will of course also generate an interrupt, I handle this within the interrupt with if(TI)TI=0; hoping at worst it will just slow down printing. However this does not work, as soon as I try to print, all manner of strange erratic things happen. I had thought of disabling serial interrupt before a print statement, and re-enabling after, but at 300 baud (3-4 Secs) I could possibly miss a character. I cannot use full blown interrupt driven coms, due to lack of memory, rtos is also ruled out for the same reason. Any advice most gratefully received.
grandalf62
0
Newbie Poster
Recommended Answers
Jump to PostThat operating system and compiler are you using? In my MS-DOS 6.X days I had no conflicts between serial port interrups and printf(). I just wrote a serial port driver (supported 1 to 40 serial ports) that was TSR and the rest of the program ran normally, within the memory …
Jump to PostYou're not trying to call printf() INSIDE the ISR are you?
Because that's a really bad idea.
All 6 Replies
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
Salem
5,138
Posting Sage
Colin Mac
53
Posting Whiz
grandalf62
0
Newbie Poster
Colin Mac
53
Posting Whiz
grandalf62
0
Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.