Handshakeing for serial port..

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rajesh6695
    New Member
    • Oct 2006
    • 96

    Handshakeing for serial port..

    Hai

    I checked many sites no one had given how to implement a handshaking for serial port comminucation i am using _bios_serialcom () function. to communicate with hardware through serial port it is communicating fine without any problem but my requirement is when ever the data is ready we have to read that data.That i had done by checking the status value with 0x100...Is there any posiibilites to set or reset that particular bit by the user...

    Finaly i want to know wheather user can set or reset the bits of status signal returned by the _bios_serialcom () function.....

    I had checked the below link also the information is not available......
    http://www.geocities.c om/horacespider/Serial_IO/TurboC_V3/TERMINAL.C
  • Banfa
    Recognized Expert Expert
    • Feb 2006
    • 9067

    #2
    What are the system specs for the target hardware? Processor, Memory, OS etc?

    Comment

    • rajesh6695
      New Member
      • Oct 2006
      • 96

      #3
      OS: dos 6.22
      compiler : Borland C++ 4.5

      The Hardware (millivoltmeter ) whenever user send any command to hardware then hardware will send six bytes of data to the system....i am receiving those six bytes of data by using _bios_serialcom () one by one by checking that dataready bit is set or reset. By (486 machine )old system is receiving data without any loss but the Pentium 4 is missing some data..

      Shall i PM the code to you?

      Comment

      • Banfa
        Recognized Expert Expert
        • Feb 2006
        • 9067

        #4
        Originally posted by rajesh6695
        Shall i PM the code to you?
        Erm, no I don't think so.

        It is a long time since I have worked with Serial Coms using DOS (11+ years) however my memory is that for reliable communications we ditched _bios_serialcom () and wrote our own device driver in assembler. From memory it only took a page or so of assembler (with the rest of the code in C).

        My recolection of _bios_serialcom is patchy but I do not think that it is a complete or reliable impelementation of a serial port driver.


        This may not be much help to you in which case sorry.

        Comment

        • rajesh6695
          New Member
          • Oct 2006
          • 96

          #5
          Is there any other way to acess Serial port in dos under c....Other than _bios_serialcom ()...

          I think inport() outport() will not be reliable as much as _bios_serialcom () is it? bcz we dont know weather the data is received in a serial port....

          Is there any other way to check the serialport status....

          Comment

          • horace1
            Recognized Expert Top Contributor
            • Nov 2006
            • 1510

            #6
            Originally posted by rajesh6695
            Is there any other way to acess Serial port in dos under c....Other than _bios_serialcom ()...

            I think inport() outport() will not be reliable as much as _bios_serialcom () is it? bcz we dont know weather the data is received in a serial port....

            Is there any other way to check the serialport status....
            the Turbo C code for DOS in rs_lib.c in
            Latest news coverage, email, free stock quotes, live scores and video are just the beginning. Discover more every day at Yahoo!


            talks directly to the hardware using inp() and outp(), it is interrupt driven storing the incomming data in a 1024 byte ring buffer - I have used this (and still use it under Windows 98) to talk to embedded systems at speeds of up to 115200baud. So long as you can empty the buffer faster than it fills you should be OK.
            It will do CTS/RTS hardware handshaking - however I usually don't bother. You could add software handshaking using XON/OFF protocol

            Comment

            Working...