LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Serial Communication using Parallel Port

Hi,

I would like to use the parallel port for serial communication. My application calls for programming an IC which has four serial lines working on SPI protocol. There are four serial lines, SCLK – Serial Clock, SDFS – Frame strobe, SDI – Serial Data In and SDO – Serial Data Out. So I should configure any 4 lines of the parallel port to output signals serially. Using VISA is it possible to configure the parallel port in this manner.

Yours faithfully,

R. Vishnu

0 Kudos
Message 1 of 7
(4,048 Views)
Basically, yes. You have to keep in mind that you have to write out the entire port. This means you have to read the port, change the bits you need to change, and then write out the port. You will, in essence, be doing bit-banging, so you will not be able to control the frequency, but that's not likely to be a problem. Search the LabVIEW examples (Help -> Find Examples) for "parallel" and you will come across a couple of examples on programming the parallel port.
Message 2 of 7
(4,024 Views)
Message 3 of 7
(4,010 Views)

If you're going to use a SPI device I would suggest looking at this one:

http://www.diolan.com/i2c/u2c12.html

 

It's cheaper than the Aardvark unit, though it's not as programmable as the Aardvark. At work here we actually have both the U2C-12 and the Aardvark, as well as a Cal-Bay unit. 

Message 4 of 7
(3,977 Views)
Hi,Thank you for all the suggestions. But I don’t plan to use any other external hardware for this purpose, simply because it is waste of money and resources. In an evaluation board for a Digital to Analog Converter (DAC), I found that the driver for programming the DAC was written using LabVIEW and the signals go from the PC parallel port to the SPI port of the DAC directly(except for a device to latch the signals to 3.3V).  The configuration is as follows:DB25 Connector        RJ451                                311                              514                              415                              117                              218                             6 

Here the RJ45 connector is the one on the evaluation board which routes the lines to the SPI port. That was why I went for this method (the main advantage of which is that it doesn’t require a micro-controller).

 

Regards,

R. Vishnu.

0 Kudos
Message 5 of 7
(3,958 Views)

vishnu4100 wrote:
Hi,Thank you for all the suggestions. But I don’t plan to use any other external hardware for this purpose, simply because it is waste of money and resources.

I would strongly disagree with this statement.

 

As I indicated, you can write to the parallel port. You have to do bit-banging, and you have to update the whole port, not just individual bits. The examples that ship with LabVIEW show you how to write to the parallel port. That's pretty much your answer, so I'm not sure what more you're looking for?

0 Kudos
Message 6 of 7
(3,935 Views)

to re-iterate, you do not need any additional hardware as you can use the parrallel port to write to SPI.  As smercurio says this is a way of doing it, however you will be writing one 'bit' of the serial word each time you write to the entire parrallel port.  I have no direct experience with SPI but i imagine like many of the others it is a latched asynchronous comms link, which means timing is not essential, hence this is a possible solution, even though the serial clock will be software timed.

Craig

LabVIEW 2012
0 Kudos
Message 7 of 7
(3,925 Views)