LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to generate 10M HZ signal through parallel port

Solved!
Go to solution

Hi every body here!

problem description: using the PC's parallel port to generate a squre waveform with a 10M HZ frequency.

possibility: I have read the IEEE1284 and known that when the port is set to ECP mode, it's output rate can reach 2.4MB/s, or 2.4*8=19.2Mb/s,so I supposed that the parallel port can generate a squre waveform at 9.8M HZ.

But when I write a program to test it, I found the output signal is at a much lower frequency,only 100k HZ which was far beyond my expection.

brief decription of my program:generate the squre signal data(by inverting a boolean repeatedly), flattern it to string and put the flatterned string to the visa's write buffer. In doing so I supposed that the parallel port control circuit can output the data as fast as it could. But it failed!Does there anything wrong? Thank you for pointing out someting gets wrong or giving some comments, thank you!

0 Kudos
Message 1 of 8
(6,238 Views)

Hi,

 

"I have read the IEEE1284 and known that when the port is set to ECP mode, it's output rate can reach 2.4MB/s, or 2.4*8=19.2Mb/s"

 

Well, you know it why it's called "parallel port"? It is called that way because the 8 bit lines are parallel...

 

When your information is valid, then you may be able to get max 2.4Mbits per line from your port. That's just a theoretical maximum. As the port is not intended to drive exact signals I doubt you will get a square waveform at that frequency...

 

 

 

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 8
(6,214 Views)

GerdW wrote:

Hi,

 

"I have read the IEEE1284 and known that when the port is set to ECP mode, it's output rate can reach 2.4MB/s, or 2.4*8=19.2Mb/s"

 

Well, you know it why it's called "parallel port"? It is called that way because the 8 bit lines are parallel...

 

When your information is valid, then you may be able to get max 2.4Mbits per line from your port. That's just a theoretical maximum. As the port is not intended to drive exact signals I doubt you will get a square waveform at that frequency...

 

 

 


 

-_-!  I am so sorry for making this so stupid problem.But there still left the question:from the  1284 standard, I can get a 2.4Mbit/s output, but there's only 50k. At first glance, I thought the unexpected low frequency was due to VISA because I had heared some complaints about the inefficiency of VISA, so I had an other version of my program using the raw in port.vi and out port.vi shipped with labview7.1, and the period of the outputed squre waveform was reduced from 20us to 18us.
0 Kudos
Message 3 of 8
(6,196 Views)

Hi,

 

having a signal length of 18µs on a port designed to drive printers is quite good. Smiley Wink

What else would you expect?

 

Does your computer really support data rates up to a standardization maximum or does it only support a "common sense" part of that specification? Even when the standard allows for high speed operation modes it doesn't need to be incorporated in the actual hardware...

 

It's like expecting 1MBit/s from an old serial port designed for 115kbit/s because some specification is allowing such mode...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 8
(6,194 Views)
Solution
Accepted by topic author 飞雨天

飞雨天 wrote:

Hi every body here!

problem description: using the PC's parallel port to generate a squre waveform with a 10M HZ frequency.

possibility: I have read the IEEE1284 and known that when the port is set to ECP mode, it's output rate can reach 2.4MB/s, or 2.4*8=19.2Mb/s,so I supposed that the parallel port can generate a squre waveform at 9.8M HZ.

But when I write a program to test it, I found the output signal is at a much lower frequency,only 100k HZ which was far beyond my expection.

brief decription of my program:generate the squre signal data(by inverting a boolean repeatedly), flattern it to string and put the flatterned string to the visa's write buffer. In doing so I supposed that the parallel port control circuit can output the data as fast as it could. But it failed!Does there anything wrong? Thank you for pointing out someting gets wrong or giving some comments, thank you!


Perhaps with a proper low level driver you could perhaps achieve 2.4MB/s rate. But I doubt it. Then using a high level language such as Labview you will certainly not get this high speed. And neither Labview for Windows, or Windows is designed for realtime applications so your timing will not be very accurate and highly dependent on both hardware and software running on the machine. I think your 100KHz frequency is not bad at all. You have a update rate equal to 200KHz. As you need two updates to toggle the pin status. one update to turn on and one to turn it off.   



Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
(Sorry no Labview "brag list" so far)
0 Kudos
Message 5 of 8
(6,187 Views)

How about a simple 10MHz oscillator and use one dig out for an enable?

Or hock up a DDS to the printerport 🙂

 

Greetings from Germany
Henrik

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'


0 Kudos
Message 6 of 8
(6,174 Views)

Henrik Volkers wrote:

How about a simple 10MHz oscillator and use one dig out for an enable?

Or hock up a DDS to the printerport 🙂

 


Thank you for your advice, but for some economical reason, I was told that the single parallel port can generate the required signal, and there already had a success solution by other people from other company. But after in-depth studying what indeed a parallel port is and how the 8255 chip works, I had enough reason to doubt the exactness of what I was told. After all, the device attached to the parallel port would work under a low frequency input such as 1k only sacrificing the speed and the 20M HZ is the highest frequency the perpheral device can accept.

      I had got some detail material dealing with parallel port, and decided to write a assembly program to see my parallel port's highest output frequency. If I would have got a higher frequency, I will post the result here. Now let's label this post as solved because 50k is a acceptable signal.

0 Kudos
Message 7 of 8
(6,142 Views)

GerdW wrote:

Hi,

 

having a signal length of 18µs on a port designed to drive printers is quite good. Smiley Wink

What else would you expect?

 

Does your computer really support data rates up to a standardization maximum or does it only support a "common sense" part of that specification? Even when the standard allows for high speed operation modes it doesn't need to be incorporated in the actual hardware...

 

It's like expecting 1MBit/s from an old serial port designed for 115kbit/s because some specification is allowing such mode...


Because I had found the ECP mode in my computer's BIOS setting, I thought the parallel port would support this mode. Then I assumed every parallel port, as long as it works under the ECP mode, it would comply with the IEEE 1284 that support up to 2.4MB/s output. But it seems as if I was wrong, for real hardware implementation does not need to support all the characters the standard defines. Thank you for such a impressive comments.

0 Kudos
Message 8 of 8
(6,136 Views)