Connecting Tech Pros Worldwide Forums | Help | Site Map

Accessing the UART with Win2000

Dabeule
Guest
 
Posts: n/a
#1: Jul 22 '05
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

AirPete
Guest
 
Posts: n/a
#2: Jul 22 '05

re: Accessing the UART with Win2000


"Dabeule" <dabeule@yahoo.fr> wrote in message
news:5cea160c.0402030516.1db6450d@posting.google.c om...[color=blue]
> 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 ![/color]

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.

[color=blue]
>
> Thanks with advance
>
> Vincent[/color]


Thomas Matthews
Guest
 
Posts: n/a
#3: Jul 22 '05

re: Accessing the UART with Win2000


Dabeule wrote:[color=blue]
> 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[/color]

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

AirPete
Guest
 
Posts: n/a
#4: Jul 22 '05

re: Accessing the UART with Win2000


[snip]
[color=blue]
>
> 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.[/color]

Fortunatly, that won't work on Windows NT, unless you write a driver.
[color=blue]
>
> --
> 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
>[/color]


Closed Thread