AX10445 Module Series User
’
s Manual
Application
24
4.3 Demo Program for Turbo Pascal
{ This is a demo program for turbo pascal }
program demo485;
uses crt, dos;
const
pa = $3f8;
(* com port data define *)
mask = $ef;
intno = $c;
bufsize = 255;
(* buffer size *)
var
rxbuf : array[1..bufsize] of byte;
(* receiver buffer *)
ii,i : word;
(* index count *)
is_485 : boolean;
(* mode flag *)
int_id : word;
(* interrupt identification
*)
intbuf : pointer;
(* bios int 14 call *)
procedure int14_0(port,para:word);
inline(
$58/
(* pop ax *)
$5A/
(*pop dx *)
$B4/$00/
(* mov ah,0 *)
$CD/$14);
(*int 14 *)
(* interrupt service routine *)
Procedure ch_isr(flags,cs, ip,ax,bx,cx,dx,si,di,ds,es,bp:word);
interrupt;
begin
inline($FB);
(* sti *)
int_id :=port[pa+2];
(* get interrupt id. *)
if (int_id >= 4) then
(* check received data *)
begin
rxbuf[ii] := port[pa];
(* store into buffer *)
ii :=ii + 1;
(* inc index *)
port[$20] :=$20;
(* send EOI *)
end;
end;
(* communication port initialization *)
procedure com_init;
Содержание AX10445 Series
Страница 1: ...AX10445 Series Isolated Dual Channel RS422 485 Interface Module User s Manual...
Страница 10: ...AX10445 Module Series User s Manual 4 This page does not contain any information...
Страница 20: ...AX10445 Module Series User s Manual Setting up the AX10445 14 This page does not contain any information...
Страница 41: ...AX10445 Module Series User s Manual Application 33 return 0 void Reset_Buf rear1 front1 rear2 front2 0...
Страница 46: ...AX10445 Module Series User s Manual 36 This page does not contain any information...
Страница 48: ...AX10445 Module Series User s Manual 38 This page does not contain any information...
Страница 50: ...AX10445 Module Series User s Manual 40 This page does not contain any information...
Страница 52: ...AX10445 Module Series User s Manual 42 This page does not contain any information...
Страница 54: ...AX10445 Module Series User s Manual 44 This page does not contain any information...
Страница 58: ...AX10445 Module Series User s Manual 48 This page does not contain any information...