473,385 Members | 1,409 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

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.com/horacespider/Serial_IO/TurboC_V3/TERMINAL.C
Mar 6 '07 #1
5 2734
Banfa
9,065 Expert Mod 8TB
What are the system specs for the target hardware? Processor, Memory, OS etc?
Mar 6 '07 #2
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?
Mar 6 '07 #3
Banfa
9,065 Expert Mod 8TB
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.
Mar 6 '07 #4
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....
Mar 6 '07 #5
horace1
1,510 Expert 1GB
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
http://www.geocities.com/horacespide...l_IO/TurboC_V3

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
Mar 6 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: ^CeFoS^ | last post by:
Hello to everybody, I've done an application that draws in a frame the trajectory of a robot. The robot position is readed through the serial port, and several commands are wrote through the...
2
by: willie | last post by:
Hi, I'm writing a program which requires the use of three serial ports and one parallel port. My application has a scanning devices on each port, which I can access fine with pyserial. ...
3
by: collinm | last post by:
hi i send a command to a led display, the led display is suppose to return me some character i write a string on a serial port void ledDisplayExist() { char msg={'\0', '\0', '\0', '\0',...
13
by: Al the programmer | last post by:
I need to access the serial ports on my webserver from an asp.net page. I have no problem accessing the serial ports from a windows form application, but the code doesn't work in asp.net. I have...
4
by: joe bloggs | last post by:
I am writing a mobile application to interface with a legacy system and I am planning to use web services to communicate with this system. The legacy system receives data through a serial port. ...
4
by: Frank | last post by:
Hello, how to get information about all serial ports in the PC? I use the following code, but i got only the data of the FIRST serial port. All other serial port information are not available...
13
by: Rob | last post by:
Hi all, I am fairly new to python, but not programming and embedded. I am having an issue which I believe is related to the hardware, triggered by the software read I am doing in pySerial. I...
0
by: [david] | last post by:
http://pyserial.sourceforge.net/ "port numbering starts at zero, no need to know the port name in the user program" But the implementation in SerialWin32 is just (Portnum +1)
6
by: terry | last post by:
Hi, I am trying to send a character to '/dev/ttyS0' and expect the same character and upon receipt I want to send another character. I tired with Pyserial but in vain. Test Set up: 1. Send...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.