Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
08/24/03 19:18
Read: times


 
#53244 - RE: getch()
Responding to: ???'s previous message
And directly reading the PC UART data input register at 0x2F8 in the manner described is ridiculous. You should, if it is even legitimate to be reading the UART directly, be first polling the status register bit of the UART that tells you if there if a byte has been received.

This direct access of the UART would only be legitimate, provided the appropriate programming was being done, under DOS, PCDOS, MSDOS, ROMDOS, or a Virtual 86 DOS box under Win 3.1, Windows for Workgroups, Win 95 or Win 98.

There are scads of resources available on the web to show how to properly access the PC UART if you have the "DOS" environment. All you have to do is search for them.

There is a mountain of information regarding using the serial port on an 8051 type processor right here on this web site. THe webmaster has even provided a good search feature on the forum page to find some of that information.

The shown PC access code is a hokey implementation if at best! And the much more likely situation is that there are any one of a number of factors that make this completely bogus!!

What is the COM port number?
Has the BIOS mapped that COM port number to 0x2F8 -> 0x2FF? (It may not even have done so).
Has the COM port mapping table at 0x40:8 been consulted?
Is the host PC OS environment condusive to direct UART access?
PC UARTS need initialization in order to run properly, so has that been done? and How?
The UART may or may not use interrupts. Has that been taken into account?
The UART will set a status bit in its status register when a received byte arrives. Why is that not being polled?

Michael Karas





List of 12 messages in thread
TopicAuthorDate
Serial Port ?            01/01/70 00:00      
   RE: Serial Port ?            01/01/70 00:00      
      RE: Serial Port ?            01/01/70 00:00      
         RE: Serial Port ?            01/01/70 00:00      
            RE: Serial Port ?            01/01/70 00:00      
   RE: Serial Port ?            01/01/70 00:00      
      PS:            01/01/70 00:00      
         getch()            01/01/70 00:00      
            RE: getch()            01/01/70 00:00      
               RE: getch()            01/01/70 00:00      
                  RE: getch()            01/01/70 00:00      
                     RE: getch()            01/01/70 00:00      

Back to Subject List