Appendix
COM-2(PC)F 49Sample Program 5This GW-BASIC sample program demonstrates thereceive/transmit-data capability of COM-2(PC)F in Enhanced mode.First, it initializes the ACE, it then receives the data input from thekeyboard through CN1. Finally it outputs the data to CRT throughCN2.Figure 6.7. Flowchart of Sample Program 5
1
1
Set Baud Rate
Generator
2
1
Channel 1Channel 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 KeyIn Key
NoLine Status
D5 bit = 1
Yes
2
Data Transmission
A$=INKEY$
NoLine Status
D0 bit = 1
Yes
Display File Buffer's Data
On CRT
1
1
Note:Wait Time =(sec)
Data Length
Baud Rate