TIP: Click on subject to list as thread! ANSI
echo: power_bas
to: RODERICK RIENSCHE
from: ERIC SCHONNING
date: 1995-08-17 07:40:00
subject: Re: Interrupt Driven Comm

RR> Does anyone know where I can find some good Interrupt driven serial
RR> communications source for PowerBasic 3.0?  I'm working on some and
RR> having a problem with missing most of the data the modem sends (I gues
RR> it's something wrong with my interrupt handler?).
 
The internal PB comm code (open "com#"...) is interrupt driven.  Did
that not work for you?  Also, I've noticed that you can turn on the
16550 FIFO buffers after you open the port and PB will use them and
cut down on error 57's without using the ME option, which of course
would do away with most error 57 problems.  I posted a file on the PB
BBS called 16550.ZIP, but for a quicky you can turn them on by OUT'ing 
to one of the UART registers.  Here is some sample code:
 
'select the right com port before running this
'comport=1:ba=&h3f8   'COM1, base address 3F8h
comport=2:ba=&h2f8   'COM2, base address 2F8h
'comport=3:ba=&h3e8   'COM3, base address 3E8h
'comport=4:ba=&h2e8    'COM4, base address 2E8h
out ba+2,7   'turn 16550 buffers on
'out ba+2,0  'turn 16550 buffers off
iir?=inp(ba+2)
if (iir? and &hc0) then print "FIFO Buffer ON" else print "FIFO Buffer
OFF"
 
If you use the ME option with open com you will lose characters, so
this is one option.  of course with ME you also won't bomb out of your
program, but you can trap for error 57 when using fifo buffers and
hopefully recover from it (my error handler used to just close the com
port and re-open it, then resume, but without fifo buffers it used to
get caught in a endless loop of doing that).  the 16550.zip on the PB
bbs (I also have it for FREQ here on my BBS at 1:206/2512) shows a bit
more detail on the 16550 register used to fifo buffers if you are
interested.      eric
--- QM v1.00
---------------
* Origin: Creekside Manor (805) 484-8016 CdCom Support BBS (1:206/2512.0)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.