天堂草原最受欢迎的角色,天堂动漫,天堂在线,色天堂下载,天堂中文在线资源,亚洲男人天堂

技術熱線: 4007-888-234
設計開發

專注差異化嵌入式產品解決方案 給智能產品定制注入靈魂給予生命

開發工具

提供開發工具、應用測試 完善的開發代碼案例庫分享

技術支持

從全面的產品導入到強大技術支援服務 全程貼心伴隨服務,創造無限潛能!

新品推廣

提供新的芯片及解決方案,提升客戶產品競爭力

新聞中心

提供最新的單片機資訊,行業消息以及公司新聞動態

串口驅動繼電器

更新時間: 2019-03-23
閱讀量:1665


串口驅動繼電器

Parallel Port Relay Interface



           Below are three examples of controlling a relay from the PC's parallel printer port (LPT1 or LPT2). Figure A shows a solid state relay controlled by one of the parallel port data lines (D0-D7) using a 300 ohm resistor and 5 volt power source. The solid state relay will energize when a "0" is written to the data line. Figure B and C show mechanical relays controlled by two transistors. The relay in figure B is energized when a "1" is written to the data line and the relay in figure C is energized by writing a "0" to the line. In each of the three circuits, a common connection is made from the negative side of the power supply to one of the port ground pins (18-25).



           There are three possible base addresses for the parallel port You may need to try all three base addresses to determine the correct address for the port you are using but LPT1 is usually at Hex 0378. The QBasic "OUT" command can be used to send data to the port. OUT, &H0378,0 sets D0-D7 low and OUT, &H378,255 sets D0-D7 high. The parallel port also provides four control lines (C0,C1,C2,C3) that can be set high or low by writing data to the base address+2 so if the base address is Hex 0378 then the address of the control latch would be Hex 037A. Note that three of the control bits are inverted so writing a "0" to the control latch will set C0,C1,C3 high and C2 low.

联系我们: 布尔津县| 班戈县| 京山县| 鹰潭市| 平乡县| 庆元县| 会宁县| 绍兴县| 封开县| 乌什县| 三亚市| 郴州市| 宁海县| 兴城市| 社会| 隆尧县| 余江县| 馆陶县| 金门县| 湘潭县| 汪清县| 兰州市| 陕西省| 垫江县| 盐城市| 长海县| 扎鲁特旗| 新龙县| 安顺市| 金湖县| 谢通门县| 邢台市| 石阡县| 台北市| 鸡泽县| 固阳县| 宝鸡市| 南康市| 贞丰县| 繁昌县| 遵义市|