In Turbo C , I am using bios.h to send and receive data on serial Port. I am using bios(2, 0, COM1) to receive data.... and
bios(1, in, COM1) to send data..where (let int in=65
I am receiveing data from Port but unable to send... I copied code from http://electrosofts.com/serial/
**********************************************************
#include <bios.h>
#include <conio.h>
#define COM1 0
#define DATA_READY 0x100
#define SETTINGS ( 0xE0 | 0x10 | 0x00 | 0x03)
// 0xE0 = 9600, 0x10 = Even Parity, 0x00 = (stop bit =1), 0x03 = 8 bit
int main(void)
{
int in, out, status;
bioscom(0, SETTINGS, COM1); /*initialize the port*/
cprintf("Data sent to you: ");
while (1)
{
status = bioscom(3, 0, COM1); /*wait until get a data*/
if (status & DATA_READY)
if ((out = bioscom(2, 0, COM1) & 0x7F) != 0) /*input a data*/
putch(out);
if (kbhit())
{
if ((in = getch()) == 27) /* ASCII of Esc*/
break;
bioscom(1, in, COM1); /*output a data*/
}
}
return 0;
}
**********************************************************
please help me...if anybody is having any idea...
(no problem in my PC's Serial port.. )