reading from printer port

hello I'm student of mechanical engineering. In a project I subjected with this problem : I want the computer to show if the door-bell is ringing or not, but I know alittle about printer ports, only I want the computer to show an alarm that "the bell is ringing" when it's ringing. when I searched I faced with many graet information about "Use of a PC Printer Port for Control" but I want an easy method for my problem (they were too hard for me to understand). please help me. I use c, c++ for the programming

Reply to
shahin.gharagozlou
Loading thread data ...

You will have to make a gizmo to pull the parallel port status pins low when the bell is rung and be able to read the status of the status pins while the bell is being rung. You might be able to do something similar with the serial port by putting something in the receive buffer when the bell is rung, and then checking the buffer content for input. Below is a link to some simple parallel port stuff I've tinkered with.

formatting link

Reply to
Si Ballenger

There's a lot of port info at

formatting link
However, note that if you have anything later than Win9x, you will need a special ring 0 driver (GIVEIO and USERPORT are two options) in order to get direct access to the port. Win9x and earlier allow direct access, and they also allow real-mode DOS operation which NT, 2K, and XP don't.

If you are using real-mode DOS you can have your doorbell trip the printer port interrupt, so the computer won't have to watch continuously in a loop. But it actually wouldn't be a big drag on the system to just check at every tmer tick (18.2 times per second.) In Windows, you could set a timer for 100 msec or so.

Best regards,

Bob Masta dqatechATdaqartaDOTcom D A Q A R T A Data AcQuisition And Real-Time Analysis

formatting link
Home of DaqGen, the FREEWARE signal generator

Reply to
Bob Masta

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.