 |
|
 |
Hello
If you came to this article from Google because you are looking for a way to measure digital signals via parallel port then have a look at the following article:
17 Channel Logic Analyzer!
* Digital Oscilloscope / Logic Analyzer with up to 17 input lines
* Uses the parallel (printer) port for input.
* While Logic Analyzers normally are very expensive, this one is for zero cost
* Written in speed optimized C++ to get the maximum possible sample rates
* The program is a stand alone single EXE file which neither needs any additional DLLs nor any framework. It runs out of the box
* Runs on all Windows platforms (95, 98, ME, NT, 2000, XP, 2003, Vista, 2008, Windows 7, 2008 R2)
* Runs on 32 Bit Windows and 64 Bit Windows
* When first run, installs a driver to access hardware IO ports on all NT platforms
* Plays a sound via PC speaker to prove that the driver works correctly
* Shows the actual state of the input lines life in the LED's of the GUI
* Captures up to 500.000 samples / second (depending on your hardware and OS)
* Captures to memory (rather than disk) for maximum speed
* Capturing runs always with the maximum frequency that the hardware allows
* Memory saving capture technology stores only the changes of the input lines rather than storing all lines with each sample that is taken
* The capture process is independent of data analyzing so you can try various settings to display the captured data in the best way
* The analyzer generates coloured oscilloscope diagrams with a raster grid
* The output is written into an HTML file and one or multiple GIF files
* So the analyzer results can easily be shared with other people who must not install any program to view a proprietary binary format
* You can write an individual heading into each analyzer output to distinguish them later in a multitude of files
* When analyzing data, you can choose to delete old analyzer output or keep the old files
* The time axis shows absolute or relative time with microsecond precision (Performance Counter)
* Automatic detection of inactive input lines shows only the channels that have activity
* Automatic detection of idle time cuts out long phases of inactivity
* Automatic detection of input frequency chooses the adequate raster unit like on a real oscilloscope (10 µs, 20 µs, 25 µs, 50 µs, 100 µs, etc..)
* Automatic detection of context switches of the operating system
* Decoding of serial protocols like I2C Bus, PS/2 Bus, SMBus, ModBus, SPI Bus, Asynchronous (RS232, RS422, RS485), Infrared Remote Controls, Smartcards is partially already implemented or may be added by you.
* Decoded serial data (Start Bit, Parity, Acknowledge, Stop Bit) and the Byte that they represent is written into the diagram
* Very cleanly written source code with a proper error handling and plenty of comments
Elmü
|
|
|
|
 |
|
 |
Szia gordius!
LPt portra szeretnék olyan érzékelőket rakni, amik Ohm-os ellenállás változást ad (egyfajta potméter), másodpercenként kb 10 érték.
ezeket az ellenállás adatokat szeretném én megjeleníteni (diagrammal, stb.).
Ha tudnál segíteni, azért nagyon hálás lennék, mivel látom, hogy te ebben a dologban otthon vagy...
előre is köszönöm: Lardino
|
|
|
|
 |
|
 |
Hi,
firstly, thanx for your great article and Parallel Interfacing library.
I read somewhere that Data Pin (PIN02-PIN09) are directional, which i assume can be used both to output voltage and read input.
Is that true? or it has another meaning by "supporting both IN/OUT mode"? if it is possible, does PaPiC can do that?
i'm trying to maximize the input number without adding parallel extension card.
thanx.
|
|
|
|
 |
|
 |
Hi,
thanks. I read that Data pins can be used for input but it is a bit more complicated and I didn't dealed with it. I think the direction can be controlled by Control pins. But this is all I know about it. Probably some forums can help..
B.r.
Zsolt
|
|
|
|
 |
|
 |
so do we need to use VC++ for PaPiC or can it done using c++ too?
if c++ then where to find the project folder/menu?
|
|
|
|
 |
|
 |
Sorry, I never tried to use it without VC++.
|
|
|
|
 |
|
 |
Hi,
I'm about to write a program for accessing the parallel port.
But I wonder, if I use "Cpapic" will I be able to generate precise timing. For example, if I'd need a square wave at one of the output pins pulsing at 10Hz, how accurate will it actually be?
Many thanks in advance.
Rouslan
|
|
|
|
 |
|
 |
hi gordius
i have a few questions for you. right now i'm having my final project in my study where i should make a speech recognition program. to put in the voice to the computer,i have to connect my microphone hardware,which is involve an ADC in it,to parallel port. i'm having difficulty in sending data through parallel port.here's my problems:
1. how do i know if my parallel port support bi-directional system?
2. if my parallel port doesn't support bi-directional system,then if i want to send a data through it,i must use control and status ports,right? can control ports receive the data? i mean,their direction is "in/out",not just "in" like status ports or just "out" like data ports. so i'm a little bit confuse if i can use it or not.
3. i don't know how to receive data through parallel port using delphi 7.can you help me by make an example about it?
i hope you can help me.thank you!
|
|
|
|
 |
|
 |
Hi, I focused in my project on sending a lot of data out in the easiest way. I have read about turning the control port direction but it was difficult for me and it needs a more complex hardware so I dropped the idea. So I can not help you in this case. But the speech recognition software is interesting. I hope you will successfully finish your project. Have a good work and never give up.
|
|
|
|
 |
|
 |
ow..i see.
mmm,do you have another alternative for me to send my data except using parallel port?the easiest and fastest way,if there's such a way...
btw,thx for the support,i really appreciate it^^
|
|
|
|
 |
|
 |
Sorry, but the easiest way I know is sending data using the 5 input pin of the parallel port which is easy with this code.
|
|
|
|
 |
|
 |
Your source refers to a header file that isen't present in the rar file.
#include "PaPiC.h"
PaPiC.h isent included.
|
|
|
|
 |
|
 |
CPaPiC.h in not missing. Both of the zip files contain it. There is no PaPiC.h.
|
|
|
|
 |
|
 |
I have a problem: a program X send an output to the printer, but.... i need this output in a file in another computer. Then I need to "catch" this output trough the parallel port in another computer. I am using a cable DB25M - DB25M connected to the parallel port of both computers (this cable was used with a switch between two printers and worked properly), but.... i just can't do it, i don't know what happen, because i can read properly the ports: data, status and control.
I am using a visual C++ program to catch the output from the other computer trough the parallel port. The code i am using is something like this...
fin = 0;
count = 0;
data = _inp( dataport );
stat = _inp( statport );
ctrl = _inp( ctrlport );
do
{
ctrl = ctrl & 0x000000ff;
if( ctrl & 0x01 )
{
stat = stat | 0x80; // set the busy port on
retu = _outp( stat );
wait( (clock_t) 5 ); // wait for 5 micro-seconds
data = _inp( dataport );
printf( "Data read: 0x%2x\n", data );
stat = stat | 0x40; // set acknowledge on
retu = _outp( stat );
wait( (clock_t) 5 ); // wait for 5 micro-seconds
stat = stat & 0x7f; // set busy off
retu = _outp( stat );
stat = stat & 0xbf; // set ackn off
retu = _outp( stat );
++count;
}
if( _kbhit() != 0 )
{
c = getch();
if( c == 'c' || c == 'C' )
{
fin = 1;
printf("End of process\n");
}
}
} while( fin != 0 );
Could you please help me?
Thank you in advance for your attentions.
Regards.
|
|
|
|
 |
|
 |
Hi!
By the old LPT-chips only the status and control pins of the port are readable. (More precisely only the status and control pin's state can be changed externally.) Of course you can read the state of data and control pins, but only what you have set internally before.
I have read somewhere, that the new LPT-chips allow to use data pins as input, working in bidirectional mode, but I could't find anything useful in this subject. I visited some forums, but people in these found that only the status pins are useful for input data.
My simple solution is:
----------------------
Just connect the first 5 data pins (pin 2,3,4,5,6) of the 'A' comuter to the 'B' computer's 5 status pins (pin 10,11,12,13,15), and vice versa:
A B
2 - 10
3 - 11
4 - 12
5 - 13
6 - 15
10- 2
11- 3
12- 4
13- 5
15- 6
So you can trasmit 5 bits in a time unit bidirectional.
This is only I can advise.
Good luck!
g.
|
|
|
|
 |
|
 |
First of all, thank you so much for answer me, but i have some doubts (i hope u can help me):
1.- how can a printer "read" the data and put over paper?
2.- if a printer can do it, don't u think a "C" program or an "Assembler" program can do the same thing, but instead of put the data on paper, put in a file?
3.- if u mean that i must change the data-cable, how can i read 8 bits of data instead of 5?, because with 5 bits i have no complete chars, or can I have them? how?
4.- if this stat lines are converted in data lines, how can i say to the sender that i have processed the actual char and I need the "next" char?
Thank you in advance for your answers.
Regards my friend.
|
|
|
|
 |
|
 |
I think, my solution I have written to you is not good for catching data of printing.
1 - the printer has a special bus driver IC that can read adta, it is not the same that is in your computer's motherboard
2 - Unfortunately I don't know, how you can do it, I only know the very conservative usage of printer port, that is: status pins are only changeable, but it is enough:
3 - To read 8 bits instead of 5, it is possible to construct a relatively simlpy electronic, which reads the first 4 bit, puts it in a register then the last 4 bit and puts it together.
4 - It's a good question, I don't know..
But don't give it up! Try to find someone, who knows it.
Best regards.
|
|
|
|
 |
|
 |
If I try to handle input pins, some of the output pin values suddenly change. How can I turn off this?
gordius
|
|
|
|
 |
|
 |
If you are using WinXP, do the following steps:
(1) Execute regedit.exe
(2) Find the following registry key:
[HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\Parport]
(3) Insert a new key named "Parameters" (if not exist)
(4) Insert a new double word into "Parameters" with value "00000001"
(5) Restart Windows
After this WinXP will not disturb the outputs if you are switching the status pins.
|
|
|
|
 |
|
 |
hi i am unable to write any value on control pins where is the problem my computer is pentium cerelon but my other computer p4 have no problem,how can i solve this problem
hi
|
|
|
|
 |
|
 |
Hi! I have an idea, where is the problem, probably your computer is Ok (I have a Celeron too.). Give me two or three days and I will try to fix it and return. Hi.
|
|
|
|
 |
|
 |
Hi! Into the constructor I inserted a line which sets the mode of the parallel port. I suppose it was the problem, but I'm not sure. Please download and test it (CPaPiC.cpp). If the control lines still doesn't work I have no idea what's wrong. Hi.
|
|
|
|
 |
|
 |
I think you should modify your article just a little to indicate that what you've done is write a wrapper for the publically available inpout32.dll/inpout32.lib. There's nothing wrong with writing a wrapper and demonstrating its use, but people might get the impression you wrote the entire code - you didnt as far as I know (feel free to correct me and I'll apologize if required) ...
As far as I see, one source (which you fail to mention) for inpout32.dll/inpout32.lib is http://www.logix4u.net/inpout32.htm[^] with more notes on how it works http://www.logix4u.net/inpout_theory.htm[^], there may be other variants of it around .....
(modified) this link is also helpful if people are interested >> http://www.lvr.com/parport.htm[^]
Im trying not to put you down, but please acknowledge the work of others.
'g'
|
|
|
|
 |
|
 |
Hi 'g',
You are absolutely right, I should have indicated that this is a wrapper for inpout32.dll and inpout32.dll. I'm a beginner yet and I have made a mistake.
Thank you for your notice! I have corrected the article.
gordius
|
|
|
|
 |