Accessing the UART with Win2000

D

Dabeule

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
 
A

AirPete

Dabeule said:
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.
 
T

Thomas Matthews

Dabeule said:
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, 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
 
A

AirPete

[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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,767
Messages
2,569,570
Members
45,045
Latest member
DRCM

Latest Threads

Top