From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,62a69853768fe82a X-Google-Attributes: gid103376,public From: tmoran@bix.com Subject: Problems with Serial Interupt routines in ADA on MSDOS Date: 1997/05/20 Message-ID: <5lspmi$h99@lotho.delphi.com>#1/1 X-Deja-AN: 242681682 Organization: Delphi Internet Services Newsgroups: comp.lang.ada Date: 1997-05-20T00:00:00+00:00 List-Id: >locks up the CPU every now and then. So the problem is probably not in the initialization code (the first 300 lines of your 700 line message). >context switching by the dos extender Can it reliably do all of what's necessary, plus your substantial processing, in 500 microseconds (19200 baud) on your hardware, in the presence of other (timer, disk, etc) interrupts? > invoke RTKERNEL.RTK_SAVE_REGS_AND_RESTORE_CONTEXT > invoke RTKERNEL.RTK_SWITCH_STACK > invoke RTKERNEL.RTK_DISABLE_INTERRUPTS > process > invoke RTKERNEL.ENABLE_INTERRUPTS > invoke RTKERNEL.RTK_RESTORE_STACK > invoke RTKERNEL.RTK_RESTORE_REGS_AND_IRET Presumably if you are handling an interrupt, they are already disabled, no? And if interrupts are enabled while you are restoring stacks, is that safe? Interrupt enable/disable and context switching is also often only approximately emulated in dos extenders. You might consider a loop inside your interrupt processing, since it's quite possible a second byte might arrive, or you may be able to xmit a second byte, before you've left the ISR. If you test and process you'll save interrupt handling overhead in those cases. That design will also upgrade more easily to a 16550 (buffering) chip. You don't say what else is going on. If not much else during transmission of a block, and the interrupt overhead is preventing reliable 19200 operation, then you might consider polling instead of interrupts. > BAUD : integer := 19200; Shouldn't that be 'integer range 2 .. 115200', since any value outside that range will not work and your code will silently do the wrong thing. > in_char := COM_PORT.MCR_set_DTR + COM_PORT.MCR_set_out2; -- clear RTS = line Which do you want, DTR or RTS? The comment disagrees with the code. BTW, how long does a PORT.OUT_BYTE take on your system? Do you really need to keep setting DTR after every byte received?