|
-
April 20th, 2001, 03:43 AM
#1
sending a byte to serial port
Hello,
How can I send a byte (-> 8 bits) to a serial port ?
Is there a program for testing this ?
(e.g. Hyperterminal)
Or can I use a dos-prompt for doing this ?
With kind regards.
-
May 2nd, 2001, 04:18 AM
#2
Re: sending a byte to serial port
try out the following in c for this you need to include dos.h file in your dos development enviorment
outportb(potrtaddress, data)
eg. outportb(ox2f8, 0xff) ; //to send 255
In order to check the the transfer I beleive you can short the pins 2 and 3 with a led or wire and check for the same data in the input stream buffer of the serial port using inportb() function in TC++ or borland C++
If you are unable to do the aforesaid feel free to contact
-
June 14th, 2001, 09:32 PM
#3
Re: sending a byte to serial port
Hi..
I am interested to know more about using serial port in the my program
however, i have lack of idea about dos.h library.. where could i find the info, or could you send me a copy if you have one..
thanks
-
June 14th, 2001, 09:59 PM
#4
Re: sending a byte to serial port
hai
I am interested to know more about dos.h and the call function associated with it eg outportb and inportb
well, i you can say that I AM INTERESTED with serial programming
and IT IS MY FIRST TIME.. any help???
your help is higly appreciated
regards
-
June 14th, 2001, 11:59 PM
#5
Re: sending a byte to serial port
hi there,
Before I can tell you more about dos.h I would like to know development platform and OS you r doing your coding, as dos.h is not packaged with all the compilers.
I would like you to appreciate by rating the post.
Thanks
Shyam
-
June 15th, 2001, 03:42 AM
#6
Re: sending a byte to serial port
well.. i am thinking of using borland c++ version 4.. but i have been looking at MFC library.. and I talk with my boss.. he said that he may bought me VC++ V6 for me..i am using win 95&98
which one is the best compiler?
-
July 23rd, 2001, 08:55 AM
#7
Re: sending a byte to serial port
The complexity of this depends on whether youre using win32 or a dos-based program. For dos, you can just outportb to 0x3f8 the byte you want to send. For win32 it is more complicated, you have to set up the serial port as a file using CreateFile (look in msdn for usage), and setup a hFile. I personally would recommend using dos for simplicity. For dos, code examples are all over the web, including ones with software interrupts.
-
January 29th, 2002, 01:06 PM
#8
Re: sending a byte to serial port
I want to receive bytes from serial port ie. I want to get output of epabx to computer and want to save in windows environment .cause at present in dos i have
a utility calle gcap...
thak you,
Mahedra
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|