Bioscom serial communication

This is a discussion on Bioscom serial communication within the C Programming forums, part of the General Programming Boards category; Hello, Do some of you still make programs for DOS ? I am now using Borland Turbo C 2.01 on ...

  1. #1
    Registered User
    Join Date
    Mar 2004
    Posts
    8

    Bioscom serial communication

    Hello,

    Do some of you still make programs for DOS ?
    I am now using Borland Turbo C 2.01 on an IBM PC 433DXS with DOS 6.20.
    I'm trying to make a program which read NMEA data coming for a GPS connected to the serial port.
    The bioscom function seems very handy and easy to use, so I copy the following program from Borland documentations :

    #include <bios.h>
    #include <conio.h>

    #define COM1 0
    #define DATA_READY 0x100
    #define TRUE 1
    #define FALSE 0

    #define SETTINGS ( 0xC0 | 0x03 | 0x00 | 0x00) /* 4800 baud, no parity, 8 bits, 1 stop */

    void main(void)
    {
    int in, out, status, DONE = FALSE;

    bioscom(0, SETTINGS, COM1);
    cprintf("... BIOSCOM [ESC] to exit ...\n");
    while (!DONE)
    {
    status = bioscom(3, 0, COM1);
    if (status & DATA_READY)
    if ((out = bioscom(2, 0, COM1) & 0x7F) != 0)
    putch(out);
    if (kbhit())
    {
    if ((in = getch()) == '\x1B')
    DONE = TRUE;
    bioscom(1, in, COM1);
    }
    }
    }

    The program compiles and run, but no incoming data is displayed on the screen.
    Do I need to configure something in the computer to make the communication work ?

    All the best

    Pierre Brial

  2. #2
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,796
    >Do some of you still make programs for DOS ?
    We used to have a DOS Programming forum. Now we don't. 'Nuff said.

    >Do I need to configure something in the computer to make the communication work ?
    I don't know. What little I remember of DOS programming doesn't involve bioscom. Perhaps a DOS programming newsgroup would suit you better?
    My best code is written with the delete key.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Duplex communication thro serial port
    By Priyachu in forum Networking/Device Communication
    Replies: 1
    Last Post: 05-30-2009, 04:24 AM
  2. Duplex communication thro serial port
    By Priyachu in forum Linux Programming
    Replies: 1
    Last Post: 05-30-2009, 04:03 AM
  3. Serial pot communication through c program
    By vin_pll in forum C++ Programming
    Replies: 2
    Last Post: 01-01-2009, 11:52 AM
  4. Please help with serial communication problem - Long
    By spdylude in forum Windows Programming
    Replies: 3
    Last Post: 04-06-2005, 09:41 AM
  5. Serial communication packets
    By Roaring_Tiger in forum C Programming
    Replies: 3
    Last Post: 04-26-2003, 08:33 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21