Click to See Complete Forum and Search --> : Serial Comm Interrupts


John Slick
May 21st, 2002, 08:02 AM
I am working on creating a serial communications class for a 16 bit application. This is an embedded app that will be running on dos without windows. I have created a serialPort class and a SerialInterrupt class which is a friend of the SerialPort class so that the ISR can have acess to the buffers. I am compiling the program using Microsoft Compilier 1.52. The code will function properly provided that the interrupts do not occur when certain actions are happening. If the interrupts occur when certain events are happening for instance doing a printf to the screen I recieve a run time error of a stack overflow. If there is anyone with any suggestions I would greatly appreciate it since I have been struggling with this for a couple days with no light in sight.

rchang
May 21st, 2002, 08:36 AM
I do not know if you call printf function in your interrupt routine. If so, it may be the cause of problem. DOS is single task os and use some global memory and cannot be re-entered. If your interrupt rouitne may eventually call into DOS, it has problem sooner or later. The rule is to avoid calling any LIB that will eventually call into DOS!

John Slick
May 21st, 2002, 12:24 PM
:) Thanks that did seem to fix it since I had a printf for debugging purposes placed in the ISR. Removing that seemed to eliminate the stack overflow.