Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!uwvax!astroatc!nicmad!madnix!rat From: rat@madnix.UUCP (David Douthitt) Newsgroups: comp.sys.apple Subject: Re: Interrupt handling with a modem in CP/M Message-ID: <741@madnix.UUCP> Date: 23 Jul 89 02:55:16 GMT Reply-To: rat@madnix.UUCP (David Douthitt) Distribution: usa Organization: ARP Software, Madison, WI Lines: 49 Brian Willoughby (brianw@microsoft.UUCP) wrote: | | In article <1622@sactoh0| ianj@sactoh0 (Ian R. Justman) writes: | | | | I need some help with writing a driver for a communications program | | when using CP/M. ... | | I wrote an interrupt handling routine which is activated when a | | character comes in and shoves the character into a circular buffer | | within the driver space (it is 256 characters long, BTW...). Even | | with that in place, I still lose characters ... | | Try doubling the circular buffer size and rewriting the interrupt | routine. | How does the interrupt routine handle buffer full condiitions? Are you | detecting when the buffer fills? My interrupt routines increment a LOST | count every time a new character interrupt tries to add a character to a | full buffer. Then, when my program is running, I can check this value | and print an error message showing how many characters were lost. If I | see the error message, this is a sure sign that I need to increase the | buffer size for that application. One other thing is what CP/M card you're using. If you use the PCPI Applicard running at 6MHz, unless I'm mistaken, the Apple's 6502 (which handles the I/O) can't keep up with the Z80. This trouble could also be apparent in the Microsoft Z80 card. You should also make sure that your interrupt handler is behaving properly: 1] Do you detect buffer full? 2] Do you detect buffer empty? 3] Is your interrupt handler small and fast? .. you could be losing characters due to your handler being too slow.. 4] Are you turning interrupts off at the appropriate point? .. otherwise you might have one interrupt clobbering another with disastrous results.. Hope these help.. [david] -- !======= David Douthitt :::: Madison, WI =======!== The Stainless Steel Rat ==! ! ArpaNet: madnix!rat@cs.wisc.edu ! ! ! UseNet: ...uwvax!astroatc!nicmad!madnix!rat ! Mad Apple Forth: ! ! {decvax!att}! ! The Madness starts here. !