Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
08/01/08 09:29
Read: times


 
Msg Score: -1
 -1 Off-Topic
#157215 - re
Responding to: ???'s previous message
Hi Eric,
You enable interrupts, but who handles these interrupts?
Maybe handler reads data before You?

Below are routines i use from long time under DOS/Win98.
Hope this helps.



procedure calcadresses;
begin
aRSbaudfactor:=aRSbase ;
aRSlinectrl:=aRSbase+3{ $2fb};
aRSstatusline:=aRSbase+5{ $2fd};
aRSbuf:=aRSbase;
aRSirqctrl:=aRSbase+1 {2f9};
aRSmodemctl:=aRSbase+4{ $2fc};
aRSmodemstat:=aRSbase+6{ $2fe};
aRSirqident:=aRSbase+2{ $2fa};
end;
procedure RSbaudfactorcalc;
begin
RSbaudfactor:=round((1843320/16)/RSbaud);
end;
procedure RS232init;
var work:byte;
NS16550Flag,FIFOActiv:Boolean;
begin
work:=port[arsbuf];
work:=port[arsstatusline];
RSbaudfactorcalc;
PORT[aRSlinectrl]:=$83;{acces to baudfactor}
PORTW[aRSbaudfactor]:=RSbaudfactor;
case RSstopbit of
1:PORT[aRSlinectrl]:=$03;{acces to in-out buf,1 stopbit}
2:PORT[aRSlinectrl]:=$07;{acces to in-out buf,2 stopbit}
else
begin
PORT[aRSlinectrl]:=3;
rsstopbit:=1;
end;
end;{case}
work:=port[arsbuf];
work:=port[arsstatusline];
work:=port[arsmodemstat];

port[eoireg]:=$20;
PORT[aRSmodemctl]:=8;
{ TEST 16550 ??? not completed??}

FIFOActiv:=true;{??? not clear for me how to be}
work:=Port[aRSirqident];
IF ((work AND $C0) > 0) THEN
NS16550Flag:=TRUE
ELSE
BEGIN
PORT [aRSirqident]:=$01;
work:=PORT [aRSirqident];
NS16550Flag:=((work AND $C0) > 0);
END; (* of ELSE *)
IF NS16550Flag THEN BEGIN
IF FIFOActiv THEN
begin
PORT [aRSirqident]:=$00 {e1};
PORT [aRSirqident]:=$01 {e1};
PORT [aRSirqident]:=$1 {e1};
end
ELSE PORT [aRSirqident]:=0;
END; (* of IF *)
work:=port[arsbuf];
work:=port[arsstatusline];
PORT[aRSirqctrl]:=3;
end;


List of 5 messages in thread
TopicAuthorDate
16550 UART Initialization Routine            01/01/70 00:00      
   re            01/01/70 00:00      
   You might look in the early PC hardware manual            01/01/70 00:00      
   Check the value of LSR...            01/01/70 00:00      
   FIFO May Be Fooling You            01/01/70 00:00      

Back to Subject List