Compaq COM-2(PC)F Computer Hardware User Manual


 
Appendix
COM-2(PC)F 49
Sample Program 5
This GW-BASIC sample program demonstrates the
receive/transmit-data capability of COM-2(PC)F in Enhanced mode.
First, it initializes the ACE, it then receives the data input from the
keyboard through CN1. Finally it outputs the data to CRT through
CN2.
Figure 6.7. Flowchart of Sample Program 5
1
1
Set Baud Rate
Generator
2
1
Channel 1
Channel 2
START
Set
Interrupt Enable Register
Set Baud Rate
Generator
Set Transmission Format
(Line Control Register)
Wait Time
(After Initialization)
Set Modem Control
Output
Read
Line Status Register
Read
Received Data Register
Read
Interrupt ID Register
Read
Modem Status Register
Set
Interrupt Enable Register
Set Transmission Format
(Line Control Register)
Wait Time
(After Initialization)
Set Modem Control
Output
Read
Line Status Register
Read
Received Data Register
Read
Interrupt ID Register
Read
Modem Status Register
None Key
In Key
No
Line Status
D5 bit = 1
Yes
2
Data Transmission
A$=INKEY$
No
Line Status
D0 bit = 1
Yes
Display File Buffer's Data
On CRT
1
1
Note:
Wait Time =
(sec)
Data Length
Baud Rate