AX10445 Module Series User's Manual
4.3 Demo Program for Turbo Pascal
{ This is a demo program for turbo pascal }
program demo485;
uses crt, dos;
const
pa = $3f8;
mask = $ef;
intno = $c;
bufsize = 255;
var
rxbuf : array[1..bufsize] of byte;
ii,i : word;
is_485 : boolean;
int_id : word;
intbuf : pointer;
(* bios int 14 call *)
procedure int14_0(port,para:word);
inline(
(* interrupt service routine *)
Procedure ch_isr(flags,cs, ip,ax,bx,cx,dx,si,di,ds,es,bp:word);
interrupt;
begin
inline($FB);
int_id :=port[pa+2];
if (int_id >= 4) then
begin
end;
end;
(* communication port initialization *)
procedure com_init;
24
$58/
$5A/
$B4/$00/
$CD/$14);
rxbuf[ii] := port[pa];
ii :=ii + 1;
port[$20] :=$20;
(* com port data define *)
(* buffer size *)
(* receiver buffer *)
(* index count *)
(* mode flag *)
(* interrupt identification
*)
(* pop ax *)
(*pop dx *)
(* mov ah,0 *)
(*int 14 *)
(* sti *)
(* get interrupt id. *)
(* check received data *)
(* store into buffer *)
(* inc index *)
(* send EOI *)
Application
Need help?
Do you have a question about the AX10445 Series and is the answer not in the manual?
Questions and answers