I'm trying to read a single byte from a com port using _bios_serialcom function. I'm using windows vista and borland C++ 5.02 compiler. Here is my code:
A microcontroller send the byte to com port of PC but the result is nothing.(I have checked that microcontroller sends the byte right with hyper terminal). I need to use it in a larger program which will read data from com port and then shows them to the monitor. So, you think that is something wrong in my code?
/* PC-to-AVR communication – by sakis papamichalis */
/* An application for PC which receives a single byte from a mikrocontroller */
#define SETTINGS (_COM_9600 | _COM_CHR8 | _COM_NOPARITY | _COM_STOP1)
/* baud rate = 9600, 8 data bits, no parity bit, 1 stop bit */
printf("Select Port (Enter 0 for COM1 and 1 for COM2):");
I have seen that _bios_serialcom works only in DOS OS. Is there any other way to read data from com port in borland?
I'm a little bit confused with comuter programming because i'm familiar with C programming for microcontrollers.
Thanks for any help