PT630 Programming Reference Guide
Page 52 of 59
------------------------------------------------------------------------------------------------------------------
1.8
COM1 RS232 Control Functions ( INT 33H )
1.8.1 Set Communication Parameters
Entry Parameter: AH = 0
AL bits 7-4: 0001xxxx
baud 150
0010xxxx
baud
300
0011xxxx
baud
600
0100xxxx
baud
1200
0101xxxx
baud
2400
0110xxxx
baud
4800
0111xxxx
baud
9600
1000xxxx
baud
19200
1001xxxx
baud
38400
1010xxxx
baud
57600
bits
3-2:
xxxx00xx
none
parity
xxxx01xx
odd
parity
xxxx11xx
even
parity
bit
1:
xxxxxx0x
one
stop
bit
xxxxxx1x
two
stop
bits
bit
0:
xxxxxxx0
7
data
bits
xxxxxxx1
8
data
bits
Return
Value:
None
Example
:
int TC_232_parameter(long baud,int parity,int stop,int data)
{
unsigned char cc=0;
unsigned int i_baud;
i_baud = (int)(baud / 10L);
switch (i_baud)
{
case 11 : cc=0x00; break;
case 15 : cc=0x10; break;
case 30 : cc=0x20; break;
case 60 : cc=0x30; break;
case 120 : cc=0x40; break;
case 240 : cc=0x50; break;
case 480 : cc=0x60; break;
case 1920 : cc=0x80; break;
case 3840 : cc=0x90; break;
case 5760 : cc=0xA0; break;
default: cc=0x70; break;
}
switch (parity)
{
case 0 : break;
case 1 : cc=cc|0x04; break;