Connecting Tech Pros Worldwide Help | Site Map

Accessing the UART with Win2000

 
LinkBack Thread Tools Search this Thread
  #1  
Old July 22nd, 2005, 06:05 AM
Dabeule
Guest
 
Posts: n/a
Default 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

  #2  
Old July 22nd, 2005, 06:05 AM
AirPete
Guest
 
Posts: n/a
Default 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]


  #3  
Old July 22nd, 2005, 06:06 AM
Thomas Matthews
Guest
 
Posts: n/a
Default 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

  #4  
Old July 22nd, 2005, 06:06 AM
AirPete
Guest
 
Posts: n/a
Default 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]


 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,840 network members.