473,406 Members | 2,707 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,406 software developers and data experts.

Accessing the UART with Win2000

Hello,

I have to read/write in the UART to transfer bytes through the serial
port. I use Visual C++ 6 and Win2000.
When I used Win98, the problem was easy : the functions _inp and _outp
(or the file port95nt.dll) allow to read/write on the UART. But these
functions (or this DLL) do not work...
If anyone knows how to have the rights to access the UART with Win2000
or the functions to use in VC++, please help me !

Thanks with advance

Vincent
Jul 22 '05 #1
3 1901
"Dabeule" <da*****@yahoo.fr> wrote in message
news:5c**************************@posting.google.c om...
Hello,

I have to read/write in the UART to transfer bytes through the serial
port. I use Visual C++ 6 and Win2000.
When I used Win98, the problem was easy : the functions _inp and _outp
(or the file port95nt.dll) allow to read/write on the UART. But these
functions (or this DLL) do not work...
If anyone knows how to have the rights to access the UART with Win2000
or the functions to use in VC++, please help me !
I *think* you can use CreateFile and the associated functions to do this,
but I'm not sure...
The folks over in microsoft.public.dotnet.languages.vc would be able to help
you better.


Thanks with advance

Vincent

Jul 22 '05 #2
Dabeule wrote:
Hello,

I have to read/write in the UART to transfer bytes through the serial
port. I use Visual C++ 6 and Win2000.
When I used Win98, the problem was easy : the functions _inp and _outp
(or the file port95nt.dll) allow to read/write on the UART. But these
functions (or this DLL) do not work...
If anyone knows how to have the rights to access the UART with Win2000
or the functions to use in VC++, please help me !

Thanks with advance

Vincent


UARTs are a platform specific feature and thus are off-topic
in this newsgroup, news:comp.lang.c++. Please read the
welcome.txt and FAQ below for more information on which
newsgroups to post to.

That said, I just assign pointers to the various UART
registers and access them by dereferencing the pointers:
volatile char * const UART_STATUS_REG =
(volatile char * const) 0x43000;
// to get the status:
unsigned char status = *UART_STATUS_REG;
But then, I am not working on a Windows platform.

--
Thomas Matthews

C++ newsgroup welcome message:
http://www.slack.net/~shiva/welcome.txt
C++ Faq: http://www.parashift.com/c++-faq-lite
C Faq: http://www.eskimo.com/~scs/c-faq/top.html
alt.comp.lang.learn.c-c++ faq:
http://www.raos.demon.uk/acllc-c++/faq.html
Other sites:
http://www.josuttis.com -- C++ STL Library book

Jul 22 '05 #3
[snip]

That said, I just assign pointers to the various UART
registers and access them by dereferencing the pointers:
volatile char * const UART_STATUS_REG =
(volatile char * const) 0x43000;
// to get the status:
unsigned char status = *UART_STATUS_REG;
But then, I am not working on a Windows platform.
Fortunatly, that won't work on Windows NT, unless you write a driver.

--
Thomas Matthews

C++ newsgroup welcome message:
http://www.slack.net/~shiva/welcome.txt
C++ Faq: http://www.parashift.com/c++-faq-lite
C Faq: http://www.eskimo.com/~scs/c-faq/top.html
alt.comp.lang.learn.c-c++ faq:
http://www.raos.demon.uk/acllc-c++/faq.html
Other sites:
http://www.josuttis.com -- C++ STL Library book

Jul 22 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Arnold | last post by:
I want to use python to communicate with UART port in my PC, how can I achieve this? any modules need to be installed? Thanks
1
by: Peter Nolan | last post by:
Hi All, I have some software that currently loads database tables into sorted arrays in memory to be binary searched by processes. (Long story as to why it does this..) Each process must either...
4
by: amorphous999 | last post by:
I will be creating a small web site using php/apache/SQL Server running on a Win2000 server. It sounds as if there a number of alternatives for accessing SQL Server: mssql* functions, ADOdb...
2
by: Petr Jakes | last post by:
Hi, I am trying to set-up communication to the coin change-giver from my Linux box using the Python code. The change giver uses MDB (Multi Drop Bus) serial protocol to communicate with the...
2
by: Grei | last post by:
how can i impersonate from win2000 to WinXP? in MSDN says: (gives example how to implemet it but not with win2000, and it doesn't say what to do on win2000!!!) any ideas? workarounds? Thanx! ...
4
by: Strahimir Antoljak | last post by:
I completed a VB.NET application and it runs fine on WinXP. I wanted to run it on Win2000 and it is not working. Is it not supposed to work on Win2000 too? (I installed .NET framework distributable...
3
by: sundarr | last post by:
Hi all, I am doing some work on UART. the code to recieve data on my UART from Hyperterminal is as follows: Recieve(Count, Destination) { //Monitor the port to recieve data and continously...
2
by: wizche | last post by:
Hi, I'm currently trying to develop a IR Remote (TV consumer) listener in C under Linux. First of all I tried with an old notebook with an integrated IR peripheral (FIR)under Debian (kernel...
2
by: wizche | last post by:
Hi, I'm currently trying to develop a IR Remote (TV consumer) listener in C under Linux. First of all I tried with an old notebook with an integrated IR peripheral (FIR)under Debian (kernel...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.