how to input data from Data port of LPT ?
1 回表示 (過去 30 日間)
古いコメントを表示
I am trying to interface ADC0808 through parallel port . the port 0 (data port) is configured as input port to read 8bit ADC data, while port 1 (status port ) and port 2 (Control port) are used for facilitating handshake signals.
During booting of my on HP machine under Windows XP, I have set port as 'Bidirectional' in BIOS. I wrote following code:
close all;
clear all
clc;
dio = digitalio('parallel','LPT1');
P0=addline(dio,0:7,0,'in') %DATA PORT, port no. 0 Input port
P1=addline(dio,0:4,1,'in')% STATUS PORT, port no. 1, Input port
P2=addline(dio,0:3,2,'out')% CONTROL PORT, port no. 2 Output port
hwinfo = daqhwinfo(dio);
hwinfo displayed the desired port setting with line port 0 as input, port 1 as input and port 2 as output ports.
testing the input port with >> putvalue(P0,0) gives
??? Error using ==> dioline.putvalue
correctly indicating Line(1) is configured for input.
However, when a high signal (abt +4.5 V) or low level signal (0 V) is applied to any input of port 0, the line status remains unchanged. The port 0 configured as input port is not reading the data. Why the port 0 is not accepting the input?
Ashutosh
1 件のコメント
Walter Roberson
2012 年 6 月 1 日
You do not mention also using the strobe signal? Parallel ports only read when the strobe is detected.
回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Signal Integrity Kits for Industry Standards についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!